Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / extensions / common / api / bluetooth_private.json
blob4073220f3ab8f2b28b4b66ab5e957135034f8985
2   {
3     "namespace": "bluetoothPrivate",
4     "description": " Use the <code>chrome.bluetoothPrivate</code> API to control the Bluetooth\n adapter state and handle device pairing.",
5     "compiler_options": {
6       "implemented_in": "extensions/browser/api/bluetooth/bluetooth_private_api.h"
7     },
8     "functions": [
9       {
10         "name": "setAdapterState",
11         "type": "function",
12         "description": "Changes the state of the Bluetooth adapter.",
13         "parameters": [
14           {
15             "name": "adapterState",
16             "$ref": "NewAdapterState"
17           },
18           {
19             "name": "callback",
20             "type": "function",
21             "parameters": []
22           }
23         ]
24       },
25       {
26         "name": "setPairingResponse",
27         "type": "function",
28         "parameters": [
29           {
30             "name": "options",
31             "$ref": "SetPairingResponseOptions"
32           },
33           {
34             "name": "callback",
35             "type": "function",
36             "parameters": []
37           }
38         ]
39       },
40       {
41         "name": "disconnectAll",
42         "type": "function",
43         "description": "Tears down all connections to the given device.",
44         "parameters": [
45           {
46             "name": "deviceAddress",
47             "type": "string"
48           },
49           {
50             "name": "callback",
51             "type": "function",
52             "parameters": []
53           }
54         ]
55       },
56       {
57         "name": "setDiscoveryFilter",
58         "type": "function",
59         "description": "Set or clear discovery filter",
60         "parameters": [
61           {
62             "name": "discoveryFilter",
63             "$ref": "DiscoveryFilter"
64           },
65           {
66             "name": "callback",
67             "type": "function",
68             "optional": true,
69             "parameters": []
70           }
71         ]
72       }
73     ],
74     "events": [
75       {
76         "name": "onPairing",
77         "type": "function",
78         "description": "Fired when a pairing event occurs.",
79         "parameters": [
80           {
81             "name": "pairingEvent",
82             "description": "A pairing event.",
83             "$ref": "PairingEvent"
84           }
85         ],
86         "options":
87         {
88           "maxListeners": 1
89         }
90       }
91     ],
92     "types": [
93       {
94         "type": "string",
95         "id": "PairingEventType",
96         "description": "Events that can occur during pairing. The method used for pairing varies depending on the capability of the two devices.",
97         "enum": [
98           {
99             "name": "requestPincode",
100             "description": "An alphanumeric PIN code is required to be entered by the user."
101           },
102           {
103             "name": "displayPincode",
104             "description": "Display a PIN code to the user."
105           },
106           {
107             "name": "requestPasskey",
108             "description": "A numeric passkey is required to be entered by the user."
109           },
110           {
111             "name": "displayPasskey",
112             "description": "Display a zero padded 6 digit numeric passkey that the user entered on the remote device. This event may occur multiple times during pairing to update the entered passkey."
113           },
114           {
115             "name": "keysEntered",
116             "description": "The number of keys inputted by the user on the remote device when entering a passkey. This event may be called multiple times during pairing to update the number of keys inputted."
117           },
118           {
119             "name": "confirmPasskey",
120             "description": "Requests that a 6 digit passkey be displayed and the user confirms that both devies show the same passkey."
121           },
122           {
123             "name": "requestAuthorization",
124             "description": "Requests authorization for a pairing under the just-works model. It is up to the app to ask for user confirmation."
125           },
126           {
127             "name": "complete",
128             "description": "Pairing is completed"
129           }
130         ]
131       },
132       {
133         "type": "string",
134         "id": "PairingResponse",
135         "description": "Valid pairing responses.",
136         "enum": [ "confirm", "reject", "cancel"]
137       },
138       {
139         "type": "object",
140         "id": "PairingEvent",
141         "description": "A pairing event received from a Bluetooth device.",
142         "properties": {
143           "pairing": {
144             "name": "pairing",
145             "$ref": "PairingEventType"
146           },
147           "device": {
148             "name": "device",
149             "$ref": "bluetooth.Device"
150           },
151           "pincode": {
152             "optional": true,
153             "name": "pincode",
154             "type": "string"
155           },
156           "passkey": {
157             "optional": true,
158             "name": "passkey",
159             "type": "integer"
160           },
161           "enteredKey": {
162             "optional": true,
163             "name": "enteredKey",
164             "type": "integer"
165           }
166         }
167       },
168       {
169         "type": "object",
170         "id": "NewAdapterState",
171         "properties": {
172           "name": {
173             "optional": true,
174             "name": "name",
175             "type": "string",
176             "description": "The human-readable name of the adapter."
177           },
178           "powered": {
179             "optional": true,
180             "name": "powered",
181             "type": "boolean",
182             "description": "Whether or not the adapter has power."
183           },
184           "discoverable": {
185             "optional": true,
186             "name": "discoverable",
187             "type": "boolean",
188             "description": "Whether the adapter is discoverable by other devices."
189           }
190         }
191       },
192       {
193         "type": "object",
194         "id": "SetPairingResponseOptions",
195         "properties": {
196           "device": {
197             "name": "device",
198             "$ref": "bluetooth.Device",
199             "description": "The remote device to send the pairing response."
200           },
201           "response": {
202             "optional": true,
203             "name": "response",
204             "$ref": "PairingResponse",
205             "description": "The response type"
206           },
207           "pincode": {
208             "optional": true,
209             "name": "pincode",
210             "type": "string",
211             "description": "A 1-16 character alphanumeric set in response to <code>requestPincode</code>."
212           },
213           "passkey": {
214             "optional": true,
215             "name": "passkey",
216             "type": "integer",
217             "description": "An integer between 0-999999 set in response to <code>requestPasskey</code>."
218           }
219         }
220       },
221       {
222         "id": "TransportType",
223         "type": "string",
224         "enum": [ "le", "bredr", "dual"]
225       },
226       {
227         "type": "object",
228         "id": "DiscoveryFilter",
229         "properties": {
230           "transport": {
231             "$ref": "TransportType",
232             "optional": true,
233             "name": "transport",
234             "description": "Transport type."
235           },
236           "uuids": {
237             "name": "uuids",
238             "optional": true,
239             "choices": [
240               {"type": "string", "name": "uuid of service"},
241               {"type": "array",  "items": {"type": "string"}, "name": "array of uuids"}
242             ]
243           },
244           "rssi": {
245             "optional": true,
246             "name": "rssi",
247             "type": "integer",
248             "description": "RSSI ranging value. Only devices with RSSI higher than this value will be reported."
249           },
250           "pathloss": {
251             "optional": true,
252             "name": "pathloss",
253             "type": "integer",
254             "description": "Pathloss ranging value. Only devices with pathloss lower than this value will be reported."
255           }
256         }
257       }
258     ]
259   }