To troubleshoot the Bluetooth related issues you can use the following instructions.
The Bluetooth plugin supports the following methods:
https://127.0.0.1:8440/api/v1/bluetooth/getdevices
This GET method returns a JSON array of all discovered bluetooth devices or an error code if Bluetooth is turned off.
Sample response:
{"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"}]}
Fields:
name - bluetooth device name
address - bluetooth address of the device
type - device type [possible types: computer, phone, lan_access, audio, peripheral, imaging, unclassified]\
https://127.0.0.1:8440/api/v1/bluetooth/detectdevice
POST method, used to test the device presence by its address
The POST body:
{"address":"[RSA encoded address]"}
RSA encoded address - a bluetooth address encoded with an RSA public key (from certificate) in a hex-string format.
If the device is in range, the sevice returns:{"result":"CONNECTED","address":"40cd0150cf58"}
or if the device is absent or the bluetooth is off on the device:{"result":"DISCONNECTED"}
Other possible result values for this method:
FAILED - general failure
DECRYPT_FAILED - decoding failure
INVALID_ADDRESS - not a valid value for the address
hash - SHA256 hash of the address
If Bluetooth is off, the call returns the error: { "result":"BLUETOOTH_DISABLED"}
https://127.0.0.1:8440/api/v1/bluetooth/getpublickey
This GET method returns the public certificate in a PEM format. Encode the bluetooth address with the public key in that certificate.
{"publicKey":"[PUBLIC_CERT]"}
PUBLIC_CERT - the public certificate in a PEM format.
Currently the following is always same:
"-----BEGIN RSA PUBLIC KEY-----\n"
"MIGHAoGBAKqGJxyB/ZgrTEsfqmMdE4GRwGH+XOioOa0EiQ8+HYcR8Pcg57j1Cc5k\n"
"D1TrGNKpayWUWW7YEsXvfSpc5a5x9qwsEe06Iak5eP/PcGNLUViLwy2CN9oy5mSM\n"
"Izpd607GNBUzEwWg0sIpm3FBEvtFFDxBb7PzE9W4hE//t0LQkGcTAgED\n"
"-----END RSA PUBLIC KEY-----";