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

Side by Side Diff: public/platform/modules/bluetooth/WebBluetooth.h

Issue 1093633003: bluetooh: Define new connectGATT and WebBluetoothGATTRemoteServer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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 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 9
10 namespace blink { 10 namespace blink {
11 11
12 struct WebBluetoothDevice; 12 struct WebBluetoothDevice;
13 struct WebBluetoothError; 13 struct WebBluetoothError;
14 struct WebBluetoothGATTRemoteServer;
14 15
15 // Success and failure callbacks for requestDevice. 16 // Success and failure callbacks for requestDevice.
16 // WebBluetoothDevice and WebBluetoothError object ownership is transfered. 17 // WebBluetoothDevice and WebBluetoothError object ownership is transfered.
17 typedef WebCallbacks<WebBluetoothDevice, WebBluetoothError> WebBluetoothRequestD eviceCallbacks; 18 typedef WebCallbacks<WebBluetoothDevice, WebBluetoothError> WebBluetoothRequestD eviceCallbacks;
18 19
20 // Success and failure callbacks for connectGATT.
21 typedef WebCallbacks<WebBluetoothGATTRemoteServer, WebBluetoothError> WebBluetoo thConnectGATTCallbacks;
22
19 class WebBluetooth { 23 class WebBluetooth {
20 public: 24 public:
21 virtual ~WebBluetooth() { } 25 virtual ~WebBluetooth() { }
22 26
23 // Requests a bluetooth device. 27 // BluetoothDiscovery Methods:
28 // See https://webbluetoothcg.github.io/web-bluetooth/#idl-def-bluetoothdisc overy
24 // WebBluetoothRequestDeviceCallbacks ownership transferred to the client. 29 // WebBluetoothRequestDeviceCallbacks ownership transferred to the client.
Jeffrey Yasskin 2015/04/17 23:45:08 Should we have a comment like this for the ownersh
ortuno 2015/04/20 18:32:44 Done
25 virtual void requestDevice(WebBluetoothRequestDeviceCallbacks*) = 0; 30 virtual void requestDevice(WebBluetoothRequestDeviceCallbacks*) = 0;
31
32 // BluetoothDevice methods:
scheib 2015/04/18 00:06:52 OK, we're going 'monolithic' which we agreed with
ortuno 2015/04/20 18:32:44 Ack.
33 // See https://webbluetoothcg.github.io/web-bluetooth/#idl-def-bluetoothdevi ce
34 virtual void connectGATT(std::string, WebBluetoothConnectGATTCallbacks*) { }
Jeffrey Yasskin 2015/04/17 23:45:08 Great! You're following the advice from https://gi
Jeffrey Yasskin 2015/04/17 23:45:08 Comment what this string means, or give the argume
scheib 2015/04/19 05:40:37 It is instanceID, oops I overlooked this too: Plea
ortuno 2015/04/20 18:32:44 Done.
ortuno 2015/04/20 18:32:44 Done.
35
36 // BluetoothGATTRemoteServer methods:
37 // See https://webbluetoothcg.github.io/web-bluetooth/#idl-def-bluetoothgatt remoteserver
38 virtual void disconnect() { }
39 // TODO(ortuno): Properly define this methods once WebBluetoothServiceUuid a nd
Jeffrey Yasskin 2015/04/17 23:45:08 s/this/these/
scheib 2015/04/18 00:06:52 s/this/these/. If line wrapping, do so before 80 c
ortuno 2015/04/20 18:32:44 Done.
40 // WebBluetoothGATTService are defined.
41 // virtual void getPrimaryService() { }
42 // virtual void getPrimaryServices() { }
26 }; 43 };
27 44
28 } // namespace blink 45 } // namespace blink
29 46
30 #endif // WebBluetooth_h 47 #endif // WebBluetooth_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698