/
BluetoothDevice.cljs
319 lines (216 loc) · 9.15 KB
/
BluetoothDevice.cljs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
(ns web.bluetooth.BluetoothDevice
"The BluetoothDevice interface of the Web Bluetooth API represents
Bluetooth device inside a particular script execution environment."
(:refer-clojure :exclude [name]))
(defn watch-advertisments
"Method.
A Promise that resolves to undefined or is rejected with an error
advetisments can’t shown for any reason."
[this & args]
(apply (-> this .-watchAdvertisments) (concat [this] args)))
(defn connect-gatt
"Method.
The BluetoothDevice.connectGATT() method returns a `js.Promise`
resolves to an instance of `BluetoothGATTRemoteServer`.
`instanceOfBluetoothDevice.connectGATT().then(function(BluetoothGATTRemoteServer) { ... })`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/connectGATT`"
[this & args]
(apply (-> this .-connectGATT) (concat [this] args)))
(defn id
"Property.
The BluetoothDevice.id read-only property returns a `web.dom.DOMString`
uniquely identifies a device.
`var id = instanceOfBluetoothDevice.id`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/id`"
[this]
(-> this (.id)))
(defn set-id!
"Property.
The BluetoothDevice.id read-only property returns a `web.dom.DOMString`
uniquely identifies a device.
`var id = instanceOfBluetoothDevice.id`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/id`"
[this val]
(aset this "id" val))
(defn ad-data
"Property.
The BluetoothDevice.adData read-only property returns instance
`web.bluetooth.BluetoothAdvertisingData` containing the most
advertising data received for the device.
`var instanceOfBluetoothAdData = instanceOfBluetoothDevice.adData`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/adData`"
[this]
(-> this (.adData)))
(defn set-ad-data!
"Property.
The BluetoothDevice.adData read-only property returns instance
`web.bluetooth.BluetoothAdvertisingData` containing the most
advertising data received for the device.
`var instanceOfBluetoothAdData = instanceOfBluetoothDevice.adData`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/adData`"
[this val]
(aset this "adData" val))
(defn device-class
"Property.
The BluetoothDevice.deviceClass read-only property returns a
representing the Bluetooth devices \\\"Class of Device\\\".
`var deviceClass = instanceOfBluetoothDevice.deviceClass`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/deviceClass`"
[this]
(-> this (.deviceClass)))
(defn set-device-class!
"Property.
The BluetoothDevice.deviceClass read-only property returns a
representing the Bluetooth devices \\\"Class of Device\\\".
`var deviceClass = instanceOfBluetoothDevice.deviceClass`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/deviceClass`"
[this val]
(aset this "deviceClass" val))
(defn gatt
"Property.
The BluetoothDevice.gatt read-only property returns a reference
the device's `web.bluetooth.BluetoothRemoteGATTServer`.
`var gattServer = instanceOfBluetoothDevice.gatt`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/gatt`"
[this]
(-> this (.gatt)))
(defn set-gatt!
"Property.
The BluetoothDevice.gatt read-only property returns a reference
the device's `web.bluetooth.BluetoothRemoteGATTServer`.
`var gattServer = instanceOfBluetoothDevice.gatt`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/gatt`"
[this val]
(aset this "gatt" val))
(defn gatt-server
"Property.
The BluetoothDevice.gattServer read-only property returns a reference
the device's GATT server or null if the device is disconnected.
`var gattServer = instanceOfBluetoothDevice.gattServer`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/gattServer`"
[this]
(-> this (.gattServer)))
(defn set-gatt-server!
"Property.
The BluetoothDevice.gattServer read-only property returns a reference
the device's GATT server or null if the device is disconnected.
`var gattServer = instanceOfBluetoothDevice.gattServer`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/gattServer`"
[this val]
(aset this "gattServer" val))
(defn name
"Property.
The BluetoothDevice.name read-only property returns a `web.dom.DOMString`
provides a human-readable name for the device.
`var name = instanceOfBluetoothDevice.name`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/name`"
[this]
(-> this (.name)))
(defn set-name!
"Property.
The BluetoothDevice.name read-only property returns a `web.dom.DOMString`
provides a human-readable name for the device.
`var name = instanceOfBluetoothDevice.name`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/name`"
[this val]
(aset this "name" val))
(defn paired
"Property.
The BluetoothDevice.paired read-only property returns a `js.Boolean`
indicating whether the device is paired with the system.
`var paired = instanceOfBluetoothDevice.paired`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/paired`"
[this]
(-> this (.paired)))
(defn set-paired!
"Property.
The BluetoothDevice.paired read-only property returns a `js.Boolean`
indicating whether the device is paired with the system.
`var paired = instanceOfBluetoothDevice.paired`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/paired`"
[this val]
(aset this "paired" val))
(defn product-id
"Property.
The BluetoothDevice.productID read-only property returns the
Product ID field in the pnp_id characteristic in the device_information
`var productID = instanceOfBluetoothDevice.productID`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/productID`"
[this]
(-> this (.productID)))
(defn set-product-id!
"Property.
The BluetoothDevice.productID read-only property returns the
Product ID field in the pnp_id characteristic in the device_information
`var productID = instanceOfBluetoothDevice.productID`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/productID`"
[this val]
(aset this "productID" val))
(defn product-version
"Property.
The BluetoothDevice.productVersion read-only property returns
16-bit Product Version field in the pnp_id characteristic in
device_information service.
`var productVersion = instanceOfBluetoothDevice.productVersion`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/productVersion`"
[this]
(-> this (.productVersion)))
(defn set-product-version!
"Property.
The BluetoothDevice.productVersion read-only property returns
16-bit Product Version field in the pnp_id characteristic in
device_information service.
`var productVersion = instanceOfBluetoothDevice.productVersion`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/productVersion`"
[this val]
(aset this "productVersion" val))
(defn uuids
"Property.
The BluetoothDevice.uuids read-only property lists the UUIDs
GATT services provided by the device, that the current origin
allowed to access.
`var uuids[] = instanceOfBluetoothDevice.uuids`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/uuids`"
[this]
(-> this (.uuids)))
(defn set-uuids!
"Property.
The BluetoothDevice.uuids read-only property lists the UUIDs
GATT services provided by the device, that the current origin
allowed to access.
`var uuids[] = instanceOfBluetoothDevice.uuids`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/uuids`"
[this val]
(aset this "uuids" val))
(defn vendor-id
"Property.
The BluetoothDevice.vendorID read-only property returns the 16-bit
ID field in the pnp_id characteristic in the device_information
`var vendorID = instanceOfBluetoothDevice.vendorID`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/vendorID`"
[this]
(-> this (.vendorID)))
(defn set-vendor-id!
"Property.
The BluetoothDevice.vendorID read-only property returns the 16-bit
ID field in the pnp_id characteristic in the device_information
`var vendorID = instanceOfBluetoothDevice.vendorID`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/vendorID`"
[this val]
(aset this "vendorID" val))
(defn vendor-id-source
"Property.
The BluetoothDevice.vendorIDSource read-only property returns
Vendor ID Source field in the pnp_id characteristic in the device_information
`var vendorIDSource = instanceOfBluetoothDevice.vendorIDSource`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/vendorIDSource`"
[this]
(-> this (.vendorIDSource)))
(defn set-vendor-id-source!
"Property.
The BluetoothDevice.vendorIDSource read-only property returns
Vendor ID Source field in the pnp_id characteristic in the device_information
`var vendorIDSource = instanceOfBluetoothDevice.vendorIDSource`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/vendorIDSource`"
[this val]
(aset this "vendorIDSource" val))