Skip to content

Commit bd0227a

Browse files
authored
Return -1 if there are no bytes to read
1 parent 3a4ec66 commit bd0227a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/BluetoothSerial/src/BluetoothSerial.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -201,15 +201,15 @@ int BluetoothSerial::read(void)
201201
{
202202
if (available()){
203203
if (!client || SerialQueueBT == NULL){
204-
return 0;
204+
return -1;
205205
}
206206

207207
uint8_t c;
208208
if (xQueueReceive(SerialQueueBT, &c, 0)){
209209
return c;
210210
}
211-
return 0;
212211
}
212+
return -1;
213213
}
214214

215215
size_t BluetoothSerial::write(uint8_t c)

0 commit comments

Comments
 (0)