JorgePe / BOOSTreveng

Reverse engineering the LEGO BOOST Hub
MIT License
168 stars 35 forks source link

First byte in commands #5

Closed rblaakmeer closed 7 years ago

rblaakmeer commented 7 years ago

To further help (a little) in reverse engineering the protocol: Looking at all the example commands, the first byte must be the total number of bytes in the command:

JorgePe commented 7 years ago

Nice finding! Thanks!

JorgePe commented 7 years ago

The responses from BOOST Move Hub also start with the length of the message - activating notifications and sending command to read color from Color Sensor, the Move Hub starts a new message each time the color changes:

gatttool -b 00:16:53:A4:CD:7E --char-write-req --handle=0x0f --value=0100
gatttool -b 00:16:53:A4:CD:7E --char-write-req --handle=0x0e --value=0a004101080100000001 --listen
Notification handle = 0x000e value: 08 00 45 01 ff 09 ff 01 
Notification handle = 0x000e value: 08 00 45 01 ff 08 ff 01 
Notification handle = 0x000e value: 08 00 45 01 ff 09 ff 01 
Notification handle = 0x000e value: 08 00 45 01 ff 08 ff 01 
Notification handle = 0x000e value: 08 00 45 01 ff 09 ff 01 
Notification handle = 0x000e value: 08 00 45 01 ff 08 ff 01
...

I'm updating my files with this information. I'm also giving credit to your github account name. If you like any other way please say so.

Thanks again!