Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Side by Side Diff: components/arc/common/bluetooth.mojom

Issue 2256003002: components/arc: implement multi advertising (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@plumb-incoming-connections
Patch Set: refactoring interface Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 Android Bluetooth package. See AdvertiseManager$AdvertiseNative
173 // http://goo.gl/UnKC5N
174 enum BluetoothAdvertisementType {
puthik_chromium 2016/08/19 23:43:24 [Extensible]?
Eric Caruso 2016/08/20 00:33:17 Unless we expect to add more advertisement types,
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 12 matching lines...) Expand all
194 BluetoothServiceData service_data; 202 BluetoothServiceData service_data;
195 array<uint8> manufacturer_data; 203 array<uint8> manufacturer_data;
196 array<uint8> other_data; 204 array<uint8> other_data;
197 }; 205 };
198 206
199 struct BluetoothServiceData { 207 struct BluetoothServiceData {
200 uint16 uuid_16bit; 208 uint16 uuid_16bit;
201 array<uint8> data; 209 array<uint8> data;
202 }; 210 };
203 211
212 struct BluetoothAdvertisement {
213 BluetoothAdvertisementType type;
214 bool include_tx_power;
215 array<BluetoothAdvertisingData> data;
216 // Add more here as Chrome supports it.
217 };
218
204 [Extensible] 219 [Extensible]
205 enum BluetoothGattDBAttributeType { 220 enum BluetoothGattDBAttributeType {
206 BTGATT_DB_PRIMARY_SERVICE = 0, 221 BTGATT_DB_PRIMARY_SERVICE = 0,
207 BTGATT_DB_SECONDARY_SERVICE, 222 BTGATT_DB_SECONDARY_SERVICE,
208 BTGATT_DB_INCLUDED_SERVICE, 223 BTGATT_DB_INCLUDED_SERVICE,
209 BTGATT_DB_CHARACTERISTIC, 224 BTGATT_DB_CHARACTERISTIC,
210 BTGATT_DB_DESCRIPTOR, 225 BTGATT_DB_DESCRIPTOR,
211 }; 226 };
212 227
213 struct BluetoothGattDBElement { 228 struct BluetoothGattDBElement {
(...skipping 10 matching lines...) Expand all
224 uint16 start_handle; 239 uint16 start_handle;
225 uint16 end_handle; 240 uint16 end_handle;
226 241
227 /* 242 /*
228 * If |type| is |BTGATT_DB_CHARACTERISTIC|, this contains the properties of 243 * If |type| is |BTGATT_DB_CHARACTERISTIC|, this contains the properties of
229 * the characteristic. 244 * the characteristic.
230 */ 245 */
231 uint8 properties; 246 uint8 properties;
232 }; 247 };
233 248
249 // Next Method ID: 40
234 interface BluetoothHost { 250 interface BluetoothHost {
235 EnableAdapter@0() => (BluetoothAdapterState state); 251 EnableAdapter@0() => (BluetoothAdapterState state);
236 DisableAdapter@1() => (BluetoothAdapterState state); 252 DisableAdapter@1() => (BluetoothAdapterState state);
237 GetAdapterProperty@2(BluetoothPropertyType type); 253 GetAdapterProperty@2(BluetoothPropertyType type);
238 SetAdapterProperty@3(BluetoothProperty property); 254 SetAdapterProperty@3(BluetoothProperty property);
239 GetRemoteDeviceProperty@4(BluetoothAddress remote_addr, 255 GetRemoteDeviceProperty@4(BluetoothAddress remote_addr,
240 BluetoothPropertyType type); 256 BluetoothPropertyType type);
241 SetRemoteDeviceProperty@5(BluetoothAddress remote_addr, 257 SetRemoteDeviceProperty@5(BluetoothAddress remote_addr,
242 BluetoothProperty property); 258 BluetoothProperty property);
243 GetRemoteServiceRecord@6(BluetoothAddress remote_addr, 259 GetRemoteServiceRecord@6(BluetoothAddress remote_addr,
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 => (BluetoothGattStatus status); 331 => (BluetoothGattStatus status);
316 [MinVersion=3] StopService@34(int32 service_handle) 332 [MinVersion=3] StopService@34(int32 service_handle)
317 => (BluetoothGattStatus status); 333 => (BluetoothGattStatus status);
318 [MinVersion=3] DeleteService@35(int32 service_handle) 334 [MinVersion=3] DeleteService@35(int32 service_handle)
319 => (BluetoothGattStatus status); 335 => (BluetoothGattStatus status);
320 [MinVersion=3] SendIndication@36(int32 attribute_handle, 336 [MinVersion=3] SendIndication@36(int32 attribute_handle,
321 BluetoothAddress address, 337 BluetoothAddress address,
322 bool confirm, 338 bool confirm,
323 array<uint8> value) 339 array<uint8> value)
324 => (BluetoothGattStatus status); 340 => (BluetoothGattStatus status);
341
342 // Multi-advertisement functions
343 [MinVersion=5] ReserveAdvertisementHandle@37()
344 => (BluetoothGattStatus status, int32 adv_handle);
345 [MinVersion=5] BroadcastAdvertisement@38(int32 adv_handle,
346 BluetoothAdvertisement adv)
347 => (BluetoothGattStatus status);
348 [MinVersion=5] ReleaseAdvertisementHandle@39(int32 adv_handle)
349 => (BluetoothGattStatus status);
325 }; 350 };
326 351
327 // Next Method ID: 17 352 // Next Method ID: 17
328 interface BluetoothInstance { 353 interface BluetoothInstance {
329 Init@0(BluetoothHost host_ptr); 354 Init@0(BluetoothHost host_ptr);
330 355
331 OnAdapterProperties@1(BluetoothStatus status, 356 OnAdapterProperties@1(BluetoothStatus status,
332 array<BluetoothProperty> properties); 357 array<BluetoothProperty> properties);
333 OnRemoteDeviceProperties@2(BluetoothStatus status, 358 OnRemoteDeviceProperties@2(BluetoothStatus status,
334 BluetoothAddress address, 359 BluetoothAddress address,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 int32 attribute_handle, 395 int32 attribute_handle,
371 int32 offset, 396 int32 offset,
372 bool is_long) 397 bool is_long)
373 => (BluetoothGattStatus status, array<uint8> value); 398 => (BluetoothGattStatus status, array<uint8> value);
374 [MinVersion=3] RequestGattWrite@15(BluetoothAddress address, 399 [MinVersion=3] RequestGattWrite@15(BluetoothAddress address,
375 int32 attribute_handle, 400 int32 attribute_handle,
376 int32 offset, 401 int32 offset,
377 array<uint8> value) 402 array<uint8> value)
378 => (BluetoothGattStatus status); 403 => (BluetoothGattStatus status);
379 }; 404 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698