1syntax = "proto3"; 2 3import "google/protobuf/empty.proto"; 4 5package blueberry.facade.topshim; 6 7service AdapterService { 8 rpc FetchEvents(FetchEventsRequest) returns (stream FetchEventsResponse) {} 9 rpc ToggleStack(ToggleStackRequest) returns (ToggleStackResponse) {} 10 rpc SetDiscoveryMode(SetDiscoveryModeRequest) returns (SetDiscoveryModeResponse) {} 11 rpc ClearEventFilter(google.protobuf.Empty) returns (google.protobuf.Empty) {} 12 rpc ClearEventMask(google.protobuf.Empty) returns (google.protobuf.Empty) {} 13 rpc ClearFilterAcceptList(google.protobuf.Empty) returns (google.protobuf.Empty) {} 14 rpc DisconnectAllAcls(google.protobuf.Empty) returns (google.protobuf.Empty) {} 15 rpc LeRand(google.protobuf.Empty) returns (google.protobuf.Empty) {} 16 rpc SetEventFilterConnectionSetupAllDevices(google.protobuf.Empty) returns (google.protobuf.Empty) {} 17 rpc AllowWakeByHid(google.protobuf.Empty) returns (google.protobuf.Empty) {} 18 rpc RestoreFilterAcceptList(google.protobuf.Empty) returns (google.protobuf.Empty) {} 19 rpc SetDefaultEventMaskExcept(SetDefaultEventMaskExceptRequest) returns (google.protobuf.Empty) {} 20 rpc SetEventFilterInquiryResultAllDevices(google.protobuf.Empty) returns (google.protobuf.Empty) {} 21 rpc SetLocalIoCaps(SetLocalIoCapsRequest) returns (SetLocalIoCapsResponse) {} 22 rpc ToggleDiscovery(ToggleDiscoveryRequest) returns (ToggleDiscoveryResponse) {} 23} 24 25service SecurityService { 26 rpc RemoveBond(RemoveBondRequest) returns (google.protobuf.Empty) {} 27 rpc GenerateLocalOobData(GenerateOobDataRequest) returns (google.protobuf.Empty) {} 28 rpc CreateBond(CreateBondRequest) returns (CreateBondResponse) {} 29} 30 31service GattService { 32 // Advertiser 33 rpc RegisterAdvertiser(google.protobuf.Empty) returns (google.protobuf.Empty) {} 34 rpc UnregisterAdvertiser(google.protobuf.Empty) returns (google.protobuf.Empty) {} 35 rpc GetOwnAddress(google.protobuf.Empty) returns (google.protobuf.Empty) {} 36 rpc SetParameters(google.protobuf.Empty) returns (google.protobuf.Empty) {} 37 rpc SetData(google.protobuf.Empty) returns (google.protobuf.Empty) {} 38 rpc AdvertisingEnable(google.protobuf.Empty) returns (google.protobuf.Empty) {} 39 rpc AdvertisingDisable(google.protobuf.Empty) returns (google.protobuf.Empty) {} 40 rpc SetPeriodicAdvertisingParameters(google.protobuf.Empty) returns (google.protobuf.Empty) {} 41 rpc SetPeriodicAdvertisingData(google.protobuf.Empty) returns (google.protobuf.Empty) {} 42 rpc SetPeriodicAdvertisingEnable(google.protobuf.Empty) returns (google.protobuf.Empty) {} 43 rpc StartAdvertising(google.protobuf.Empty) returns (google.protobuf.Empty) {} 44 rpc StartAdvertisingSet(google.protobuf.Empty) returns (google.protobuf.Empty) {} 45 46 // Scanner 47 rpc RegisterScanner(google.protobuf.Empty) returns (google.protobuf.Empty) {} 48 rpc UnregisterScanner(google.protobuf.Empty) returns (google.protobuf.Empty) {} 49 rpc StartScan(google.protobuf.Empty) returns (google.protobuf.Empty) {} 50 rpc StopScan(google.protobuf.Empty) returns (google.protobuf.Empty) {} 51 rpc ScanFilterSetup(google.protobuf.Empty) returns (google.protobuf.Empty) {} 52 rpc ScanFilterAdd(google.protobuf.Empty) returns (google.protobuf.Empty) {} 53 rpc ScanFilterClear(google.protobuf.Empty) returns (google.protobuf.Empty) {} 54 rpc ScanFilterEnable(google.protobuf.Empty) returns (google.protobuf.Empty) {} 55 rpc ScanFilterDisable(google.protobuf.Empty) returns (google.protobuf.Empty) {} 56 rpc SetScanParameters(google.protobuf.Empty) returns (google.protobuf.Empty) {} 57 rpc BatchScanConfigStorage(google.protobuf.Empty) returns (google.protobuf.Empty) {} 58 rpc BatchScanEnable(google.protobuf.Empty) returns (google.protobuf.Empty) {} 59 rpc BatchScanDisable(google.protobuf.Empty) returns (google.protobuf.Empty) {} 60 rpc BatchScanReadReports(google.protobuf.Empty) returns (google.protobuf.Empty) {} 61 rpc StartSync(google.protobuf.Empty) returns (google.protobuf.Empty) {} 62 rpc StopSync(google.protobuf.Empty) returns (google.protobuf.Empty) {} 63 rpc CancelCreateSync(google.protobuf.Empty) returns (google.protobuf.Empty) {} 64 rpc TransferSync(google.protobuf.Empty) returns (google.protobuf.Empty) {} 65 rpc TransferSetInfo(google.protobuf.Empty) returns (google.protobuf.Empty) {} 66 rpc SyncTxParameters(google.protobuf.Empty) returns (google.protobuf.Empty) {} 67 68 // Gatt Client 69 rpc RegisterClient(google.protobuf.Empty) returns (google.protobuf.Empty) {} 70 rpc UnregisterClient(google.protobuf.Empty) returns (google.protobuf.Empty) {} 71 rpc ClientConnect(google.protobuf.Empty) returns (google.protobuf.Empty) {} 72 rpc ClientDisconnect(google.protobuf.Empty) returns (google.protobuf.Empty) {} 73 rpc Refresh(google.protobuf.Empty) returns (google.protobuf.Empty) {} 74 rpc SearchService(google.protobuf.Empty) returns (google.protobuf.Empty) {} 75 rpc BtifGattcDiscoverServiceByUuid(google.protobuf.Empty) returns (google.protobuf.Empty) {} 76 rpc ReadCharacteristic(google.protobuf.Empty) returns (google.protobuf.Empty) {} 77 rpc ReadUsingCharacteristicUuid(google.protobuf.Empty) returns (google.protobuf.Empty) {} 78 rpc WriteCharacteristic(google.protobuf.Empty) returns (google.protobuf.Empty) {} 79 rpc ReadDescriptor(google.protobuf.Empty) returns (google.protobuf.Empty) {} 80 rpc WriteDescriptor(google.protobuf.Empty) returns (google.protobuf.Empty) {} 81 rpc ExecuteWrite(google.protobuf.Empty) returns (google.protobuf.Empty) {} 82 rpc RegisterForNotification(google.protobuf.Empty) returns (google.protobuf.Empty) {} 83 rpc DeregisterForNotification(google.protobuf.Empty) returns (google.protobuf.Empty) {} 84 rpc ReadRemoteRssi(google.protobuf.Empty) returns (google.protobuf.Empty) {} 85 rpc GetDeviceType(google.protobuf.Empty) returns (google.protobuf.Empty) {} 86 rpc ConfigureMtu(google.protobuf.Empty) returns (google.protobuf.Empty) {} 87 rpc ConnParameterUpdate(google.protobuf.Empty) returns (google.protobuf.Empty) {} 88 rpc ClientSetPreferredPhy(google.protobuf.Empty) returns (google.protobuf.Empty) {} 89 rpc ClientReadPhy(google.protobuf.Empty) returns (google.protobuf.Empty) {} 90 rpc TestCommand(google.protobuf.Empty) returns (google.protobuf.Empty) {} 91 rpc GetGattDb(google.protobuf.Empty) returns (google.protobuf.Empty) {} 92 93 // Gatt Server 94 rpc RegisterServer(google.protobuf.Empty) returns (google.protobuf.Empty) {} 95 rpc UnregisterServer(google.protobuf.Empty) returns (google.protobuf.Empty) {} 96 rpc ServerConnect(google.protobuf.Empty) returns (google.protobuf.Empty) {} 97 rpc ServerDisconnect(google.protobuf.Empty) returns (google.protobuf.Empty) {} 98 rpc AddService(google.protobuf.Empty) returns (google.protobuf.Empty) {} 99 rpc StopService(google.protobuf.Empty) returns (google.protobuf.Empty) {} 100 rpc DeleteService(google.protobuf.Empty) returns (google.protobuf.Empty) {} 101 rpc SendIndication(google.protobuf.Empty) returns (google.protobuf.Empty) {} 102 rpc SendResponse(google.protobuf.Empty) returns (google.protobuf.Empty) {} 103 rpc ServerSetPreferredPhy(google.protobuf.Empty) returns (google.protobuf.Empty) {} 104 rpc ServerReadPhy(google.protobuf.Empty) returns (google.protobuf.Empty) {} 105} 106 107service HfpService { 108 rpc StartSlc(StartSlcRequest) returns (google.protobuf.Empty) {} 109 rpc StopSlc(StopSlcRequest) returns (google.protobuf.Empty) {} 110 rpc ConnectAudio(ConnectAudioRequest) returns (google.protobuf.Empty) {} 111 rpc DisconnectAudio(DisconnectAudioRequest) returns (google.protobuf.Empty) {} 112 rpc SetVolume(SetVolumeRequest) returns (google.protobuf.Empty) {} 113 rpc FetchEvents(FetchEventsRequest) returns (stream FetchEventsResponse) {} 114} 115 116service HfClientService { 117 rpc StartSlc(StartSlcRequest) returns (StartSlcResponse) {} 118 rpc StopSlc(StopSlcRequest) returns (StopSlcResponse) {} 119 rpc ConnectAudio(ConnectAudioRequest) returns (ConnectAudioResponse) {} 120 rpc DisconnectAudio(DisconnectAudioRequest) returns (DisconnectAudioResponse) {} 121} 122 123enum EventType { 124 ADAPTER_STATE = 0; 125 SSP_REQUEST = 1; 126 LE_RAND = 2; 127 GENERATE_LOCAL_OOB_DATA = 3; 128 HFP_CONNECTION_STATE = 4; 129 ADAPTER_PROPERTY = 5; 130 DISCOVERY_STATE = 6; 131 DEVICE_FOUND = 7; 132 BOND_STATE = 8; 133} 134 135message FetchEventsRequest {} 136 137message FetchEventsResponse { 138 EventType event_type = 1; 139 string data = 2; 140 // Storing all event related data as a key-value pair. 141 map<string, EventData> params = 3; 142} 143 144message EventData { 145 repeated string data = 1; 146} 147 148message ToggleStackRequest { 149 bool start_stack = 1; // True for enable; false for disable 150} 151 152message ToggleStackResponse {} 153 154message SetDiscoveryModeRequest { 155 bool enable_page_scan = 1; 156 bool enable_inquiry_scan = 2; 157} 158 159message SetDiscoveryModeResponse { 160 int32 status = 1; 161} 162 163service MediaService { 164 rpc StartA2dp(StartA2dpRequest) returns (StartA2dpResponse) {} 165 rpc A2dpSourceConnect(A2dpSourceConnectRequest) returns (A2dpSourceConnectResponse) {} 166 rpc A2dpSourceSetActiveDevice(A2dpSourceSetActiveDeviceRequest) returns (A2dpSourceSetActiveDevicetResponse) {} 167} 168 169message StartA2dpRequest { 170 bool start_a2dp_source = 1; 171 bool start_a2dp_sink = 2; 172} 173 174message StartA2dpResponse {} 175 176message A2dpSourceConnectRequest { 177 string address = 1; 178} 179 180message A2dpSourceConnectResponse {} 181 182message A2dpSourceSetActiveDeviceRequest { 183 string address = 1; 184} 185 186message A2dpSourceSetActiveDevicetResponse {} 187 188message RemoveBondRequest { 189 string address = 1; 190} 191 192message StartSlcRequest { 193 Connection connection = 1; 194} 195 196message StartSlcResponse { 197 int32 status = 1; 198} 199 200message StopSlcRequest { 201 Connection connection = 1; 202} 203 204message StopSlcResponse { 205 int32 status = 1; 206} 207 208message ConnectAudioRequest { 209 Connection connection = 1; 210 bool is_sco_offload_enabled = 2; 211 int32 disabled_codecs = 3; 212} 213 214message ConnectAudioResponse { 215 int32 status = 1; 216} 217 218message DisconnectAudioRequest { 219 Connection connection = 1; 220} 221 222message DisconnectAudioResponse { 223 int32 status = 1; 224} 225 226message SetVolumeRequest { 227 Connection connection = 1; 228 int32 volume = 2; 229} 230 231message SetDefaultEventMaskExceptRequest { 232 uint64 mask = 1; 233 uint64 le_mask = 2; 234} 235 236// A Token representing an ACL connection. 237// It's acquired via a Connect on the Host service (Bluetooth Core stack in our case). 238message Connection { 239// For our HFP APIs this would store the bluetooth address but staying consistent with Pandora naming. 240 bytes cookie = 1; 241} 242 243message GenerateOobDataRequest { 244 int32 transport = 1; 245} 246 247message SetLocalIoCapsRequest { 248 int32 io_capability = 1; 249} 250 251message SetLocalIoCapsResponse { 252 int32 status = 1; 253} 254 255message ToggleDiscoveryRequest { 256 bool is_start = 1; 257} 258 259message ToggleDiscoveryResponse { 260 int32 status = 1; 261} 262 263message CreateBondRequest { 264 string address = 1; 265 int32 transport = 2; 266} 267 268message CreateBondResponse { 269 int32 status = 1; 270} 271