The following table lists all the methods that the Bluetooth plug-in supports.
Method |
Syntax |
Description |
Response |
---|---|---|---|
getdevices |
https://127.0.0.1:8440/api/v1/bluetooth/getdevices |
This GET method either returns a JSON array of all discovered Bluetooth devices or an error code if Bluetooth is turned off. |
{ "devices": [ { "name":"MagicKeyboard","address":"9cd746e1234","type":"peripheral","hash":"9b67e2d07088a1f0bd64bde8c44ab7cdc279463bd6d93735ab778afda79d0bde" }, { "name":"MagicMouse","address":"1abcd22dafae","type":"peripheral","hash":"dbf75830268ab5516a0d658d28105761b6d6ec062a42317a84b3a82e8e4d643f"}, { "name":"Lex'siPhone","address":"40cd0150cf58","type":"phone","hash":"ac904cc2e2626ca27eb7f4100166e0ae07957da89a5a3aa52f0a5d182b6ba42e" } ] } where:
|
detectdevice |
https://127.0.0.1:8440/api/v1/bluetooth/detectdevice Request Body {"address":"[RSA encoded address]"} where RSA encoded address is address of Bluetooth device encoded with an RSA public key (from certificate) in the hex-string format. |
This POST method is used to test the presence of device with its address |
If the device is in range, the service returns: {"result":"CONNECTED","address":"40cd0150cf58"} if the device is not within the range or the Bluetooth is turned OFF on the device, the service returns: {"result":"DISCONNECTED"} Following are the other possible result values for this method:
|
getpublickey |
https://127.0.0.1:8440/api/v1/bluetooth/getpublickey |
This GET method returns the public certificate in the PEM format. The Bluetooth address is encoded with the public key in that certificate. |
{"publicKey":"[PUBLIC_CERT]"} where:
|