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: 5 | 5 // Next MinVersion: 6 |
| 6 | 6 |
| 7 module arc.mojom; | 7 module arc.mojom; |
| 8 | 8 |
| 9 [Extensible] | 9 [Extensible] |
| 10 enum BluetoothAdapterState { | 10 enum BluetoothAdapterState { |
| 11 OFF = 0, | 11 OFF = 0, |
| 12 ON | 12 ON |
| 13 }; | 13 }; |
| 14 | 14 |
| 15 [Extensible] | 15 [Extensible] |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 uint8 is_primary; | 162 uint8 is_primary; |
| 163 }; | 163 }; |
| 164 | 164 |
| 165 struct BluetoothGattValue { | 165 struct BluetoothGattValue { |
| 166 BluetoothGattStatus status; | 166 BluetoothGattStatus status; |
| 167 array<uint8> value; | 167 array<uint8> value; |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 const int8 kUnknownPower = 127; | 170 const int8 kUnknownPower = 127; |
| 171 | 171 |
| 172 // Copied from Bluetooth package. See AdvertiseManager$AdvertiseNative | |
|
rkc
2016/08/18 00:06:10
Please add a link.
| |
| 173 [Extensible] | |
| 174 enum BluetoothAdvertisementType { | |
| 175 ADV_TYPE_CONNECTABLE = 0, | |
| 176 ADV_TYPE_SCANNABLE = 2, | |
| 177 ADV_TYPE_NON_CONNECTABLE = 3, | |
| 178 }; | |
| 179 | |
| 172 // Copy from Bluetooth Assigned Numbers Document, Generic Access Profile | 180 // Copy from Bluetooth Assigned Numbers Document, Generic Access Profile |
| 173 // https://www.bluetooth.com/specifications/assigned-numbers/generic-access-prof ile | 181 // https://www.bluetooth.com/specifications/assigned-numbers/generic-access-prof ile |
| 174 [Extensible] | 182 [Extensible] |
| 175 enum BluetoothAdvertisingDataType { | 183 enum BluetoothAdvertisingDataType { |
| 176 DATA_TYPE_FLAGS = 0x01, | 184 DATA_TYPE_FLAGS = 0x01, |
| 177 DATA_TYPE_SERVICE_UUIDS_16_BIT_COMPLETE = 0x03, | 185 DATA_TYPE_SERVICE_UUIDS_16_BIT_COMPLETE = 0x03, |
| 178 DATA_TYPE_SERVICE_UUIDS_128_BIT_COMPLETE = 0x07, | 186 DATA_TYPE_SERVICE_UUIDS_128_BIT_COMPLETE = 0x07, |
| 179 DATA_TYPE_LOCAL_NAME_COMPLETE = 0x09, | 187 DATA_TYPE_LOCAL_NAME_COMPLETE = 0x09, |
| 180 DATA_TYPE_TX_POWER_LEVEL = 0x0A, | 188 DATA_TYPE_TX_POWER_LEVEL = 0x0A, |
| 181 DATA_TYPE_SERVICE_DATA = 0x16, | 189 DATA_TYPE_SERVICE_DATA = 0x16, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 224 uint16 start_handle; | 232 uint16 start_handle; |
| 225 uint16 end_handle; | 233 uint16 end_handle; |
| 226 | 234 |
| 227 /* | 235 /* |
| 228 * If |type| is |BTGATT_DB_CHARACTERISTIC|, this contains the properties of | 236 * If |type| is |BTGATT_DB_CHARACTERISTIC|, this contains the properties of |
| 229 * the characteristic. | 237 * the characteristic. |
| 230 */ | 238 */ |
| 231 uint8 properties; | 239 uint8 properties; |
| 232 }; | 240 }; |
| 233 | 241 |
| 242 // Next Method ID: 40 | |
| 234 interface BluetoothHost { | 243 interface BluetoothHost { |
| 235 EnableAdapter@0() => (BluetoothAdapterState state); | 244 EnableAdapter@0() => (BluetoothAdapterState state); |
| 236 DisableAdapter@1() => (BluetoothAdapterState state); | 245 DisableAdapter@1() => (BluetoothAdapterState state); |
| 237 GetAdapterProperty@2(BluetoothPropertyType type); | 246 GetAdapterProperty@2(BluetoothPropertyType type); |
| 238 SetAdapterProperty@3(BluetoothProperty property); | 247 SetAdapterProperty@3(BluetoothProperty property); |
| 239 GetRemoteDeviceProperty@4(BluetoothAddress remote_addr, | 248 GetRemoteDeviceProperty@4(BluetoothAddress remote_addr, |
| 240 BluetoothPropertyType type); | 249 BluetoothPropertyType type); |
| 241 SetRemoteDeviceProperty@5(BluetoothAddress remote_addr, | 250 SetRemoteDeviceProperty@5(BluetoothAddress remote_addr, |
| 242 BluetoothProperty property); | 251 BluetoothProperty property); |
| 243 GetRemoteServiceRecord@6(BluetoothAddress remote_addr, | 252 GetRemoteServiceRecord@6(BluetoothAddress remote_addr, |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 315 => (BluetoothGattStatus status); | 324 => (BluetoothGattStatus status); |
| 316 [MinVersion=3] StopService@34(int32 service_handle) | 325 [MinVersion=3] StopService@34(int32 service_handle) |
| 317 => (BluetoothGattStatus status); | 326 => (BluetoothGattStatus status); |
| 318 [MinVersion=3] DeleteService@35(int32 service_handle) | 327 [MinVersion=3] DeleteService@35(int32 service_handle) |
| 319 => (BluetoothGattStatus status); | 328 => (BluetoothGattStatus status); |
| 320 [MinVersion=3] SendIndication@36(int32 attribute_handle, | 329 [MinVersion=3] SendIndication@36(int32 attribute_handle, |
| 321 BluetoothAddress address, | 330 BluetoothAddress address, |
| 322 bool confirm, | 331 bool confirm, |
| 323 array<uint8> value) | 332 array<uint8> value) |
| 324 => (BluetoothGattStatus status); | 333 => (BluetoothGattStatus status); |
| 334 | |
| 335 // Multi-advertisement functions | |
| 336 [MinVersion=5] EnableAdvertising@37(int32 min_interval, | |
| 337 int32 max_interval, | |
| 338 BluetoothAdvertisementType adv_type, | |
| 339 int32 channel_map, | |
| 340 int32 tx_power, | |
| 341 int32 timeout_s) | |
| 342 => (BluetoothGattStatus status, int32 adv_handle); | |
| 343 [MinVersion=5] SetAdvertisingData@38(int32 adv_handle, | |
| 344 bool include_name, | |
| 345 bool include_tx_power, | |
| 346 int32 appearance, | |
| 347 array<BluetoothAdvertisingData> adv_data) | |
| 348 => (BluetoothGattStatus status); | |
| 349 [MinVersion=5] DisableAdvertising@39(int32 adv_handle) | |
| 350 => (BluetoothGattStatus status); | |
| 325 }; | 351 }; |
| 326 | 352 |
| 327 // Next Method ID: 17 | 353 // Next Method ID: 17 |
| 328 interface BluetoothInstance { | 354 interface BluetoothInstance { |
| 329 Init@0(BluetoothHost host_ptr); | 355 Init@0(BluetoothHost host_ptr); |
| 330 | 356 |
| 331 OnAdapterProperties@1(BluetoothStatus status, | 357 OnAdapterProperties@1(BluetoothStatus status, |
| 332 array<BluetoothProperty> properties); | 358 array<BluetoothProperty> properties); |
| 333 OnRemoteDeviceProperties@2(BluetoothStatus status, | 359 OnRemoteDeviceProperties@2(BluetoothStatus status, |
| 334 BluetoothAddress address, | 360 BluetoothAddress address, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 370 int32 attribute_handle, | 396 int32 attribute_handle, |
| 371 int32 offset, | 397 int32 offset, |
| 372 bool is_long) | 398 bool is_long) |
| 373 => (BluetoothGattStatus status, array<uint8> value); | 399 => (BluetoothGattStatus status, array<uint8> value); |
| 374 [MinVersion=3] RequestGattWrite@15(BluetoothAddress address, | 400 [MinVersion=3] RequestGattWrite@15(BluetoothAddress address, |
| 375 int32 attribute_handle, | 401 int32 attribute_handle, |
| 376 int32 offset, | 402 int32 offset, |
| 377 array<uint8> value) | 403 array<uint8> value) |
| 378 => (BluetoothGattStatus status); | 404 => (BluetoothGattStatus status); |
| 379 }; | 405 }; |
| OLD | NEW |