tedsalmon / BlueBus

A Bluetooth module for vehicles equipped with I-Bus
Other
169 stars 41 forks source link

Fix volume manipulation on Reverse #89

Closed nabucho closed 2 years ago

nabucho commented 2 years ago

Off by one buffer protection prevented volume changes.

nabucho commented 2 years ago

Based on a log, there was actual value for volume missing in Reverse handling, due to snprintf limiting the size to just 1 \0 termination byte. Also, to be sure we properly handle %X when it outputs 2 digit values, have the buffer 1 byte longer.

[647732] WARNING: PDC START - LOWER VOLUME -- Currently 127 [647737] DEBUG: BT: Send Command 'VOLUME 10 ' [647752] DEBUG: BT: ERROR 0x0013 [648743] WARNING: PDC DONE - RAISE VOLUME -- Currently 63 [648748] DEBUG: BT: Send Command 'VOLUME 10 ' [648763] DEBUG: BT: ERROR 0x0013 [649252] WARNING: SET MAX VOLUME -- Currently 126 [649257] DEBUG: BT: Send Command 'VOLUME 10 F' [649278] DEBUG: BT: OK