OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef WebBluetooth_h | 5 #ifndef WebBluetooth_h |
6 #define WebBluetooth_h | 6 #define WebBluetooth_h |
7 | 7 |
8 #include "public/platform/WebCallbacks.h" | 8 #include "public/platform/WebCallbacks.h" |
9 #include "public/platform/WebString.h" | 9 #include "public/platform/WebString.h" |
10 #include "public/platform/WebVector.h" | 10 #include "public/platform/WebVector.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 // Bluetooth Methods: | 64 // Bluetooth Methods: |
65 // See https://webbluetoothchrome.github.io/web-bluetooth/#device-discovery | 65 // See https://webbluetoothchrome.github.io/web-bluetooth/#device-discovery |
66 // WebBluetoothRequestDeviceCallbacks ownership transferred to the client. | 66 // WebBluetoothRequestDeviceCallbacks ownership transferred to the client. |
67 virtual void requestDevice(const WebRequestDeviceOptions&, | 67 virtual void requestDevice(const WebRequestDeviceOptions&, |
68 WebBluetoothRequestDeviceCallbacks*) {} | 68 WebBluetoothRequestDeviceCallbacks*) {} |
69 | 69 |
70 // BluetoothDevice methods: | 70 // BluetoothDevice methods: |
71 | 71 |
72 // BluetoothRemoteGATTServer methods: | 72 // BluetoothRemoteGATTServer methods: |
73 // See https://webbluetoothchrome.github.io/web-bluetooth/#idl-def-bluetoothga
ttremoteserver | 73 // See |
| 74 // https://webbluetoothchrome.github.io/web-bluetooth/#idl-def-bluetoothgattre
moteserver |
74 virtual void connect(const WebString& deviceId, | 75 virtual void connect(const WebString& deviceId, |
75 WebBluetoothDevice* device, | 76 WebBluetoothDevice* device, |
76 WebBluetoothRemoteGATTServerConnectCallbacks*) {} | 77 WebBluetoothRemoteGATTServerConnectCallbacks*) {} |
77 virtual void disconnect(const WebString& deviceId) = 0; | 78 virtual void disconnect(const WebString& deviceId) = 0; |
78 virtual void getPrimaryServices( | 79 virtual void getPrimaryServices( |
79 const WebString& deviceId, | 80 const WebString& deviceId, |
80 int32_t | 81 // Corresponds to WebBluetoothGATTQueryQuantity in web_bluetooth.mojom: |
81 quantity /* Corresponds to WebBluetoothGATTQueryQuantity in web_blueto
oth.mojom */ | 82 int32_t quantity, |
82 , | |
83 const WebString& servicesUUID, | 83 const WebString& servicesUUID, |
84 WebBluetoothGetPrimaryServicesCallbacks*) = 0; | 84 WebBluetoothGetPrimaryServicesCallbacks*) = 0; |
85 | 85 |
86 // BluetoothRemoteGATTService methods: | 86 // BluetoothRemoteGATTService methods: |
87 // See https://webbluetoothchrome.github.io/web-bluetooth/#idl-def-bluetoothga
ttservice | 87 // See |
| 88 // https://webbluetoothchrome.github.io/web-bluetooth/#idl-def-bluetoothgattse
rvice |
88 virtual void getCharacteristics( | 89 virtual void getCharacteristics( |
89 const WebString& serviceInstanceID, | 90 const WebString& serviceInstanceID, |
90 int32_t | 91 // Corresponds to WebBluetoothGATTQueryQuantity in web_bluetooth.mojom |
91 quantity /* Corresponds to WebBluetoothGATTQueryQuantity in web_blueto
oth.mojom */ | 92 int32_t quantity, |
92 , | |
93 const WebString& characteristicsUUID, | 93 const WebString& characteristicsUUID, |
94 WebBluetoothGetCharacteristicsCallbacks*) = 0; | 94 WebBluetoothGetCharacteristicsCallbacks*) = 0; |
95 | 95 |
96 // BluetoothRemoteGATTCharacteristic methods: | 96 // BluetoothRemoteGATTCharacteristic methods: |
97 // See https://webbluetoothchrome.github.io/web-bluetooth/#bluetoothgattcharac
teristic | 97 // See |
| 98 // https://webbluetoothchrome.github.io/web-bluetooth/#bluetoothgattcharacteri
stic |
98 virtual void readValue(const WebString& characteristicInstanceID, | 99 virtual void readValue(const WebString& characteristicInstanceID, |
99 WebBluetoothReadValueCallbacks*) {} | 100 WebBluetoothReadValueCallbacks*) {} |
100 virtual void writeValue(const WebString& characteristicInstanceID, | 101 virtual void writeValue(const WebString& characteristicInstanceID, |
101 const WebVector<uint8_t>& value, | 102 const WebVector<uint8_t>& value, |
102 WebBluetoothWriteValueCallbacks*) {} | 103 WebBluetoothWriteValueCallbacks*) {} |
103 virtual void startNotifications(const WebString& characteristicInstanceID, | 104 virtual void startNotifications(const WebString& characteristicInstanceID, |
104 WebBluetoothNotificationsCallbacks*) {} | 105 WebBluetoothNotificationsCallbacks*) {} |
105 virtual void stopNotifications(const WebString& characteristicInstanceID, | 106 virtual void stopNotifications(const WebString& characteristicInstanceID, |
106 WebBluetoothNotificationsCallbacks*) {} | 107 WebBluetoothNotificationsCallbacks*) {} |
107 | 108 |
108 // Called when addEventListener is called on a characteristic. | 109 // Called when addEventListener is called on a characteristic. |
109 virtual void registerCharacteristicObject( | 110 virtual void registerCharacteristicObject( |
110 const WebString& characteristicInstanceID, | 111 const WebString& characteristicInstanceID, |
111 WebBluetoothRemoteGATTCharacteristic*) = 0; | 112 WebBluetoothRemoteGATTCharacteristic*) = 0; |
112 virtual void characteristicObjectRemoved( | 113 virtual void characteristicObjectRemoved( |
113 const WebString& characteristicInstanceID, | 114 const WebString& characteristicInstanceID, |
114 WebBluetoothRemoteGATTCharacteristic*) {} | 115 WebBluetoothRemoteGATTCharacteristic*) {} |
115 }; | 116 }; |
116 | 117 |
117 } // namespace blink | 118 } // namespace blink |
118 | 119 |
119 #endif // WebBluetooth_h | 120 #endif // WebBluetooth_h |
OLD | NEW |