1syntax = "proto3"; 2 3option java_outer_classname = "HfpProto"; 4 5package pandora; 6 7import "pandora/host.proto"; 8import "google/protobuf/empty.proto"; 9 10// Service to trigger HFP (Hands Free Profile) procedures. 11service HFP { 12 // Enable Service level connection 13 rpc EnableSlc(EnableSlcRequest) returns (google.protobuf.Empty); 14 // Disable Service level connection 15 rpc DisableSlc(DisableSlcRequest) returns (google.protobuf.Empty); 16 // Change the battery level to the one requested 17 rpc SetBatteryLevel(SetBatteryLevelRequest) returns (google.protobuf.Empty); 18 // Make a call 19 rpc MakeCall(MakeCallRequest) returns (MakeCallResponse); 20 // Answer a call 21 rpc AnswerCall(AnswerCallRequest) returns (AnswerCallResponse); 22 // Decline a call 23 rpc DeclineCall(DeclineCallRequest) returns (DeclineCallResponse); 24 // Set the audio path 25 rpc SetAudioPath(SetAudioPathRequest) returns (SetAudioPathResponse); 26 // Swap the active and held call 27 rpc SwapActiveCall(SwapActiveCallRequest) returns (SwapActiveCallResponse); 28 // Set in-band ringtone 29 rpc SetInBandRingtone(SetInBandRingtoneRequest) returns (SetInBandRingtoneResponse); 30 // Set voice recognition 31 rpc SetVoiceRecognition(SetVoiceRecognitionRequest) returns (SetVoiceRecognitionResponse); 32 // Clear the call history 33 rpc ClearCallHistory(ClearCallHistoryRequest) returns (ClearCallHistoryResponse); 34 // Answer an incoming call from a peer device (as a handsfree) 35 rpc AnswerCallAsHandsfree(AnswerCallAsHandsfreeRequest) returns (AnswerCallAsHandsfreeResponse); 36 // End a call from a peer device (as a handsfree) 37 rpc EndCallAsHandsfree(EndCallAsHandsfreeRequest) returns (EndCallAsHandsfreeResponse); 38 // Decline an incoming call from a peer device (as a handsfree) 39 rpc DeclineCallAsHandsfree(DeclineCallAsHandsfreeRequest) returns (DeclineCallAsHandsfreeResponse); 40 // Connect to an incoming audio stream from a peer device (as a handsfree) 41 rpc ConnectToAudioAsHandsfree(ConnectToAudioAsHandsfreeRequest) returns (ConnectToAudioAsHandsfreeResponse); 42 // Disconnect from an incoming audio stream from a peer device (as a handsfree) 43 rpc DisconnectFromAudioAsHandsfree(DisconnectFromAudioAsHandsfreeRequest) returns (DisconnectFromAudioAsHandsfreeResponse); 44 // Make a call to a given phone number (as a handsfree) 45 rpc MakeCallAsHandsfree(MakeCallAsHandsfreeRequest) returns (MakeCallAsHandsfreeResponse); 46 // Connect a call on hold, and disconnect the current call (as a handsfree) 47 rpc CallTransferAsHandsfree(CallTransferAsHandsfreeRequest) returns (CallTransferAsHandsfreeResponse); 48 // Enable Service level connection (as a handsfree) 49 rpc EnableSlcAsHandsfree(EnableSlcAsHandsfreeRequest) returns (google.protobuf.Empty); 50 // Disable Service level connection (as a handsfree) 51 rpc DisableSlcAsHandsfree(DisableSlcAsHandsfreeRequest) returns (google.protobuf.Empty); 52 // Set voice recognition (as a handsfree) 53 rpc SetVoiceRecognitionAsHandsfree(SetVoiceRecognitionAsHandsfreeRequest) returns (SetVoiceRecognitionAsHandsfreeResponse); 54 // Send DTMF code from the handsfree 55 rpc SendDtmfFromHandsfree(SendDtmfFromHandsfreeRequest) returns (SendDtmfFromHandsfreeResponse); 56} 57 58// Request of the `EnableSlc` method. 59message EnableSlcRequest { 60 // Connection crafted by grpc server 61 Connection connection = 1; 62} 63 64// Request of the `DisableSlc` method. 65message DisableSlcRequest { 66 // Connection crafted by grpc server 67 Connection connection = 1; 68} 69 70// Request of the `SetBatteryLevel` method. 71message SetBatteryLevelRequest { 72 // Connection crafted by grpc server 73 Connection connection = 1; 74 // Battery level to be set on the DUT 75 int32 battery_percentage = 2; 76} 77 78message AnswerCallRequest {} 79 80message AnswerCallResponse {} 81 82message DeclineCallRequest {} 83 84message DeclineCallResponse {} 85 86enum AudioPath { 87 AUDIO_PATH_UNKNOWN = 0; 88 AUDIO_PATH_SPEAKERS = 1; 89 AUDIO_PATH_HANDSFREE = 2; 90} 91 92message SetAudioPathRequest { 93 AudioPath audio_path = 1; 94} 95 96message SetAudioPathResponse {} 97 98message SwapActiveCallRequest {} 99 100message SwapActiveCallResponse {} 101 102message SetInBandRingtoneRequest { 103 bool enabled = 1; 104} 105 106message SetInBandRingtoneResponse {} 107 108message MakeCallRequest { 109 string number = 1; 110} 111 112message MakeCallResponse {} 113 114message SetVoiceRecognitionRequest { 115 Connection connection = 1; 116 bool enabled = 2; 117} 118 119message SetVoiceRecognitionResponse {} 120 121message ClearCallHistoryRequest {} 122 123message ClearCallHistoryResponse {} 124 125message AnswerCallAsHandsfreeRequest { 126 Connection connection = 1; 127} 128 129message AnswerCallAsHandsfreeResponse {} 130 131message EndCallAsHandsfreeRequest { 132 Connection connection = 1; 133} 134 135message EndCallAsHandsfreeResponse {} 136 137message DeclineCallAsHandsfreeRequest { 138 Connection connection = 1; 139} 140 141message DeclineCallAsHandsfreeResponse {} 142 143message ConnectToAudioAsHandsfreeRequest { 144 Connection connection = 1; 145} 146 147message ConnectToAudioAsHandsfreeResponse {} 148 149message DisconnectFromAudioAsHandsfreeRequest { 150 Connection connection = 1; 151} 152 153message DisconnectFromAudioAsHandsfreeResponse {} 154 155message MakeCallAsHandsfreeRequest { 156 Connection connection = 1; 157 string number = 2; 158} 159 160message MakeCallAsHandsfreeResponse {} 161 162message CallTransferAsHandsfreeRequest { 163 Connection connection = 1; 164} 165 166message CallTransferAsHandsfreeResponse {} 167 168message EnableSlcAsHandsfreeRequest { 169 Connection connection = 1; 170} 171 172message DisableSlcAsHandsfreeRequest { 173 Connection connection = 1; 174} 175 176message SetVoiceRecognitionAsHandsfreeRequest { 177 Connection connection = 1; 178 bool enabled = 2; 179} 180 181message SetVoiceRecognitionAsHandsfreeResponse {} 182 183message SendDtmfFromHandsfreeRequest { 184 Connection connection = 1; 185 uint32 code = 2; 186} 187 188message SendDtmfFromHandsfreeResponse {} 189