avinabmalla / ESP32_BleSerial

A BLE Serial library for Arduino ESP32
MIT License
62 stars 17 forks source link

SerialBT.read never return -1 #14

Closed softwarecrash closed 1 month ago

softwarecrash commented 9 months ago

Great work, but i noticed that the function BleSerial::read() never return a -1 when no data avaible. The Arduino Serial reference tells that read() return -1 when no data. can this be fixed?

mspieth commented 1 month ago

The issue is the use of uint8_t for the buffer pop. change in BleSerial.cpp read() result to int and the return type in pop and get in ByteRingBuffer. This fixes it.

avinabmalla commented 1 month ago

Fixed in v1.0.6