lz1asl / CaveSurvey

Cave surveying application for Android devices
MIT License
44 stars 11 forks source link

Add support for Bosch GLM 120 C #150

Open lz1asl opened 4 years ago

lz1asl commented 4 years ago

New high end device from Bosch with camera heading and Bluetooth LE.

spike77453 commented 3 years ago

Just in case someone wants to implement this:

Handle Value Description
0x001f 0200 Enable indications
0x001e c0550201001a Unsure, but necessary. Otherwise indications don't contain measurement data.
0x001e c05601001e Trigger measurement. Needed twice (similar to pushing red button twice on device). First press arms measurement and turns on laser, second actually triggers measurement.
0x001e c05502f101ee Distance mode (default)
0x001e c05502f108ac Angle mode

Quick example:

$ gatttool -b 00:01:02:03:04:05 -I
[00:01:02:03:04:05][LE]> connect 
Attempting to connect to 00:01:02:03:04:05
Connection successful
[00:01:02:03:04:05][LE]> char-write-req 0x001f 0200
Characteristic value was written successfully
[00:01:02:03:04:05][LE]> char-write-req 0x001e c0550201001a
Characteristic value was written successfully
Indication   handle = 0x001e value: 00 10 02 08 53 05 00 00 00 00 00 00 00 00 00 00 00 00 e8 
[00:01:02:03:04:05][LE]> char-write-req 0x001e c05601001e
Characteristic value was written successfully
Indication   handle = 0x001e value: 00 00 82 
Indication   handle = 0x001e value: c0 55 10 02 09 53 05 00 00 00 00 00 00 00 00 00 00 00 00 c2 
[00:01:02:03:04:05][LE]> char-write-req 0x001e c05601001e
Characteristic value was written successfully
Indication   handle = 0x001e value: 00 00 82 
Indication   handle = 0x001e value: c0 55 10 06 08 54 05 6f 81 04 3f 00 00 00 00 00 00 00 00 ec

Bytes 7-10 represent a IEEE 754 32bit float (little endian), so in the example above 6f 81 04 3f = 0.5176m.

hth

lz1asl commented 3 years ago

Well done!

If you have the device and are willing to test I can send you build?

spike77453 commented 3 years ago

If you have the device and are willing to test I can send you build?

I do have the device but I'm not a user of CaveSurvey and certainly don't know anything about surveying caves. Happy to install an apk file and tell you how the device responds though if that helps.

lz1asl commented 3 years ago

Perfect, let me finish with the BRIC4 integration and will let you know :)