Skip to content

Commit 6c9e6aa

Browse files
committed
Fix BLE printing of zero length strings
1 parent 2dff76e commit 6c9e6aa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Firmware/RTK_Surveyor/Bluetooth.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ bool bluetoothRxDataAvailable()
109109
int bluetoothWrite(const uint8_t *buffer, int length)
110110
{
111111
#ifdef COMPILE_BT
112-
return bluetoothSerial->write(buffer, length);
112+
//BLE write does not handle 0 length requests correctly
113+
if(length > 0)
114+
return bluetoothSerial->write(buffer, length);
115+
else
116+
return 0;
113117
#else //COMPILE_BT
114118
return 0;
115119
#endif //COMPILE_BT

0 commit comments

Comments
 (0)