How to parse Bosch GLM laser distance meter messages with WebBluetooth in Chrome?

107 Views Asked by At

I have a Bosch GLM 50 C laser distance meter (or sometimes called laser range finder) and try to receive its values via WebBluetoothAPI in Chrome browser.

I am already able to receive messages (after connecting to the service UUID: 02a6c0d0-0451-4000-b000-fb3210111989 with gattServer.getPrimaryService and characteristic UUID: 02a6c0d1-0451-4000-b000-fb3210111989 with service.getCharacteristic and activating sync-mode with sending new Uint8Array([192, 85, 2, 1, 0, 26]).buffer).

My problem now is, that I don't know how to parse the messages in order to get the measured distance. Here are some examples (on the left side there are the messages a Uint8Arrays, on the right the measured distance showing on the device):

[192, 85, 16, 6, 0, 97, 0, 162, 180, 151, 62, 0, 0, 0, 0, 0, 0, 0, 0, 172] --> 0,296m
[192, 85, 16, 6, 0, 98, 0, 181, 166, 13, 64, 0, 0, 0, 0, 0, 0, 0, 0, 134]  --> 2,213m
[192, 85, 16, 6, 0, 99, 0, 143, 194, 164, 64, 0, 0, 0, 0, 0, 0, 0, 0, 6]   --> 5,149m

Does anyone know how to parse these messages in order to get the correct values?

On the Bosch developer portal I could only find a documentation and samples for android and iOS, which use a library for receiving messages, but I couldn't find anything for WebBluetooth.

I really appreciate the help.

0

There are 0 best solutions below