Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Next MinVersion: 6 | 5 // Next MinVersion: 7 |
| 6 | 6 |
| 7 module arc.mojom; | 7 module arc.mojom; |
| 8 | 8 |
| 9 import "mojo/common/common_custom_types.mojom"; | 9 import "mojo/common/common_custom_types.mojom"; |
| 10 | 10 |
| 11 [Extensible] | 11 [Extensible] |
| 12 enum BluetoothAdapterState { | 12 enum BluetoothAdapterState { |
| 13 OFF = 0, | 13 OFF = 0, |
| 14 ON | 14 ON |
| 15 }; | 15 }; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 uint8 is_primary; | 164 uint8 is_primary; |
| 165 }; | 165 }; |
| 166 | 166 |
| 167 struct BluetoothGattValue { | 167 struct BluetoothGattValue { |
| 168 BluetoothGattStatus status; | 168 BluetoothGattStatus status; |
| 169 array<uint8> value; | 169 array<uint8> value; |
| 170 }; | 170 }; |
| 171 | 171 |
| 172 const int8 kUnknownPower = 127; | 172 const int8 kUnknownPower = 127; |
| 173 | 173 |
| 174 // Copied from Android Bluetooth package. See AdvertiseManager$AdvertiseNative | |
| 175 // http://goo.gl/UnKC5N | |
|
rickyz (no longer on Chrome)
2016/09/14 20:47:27
I wish there were a better way to link to an ident
| |
| 176 enum BluetoothAdvertisementType { | |
| 177 ADV_TYPE_CONNECTABLE = 0, | |
| 178 ADV_TYPE_SCANNABLE = 2, | |
| 179 ADV_TYPE_NON_CONNECTABLE = 3, | |
| 180 }; | |
| 181 | |
| 174 // Copy from Bluetooth Assigned Numbers Document, Generic Access Profile | 182 // Copy from Bluetooth Assigned Numbers Document, Generic Access Profile |
| 175 // https://www.bluetooth.com/specifications/assigned-numbers/generic-access-prof ile | 183 // https://www.bluetooth.com/specifications/assigned-numbers/generic-access-prof ile |
| 176 [Extensible] | 184 [Extensible] |
| 177 enum BluetoothAdvertisingDataType { | 185 enum BluetoothAdvertisingDataType { |
| 178 DATA_TYPE_FLAGS = 0x01, | 186 DATA_TYPE_FLAGS = 0x01, |
| 179 DATA_TYPE_SERVICE_UUIDS_16_BIT_COMPLETE = 0x03, | 187 DATA_TYPE_SERVICE_UUIDS_16_BIT_COMPLETE = 0x03, |
| 180 DATA_TYPE_SERVICE_UUIDS_128_BIT_COMPLETE = 0x07, | 188 DATA_TYPE_SERVICE_UUIDS_128_BIT_COMPLETE = 0x07, |
| 181 DATA_TYPE_LOCAL_NAME_COMPLETE = 0x09, | 189 DATA_TYPE_LOCAL_NAME_COMPLETE = 0x09, |
| 182 DATA_TYPE_TX_POWER_LEVEL = 0x0A, | 190 DATA_TYPE_TX_POWER_LEVEL = 0x0A, |
| 183 DATA_TYPE_SERVICE_DATA = 0x16, | 191 DATA_TYPE_SERVICE_DATA = 0x16, |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 196 BluetoothServiceData service_data; | 204 BluetoothServiceData service_data; |
| 197 array<uint8> manufacturer_data; | 205 array<uint8> manufacturer_data; |
| 198 array<uint8> other_data; | 206 array<uint8> other_data; |
| 199 }; | 207 }; |
| 200 | 208 |
| 201 struct BluetoothServiceData { | 209 struct BluetoothServiceData { |
| 202 uint16 uuid_16bit; | 210 uint16 uuid_16bit; |
| 203 array<uint8> data; | 211 array<uint8> data; |
| 204 }; | 212 }; |
| 205 | 213 |
| 214 struct BluetoothAdvertisement { | |
| 215 BluetoothAdvertisementType type; | |
| 216 bool include_tx_power; | |
| 217 array<BluetoothAdvertisingData> data; | |
| 218 // Add more here as Chrome supports it. | |
| 219 }; | |
| 220 | |
| 206 [Extensible] | 221 [Extensible] |
| 207 enum BluetoothGattDBAttributeType { | 222 enum BluetoothGattDBAttributeType { |
| 208 BTGATT_DB_PRIMARY_SERVICE = 0, | 223 BTGATT_DB_PRIMARY_SERVICE = 0, |
| 209 BTGATT_DB_SECONDARY_SERVICE, | 224 BTGATT_DB_SECONDARY_SERVICE, |
| 210 BTGATT_DB_INCLUDED_SERVICE, | 225 BTGATT_DB_INCLUDED_SERVICE, |
| 211 BTGATT_DB_CHARACTERISTIC, | 226 BTGATT_DB_CHARACTERISTIC, |
| 212 BTGATT_DB_DESCRIPTOR, | 227 BTGATT_DB_DESCRIPTOR, |
| 213 }; | 228 }; |
| 214 | 229 |
| 215 struct BluetoothGattDBElement { | 230 struct BluetoothGattDBElement { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 263 | 278 |
| 264 struct BluetoothSdpRecord { | 279 struct BluetoothSdpRecord { |
| 265 map<uint16, BluetoothSdpAttribute> attrs; | 280 map<uint16, BluetoothSdpAttribute> attrs; |
| 266 }; | 281 }; |
| 267 | 282 |
| 268 struct BluetoothCreateSdpRecordResult { | 283 struct BluetoothCreateSdpRecordResult { |
| 269 BluetoothStatus status; | 284 BluetoothStatus status; |
| 270 uint32 service_handle; | 285 uint32 service_handle; |
| 271 }; | 286 }; |
| 272 | 287 |
| 273 // Next Method ID: 40 | 288 // Next Method ID: 43 |
| 274 interface BluetoothHost { | 289 interface BluetoothHost { |
| 275 EnableAdapter@0() => (BluetoothAdapterState state); | 290 EnableAdapter@0() => (BluetoothAdapterState state); |
| 276 DisableAdapter@1() => (BluetoothAdapterState state); | 291 DisableAdapter@1() => (BluetoothAdapterState state); |
| 277 GetAdapterProperty@2(BluetoothPropertyType type); | 292 GetAdapterProperty@2(BluetoothPropertyType type); |
| 278 SetAdapterProperty@3(BluetoothProperty property); | 293 SetAdapterProperty@3(BluetoothProperty property); |
| 279 GetRemoteDeviceProperty@4(BluetoothAddress remote_addr, | 294 GetRemoteDeviceProperty@4(BluetoothAddress remote_addr, |
| 280 BluetoothPropertyType type); | 295 BluetoothPropertyType type); |
| 281 SetRemoteDeviceProperty@5(BluetoothAddress remote_addr, | 296 SetRemoteDeviceProperty@5(BluetoothAddress remote_addr, |
| 282 BluetoothProperty property); | 297 BluetoothProperty property); |
| 283 GetRemoteServiceRecord@6(BluetoothAddress remote_addr, | 298 GetRemoteServiceRecord@6(BluetoothAddress remote_addr, |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 363 array<uint8> value) | 378 array<uint8> value) |
| 364 => (BluetoothGattStatus status); | 379 => (BluetoothGattStatus status); |
| 365 | 380 |
| 366 // Bluetooth SDP functions | 381 // Bluetooth SDP functions |
| 367 [MinVersion=5] GetSdpRecords@37(BluetoothAddress remote_addr, | 382 [MinVersion=5] GetSdpRecords@37(BluetoothAddress remote_addr, |
| 368 BluetoothUUID target_uuid); | 383 BluetoothUUID target_uuid); |
| 369 [MinVersion=5] CreateSdpRecord@38(BluetoothSdpRecord record) | 384 [MinVersion=5] CreateSdpRecord@38(BluetoothSdpRecord record) |
| 370 => (BluetoothCreateSdpRecordResult result); | 385 => (BluetoothCreateSdpRecordResult result); |
| 371 [MinVersion=5] RemoveSdpRecord@39(uint32 service_handle) | 386 [MinVersion=5] RemoveSdpRecord@39(uint32 service_handle) |
| 372 => (BluetoothStatus status); | 387 => (BluetoothStatus status); |
| 388 | |
| 389 // Multi-advertisement functions | |
| 390 [MinVersion=6] ReserveAdvertisementHandle@40() | |
| 391 => (BluetoothGattStatus status, int32 adv_handle); | |
| 392 [MinVersion=6] BroadcastAdvertisement@41(int32 adv_handle, | |
| 393 BluetoothAdvertisement adv) | |
| 394 => (BluetoothGattStatus status); | |
| 395 [MinVersion=6] ReleaseAdvertisementHandle@42(int32 adv_handle) | |
| 396 => (BluetoothGattStatus status); | |
| 373 }; | 397 }; |
| 374 | 398 |
| 375 // Next Method ID: 18 | 399 // Next Method ID: 18 |
| 376 interface BluetoothInstance { | 400 interface BluetoothInstance { |
| 377 Init@0(BluetoothHost host_ptr); | 401 Init@0(BluetoothHost host_ptr); |
| 378 | 402 |
| 379 OnAdapterProperties@1(BluetoothStatus status, | 403 OnAdapterProperties@1(BluetoothStatus status, |
| 380 array<BluetoothProperty> properties); | 404 array<BluetoothProperty> properties); |
| 381 OnRemoteDeviceProperties@2(BluetoothStatus status, | 405 OnRemoteDeviceProperties@2(BluetoothStatus status, |
| 382 BluetoothAddress address, | 406 BluetoothAddress address, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 424 int32 offset, | 448 int32 offset, |
| 425 array<uint8> value) | 449 array<uint8> value) |
| 426 => (BluetoothGattStatus status); | 450 => (BluetoothGattStatus status); |
| 427 | 451 |
| 428 // Bluetooth SDP function | 452 // Bluetooth SDP function |
| 429 [MinVersion=5] OnGetSdpRecords@17(BluetoothStatus status, | 453 [MinVersion=5] OnGetSdpRecords@17(BluetoothStatus status, |
| 430 BluetoothAddress remove_addr, | 454 BluetoothAddress remove_addr, |
| 431 BluetoothUUID target_uuid, | 455 BluetoothUUID target_uuid, |
| 432 array<BluetoothSdpRecord> records); | 456 array<BluetoothSdpRecord> records); |
| 433 }; | 457 }; |
| OLD | NEW |