You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "cordova-plugin-bluetoothle",
3
-
"version": "4.1.0",
3
+
"version": "4.2.0",
4
4
"description": "Use the Bluetooth Low Energy plugin to connect your Cordova app to new Bluetooth devices like heart rate monitors, thermometers, etc...",
* discover - Failed to discover device (Is the device already discovered or discovering?)
@@ -183,6 +188,7 @@ Whenever the error callback is executed, the return object will contain the erro
183
188
* isNotDisconnected - Device is not disconnected (Don't call connect or reconnect while connected)
184
189
* isNotConnected - Device isn't connected (Don't call discover or any read/write operations)
185
190
* isDisconnected - Device is disconnected (Don't call disconnect)
191
+
* isBonded - Operation is unsupported. (Is the device Android?)
186
192
187
193
For example:
188
194
```javascript
@@ -405,6 +411,78 @@ An array of device objects:
405
411
406
412
407
413
414
+
### bond ###
415
+
Bond with a device. The first success callback should always return with ```status == bonding```. If the bond is created, the callback will return again with ```status == bonded```. If the bonding popup is canceled or the wrong code is entered, the callback will return again with ```status == unbonded```. The device doesn't need to be connected to initiate bonding. Android support only.
416
+
417
+
```javascript
418
+
bluetoothle.bond(bondSuccess, bondError, params);
419
+
```
420
+
421
+
##### Params #####
422
+
* address = The address/identifier provided by the scan's return object
423
+
424
+
```javascript
425
+
{
426
+
"address":"5A:94:4B:38:B3:FD"
427
+
}
428
+
```
429
+
430
+
##### Success #####
431
+
* status => bonded = Device is bonded
432
+
* status => bonding = Device is bonding
433
+
* status => unbonded = Device is unbonded
434
+
435
+
```javascript
436
+
{
437
+
"name":"Hello World",
438
+
"address":"5A:94:4B:38:B3:FD",
439
+
"status":"bonded"
440
+
}
441
+
442
+
{
443
+
"name":"Hello World",
444
+
"address":"5A:94:4B:38:B3:FD",
445
+
"status":"bonding"
446
+
}
447
+
448
+
{
449
+
"name":"Hello World",
450
+
"address":"5A:94:4B:38:B3:FD",
451
+
"status":"unbonded"
452
+
}
453
+
```
454
+
455
+
456
+
457
+
### unbond ###
458
+
Unbond with a device. The success callback should always return with ```status == unbonded```. The device doesn't need to be connected to initiate bonding. Android support only.
* address = The address/identifier provided by the scan's return object
466
+
467
+
```javascript
468
+
{
469
+
"address":"5A:94:4B:38:B3:FD"
470
+
}
471
+
```
472
+
473
+
##### Success #####
474
+
* status => unbonded = Device is unbonded
475
+
476
+
```javascript
477
+
{
478
+
"name":"Hello World",
479
+
"address":"5A:94:4B:38:B3:FD",
480
+
"status":"unbonded"
481
+
}
482
+
```
483
+
484
+
485
+
408
486
### connect ###
409
487
Connect to a Bluetooth LE device. The app should use a timer to limit the connecting time in case connecting is never successful. Once a device is connected, it may disconnect without user intervention. The original connection callback will be called again and receive an object with status => disconnected. To reconnect to the device, use the reconnect method. If a timeout occurs, the connection attempt should be canceled using disconnect(). For simplicity, I recommend just using connect() and close(), don't use reconnect() or disconnect().
0 commit comments