ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / extensions / common / api / bluetooth_private.json
blob0890d2520f8e99262cfd3bd9560c91e75474e179
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     "events": [
58       {
59         "name": "onPairing",
60         "type": "function",
61         "description": "Fired when a pairing event occurs.",
62         "parameters": [
63           {
64             "name": "pairingEvent",
65             "description": "A pairing event.",
66             "$ref": "PairingEvent"
67           }
68         ],
69         "options":
70         {
71           "maxListeners": 1
72         }
73       }
74     ],
75     "types": [
76       {
77         "type": "string",
78         "id": "PairingEventType",
79         "description": "Events that can occur during pairing. The method used for pairing varies depending on the capability of the two devices.",
80         "enum": [
81           {
82             "name": "requestPincode",
83             "description": "An alphanumeric PIN code is required to be entered by the user."
84           },
85           {
86             "name": "displayPincode",
87             "description": "Display a PIN code to the user."
88           },
89           {
90             "name": "requestPasskey",
91             "description": "A numeric passkey is required to be entered by the user."
92           },
93           {
94             "name": "displayPasskey",
95             "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."
96           },
97           {
98             "name": "keysEntered",
99             "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."
100           },
101           {
102             "name": "confirmPasskey",
103             "description": "Requests that a 6 digit passkey be displayed and the user confirms that both devies show the same passkey."
104           },
105           {
106             "name": "requestAuthorization",
107             "description": "Requests authorization for a pairing under the just-works model. It is up to the app to ask for user confirmation."
108           },
109           {
110             "name": "complete",
111             "description": "Pairing is completed"
112           }
113         ]
114       },
115       {
116         "type": "string",
117         "id": "PairingResponse",
118         "description": "Valid pairing responses.",
119         "enum": [ "confirm", "reject", "cancel"]
120       },
121       {
122         "type": "object",
123         "id": "PairingEvent",
124         "description": "A pairing event received from a Bluetooth device.",
125         "properties": {
126           "pairing": {
127             "name": "pairing",
128             "$ref": "PairingEventType"
129           },
130           "device": {
131             "name": "device",
132             "$ref": "bluetooth.Device"
133           },
134           "pincode": {
135             "optional": true,
136             "name": "pincode",
137             "type": "string"
138           },
139           "passkey": {
140             "optional": true,
141             "name": "passkey",
142             "type": "integer"
143           },
144           "enteredKey": {
145             "optional": true,
146             "name": "enteredKey",
147             "type": "integer"
148           }
149         }
150       },
151       {
152         "type": "object",
153         "id": "NewAdapterState",
154         "properties": {
155           "name": {
156             "optional": true,
157             "name": "name",
158             "type": "string",
159             "description": "The human-readable name of the adapter."
160           },
161           "powered": {
162             "optional": true,
163             "name": "powered",
164             "type": "boolean",
165             "description": "Whether or not the adapter has power."
166           },
167           "discoverable": {
168             "optional": true,
169             "name": "discoverable",
170             "type": "boolean",
171             "description": "Whether the adapter is discoverable by other devices."
172           }
173         }
174       },
175       {
176         "type": "object",
177         "id": "SetPairingResponseOptions",
178         "properties": {
179           "device": {
180             "name": "device",
181             "$ref": "bluetooth.Device",
182             "description": "The remote device to send the pairing response."
183           },
184           "response": {
185             "optional": true,
186             "name": "response",
187             "$ref": "PairingResponse",
188             "description": "The response type"
189           },
190           "pincode": {
191             "optional": true,
192             "name": "pincode",
193             "type": "string",
194             "description": "A 1-16 character alphanumeric set in response to <code>requestPincode</code>."
195           },
196           "passkey": {
197             "optional": true,
198             "name": "passkey",
199             "type": "integer",
200             "description": "An integer between 0-999999 set in response to <code>requestPasskey</code>."
201           }
202         }
203       }
204     ]
205   }