XBee API operation library for mbed
Diff: SerialData.cpp
- Revision:
- 2:723cccd7659a
- Parent:
- 0:415f4b1b988e
- Child:
- 4:451ab26ae555
diff -r b999cb9e310e -r 723cccd7659a SerialData.cpp --- a/SerialData.cpp Thu Oct 22 12:39:24 2015 +0000 +++ b/SerialData.cpp Thu Oct 22 20:02:33 2015 +0000 @@ -20,9 +20,7 @@ int SerialData::readByte() { - if (serialPort->readable()) - return serialPort->getc(); - else return -1; + return serialPort->getc(); } void SerialData::writeByte(char data) @@ -30,13 +28,18 @@ serialPort->putc(data); } -bool SerialData::isOpen() +bool SerialData::peek() { if (serialPort->readable()) return true; else return false; } +bool SerialData::isOpen() +{ + return true; +} + void SerialData::open() {}