| 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: 7 | 5 // Next MinVersion: 6 |
| 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 | |
| 176 enum BluetoothAdvertisementType { | |
| 177 ADV_TYPE_CONNECTABLE = 0, | |
| 178 ADV_TYPE_SCANNABLE = 2, | |
| 179 ADV_TYPE_NON_CONNECTABLE = 3, | |
| 180 }; | |
| 181 | |
| 182 // Copy from Bluetooth Assigned Numbers Document, Generic Access Profile | 174 // Copy from Bluetooth Assigned Numbers Document, Generic Access Profile |
| 183 // https://www.bluetooth.com/specifications/assigned-numbers/generic-access-prof
ile | 175 // https://www.bluetooth.com/specifications/assigned-numbers/generic-access-prof
ile |
| 184 [Extensible] | 176 [Extensible] |
| 185 enum BluetoothAdvertisingDataType { | 177 enum BluetoothAdvertisingDataType { |
| 186 DATA_TYPE_FLAGS = 0x01, | 178 DATA_TYPE_FLAGS = 0x01, |
| 187 DATA_TYPE_SERVICE_UUIDS_16_BIT_COMPLETE = 0x03, | 179 DATA_TYPE_SERVICE_UUIDS_16_BIT_COMPLETE = 0x03, |
| 188 DATA_TYPE_SERVICE_UUIDS_128_BIT_COMPLETE = 0x07, | 180 DATA_TYPE_SERVICE_UUIDS_128_BIT_COMPLETE = 0x07, |
| 189 DATA_TYPE_LOCAL_NAME_COMPLETE = 0x09, | 181 DATA_TYPE_LOCAL_NAME_COMPLETE = 0x09, |
| 190 DATA_TYPE_TX_POWER_LEVEL = 0x0A, | 182 DATA_TYPE_TX_POWER_LEVEL = 0x0A, |
| 191 DATA_TYPE_SERVICE_DATA = 0x16, | 183 DATA_TYPE_SERVICE_DATA = 0x16, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 204 BluetoothServiceData service_data; | 196 BluetoothServiceData service_data; |
| 205 array<uint8> manufacturer_data; | 197 array<uint8> manufacturer_data; |
| 206 array<uint8> other_data; | 198 array<uint8> other_data; |
| 207 }; | 199 }; |
| 208 | 200 |
| 209 struct BluetoothServiceData { | 201 struct BluetoothServiceData { |
| 210 uint16 uuid_16bit; | 202 uint16 uuid_16bit; |
| 211 array<uint8> data; | 203 array<uint8> data; |
| 212 }; | 204 }; |
| 213 | 205 |
| 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 | |
| 221 [Extensible] | 206 [Extensible] |
| 222 enum BluetoothGattDBAttributeType { | 207 enum BluetoothGattDBAttributeType { |
| 223 BTGATT_DB_PRIMARY_SERVICE = 0, | 208 BTGATT_DB_PRIMARY_SERVICE = 0, |
| 224 BTGATT_DB_SECONDARY_SERVICE, | 209 BTGATT_DB_SECONDARY_SERVICE, |
| 225 BTGATT_DB_INCLUDED_SERVICE, | 210 BTGATT_DB_INCLUDED_SERVICE, |
| 226 BTGATT_DB_CHARACTERISTIC, | 211 BTGATT_DB_CHARACTERISTIC, |
| 227 BTGATT_DB_DESCRIPTOR, | 212 BTGATT_DB_DESCRIPTOR, |
| 228 }; | 213 }; |
| 229 | 214 |
| 230 struct BluetoothGattDBElement { | 215 struct BluetoothGattDBElement { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 | 263 |
| 279 struct BluetoothSdpRecord { | 264 struct BluetoothSdpRecord { |
| 280 map<uint16, BluetoothSdpAttribute> attrs; | 265 map<uint16, BluetoothSdpAttribute> attrs; |
| 281 }; | 266 }; |
| 282 | 267 |
| 283 struct BluetoothCreateSdpRecordResult { | 268 struct BluetoothCreateSdpRecordResult { |
| 284 BluetoothStatus status; | 269 BluetoothStatus status; |
| 285 uint32 service_handle; | 270 uint32 service_handle; |
| 286 }; | 271 }; |
| 287 | 272 |
| 288 // Next Method ID: 43 | 273 // Next Method ID: 40 |
| 289 interface BluetoothHost { | 274 interface BluetoothHost { |
| 290 EnableAdapter@0() => (BluetoothAdapterState state); | 275 EnableAdapter@0() => (BluetoothAdapterState state); |
| 291 DisableAdapter@1() => (BluetoothAdapterState state); | 276 DisableAdapter@1() => (BluetoothAdapterState state); |
| 292 GetAdapterProperty@2(BluetoothPropertyType type); | 277 GetAdapterProperty@2(BluetoothPropertyType type); |
| 293 SetAdapterProperty@3(BluetoothProperty property); | 278 SetAdapterProperty@3(BluetoothProperty property); |
| 294 GetRemoteDeviceProperty@4(BluetoothAddress remote_addr, | 279 GetRemoteDeviceProperty@4(BluetoothAddress remote_addr, |
| 295 BluetoothPropertyType type); | 280 BluetoothPropertyType type); |
| 296 SetRemoteDeviceProperty@5(BluetoothAddress remote_addr, | 281 SetRemoteDeviceProperty@5(BluetoothAddress remote_addr, |
| 297 BluetoothProperty property); | 282 BluetoothProperty property); |
| 298 GetRemoteServiceRecord@6(BluetoothAddress remote_addr, | 283 GetRemoteServiceRecord@6(BluetoothAddress remote_addr, |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 array<uint8> value) | 363 array<uint8> value) |
| 379 => (BluetoothGattStatus status); | 364 => (BluetoothGattStatus status); |
| 380 | 365 |
| 381 // Bluetooth SDP functions | 366 // Bluetooth SDP functions |
| 382 [MinVersion=5] GetSdpRecords@37(BluetoothAddress remote_addr, | 367 [MinVersion=5] GetSdpRecords@37(BluetoothAddress remote_addr, |
| 383 BluetoothUUID target_uuid); | 368 BluetoothUUID target_uuid); |
| 384 [MinVersion=5] CreateSdpRecord@38(BluetoothSdpRecord record) | 369 [MinVersion=5] CreateSdpRecord@38(BluetoothSdpRecord record) |
| 385 => (BluetoothCreateSdpRecordResult result); | 370 => (BluetoothCreateSdpRecordResult result); |
| 386 [MinVersion=5] RemoveSdpRecord@39(uint32 service_handle) | 371 [MinVersion=5] RemoveSdpRecord@39(uint32 service_handle) |
| 387 => (BluetoothStatus status); | 372 => (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); | |
| 397 }; | 373 }; |
| 398 | 374 |
| 399 // Next Method ID: 18 | 375 // Next Method ID: 18 |
| 400 interface BluetoothInstance { | 376 interface BluetoothInstance { |
| 401 Init@0(BluetoothHost host_ptr); | 377 Init@0(BluetoothHost host_ptr); |
| 402 | 378 |
| 403 OnAdapterProperties@1(BluetoothStatus status, | 379 OnAdapterProperties@1(BluetoothStatus status, |
| 404 array<BluetoothProperty> properties); | 380 array<BluetoothProperty> properties); |
| 405 OnRemoteDeviceProperties@2(BluetoothStatus status, | 381 OnRemoteDeviceProperties@2(BluetoothStatus status, |
| 406 BluetoothAddress address, | 382 BluetoothAddress address, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 int32 offset, | 424 int32 offset, |
| 449 array<uint8> value) | 425 array<uint8> value) |
| 450 => (BluetoothGattStatus status); | 426 => (BluetoothGattStatus status); |
| 451 | 427 |
| 452 // Bluetooth SDP function | 428 // Bluetooth SDP function |
| 453 [MinVersion=5] OnGetSdpRecords@17(BluetoothStatus status, | 429 [MinVersion=5] OnGetSdpRecords@17(BluetoothStatus status, |
| 454 BluetoothAddress remove_addr, | 430 BluetoothAddress remove_addr, |
| 455 BluetoothUUID target_uuid, | 431 BluetoothUUID target_uuid, |
| 456 array<BluetoothSdpRecord> records); | 432 array<BluetoothSdpRecord> records); |
| 457 }; | 433 }; |
| OLD | NEW |