Merge pull request #120 from eclipse/develop

Add Pre-defined-topic
This commit is contained in:
Tomoaki Yamaguchi
2018-07-17 07:00:50 +09:00
committed by GitHub
38 changed files with 1095 additions and 751 deletions

View File

@@ -403,7 +403,7 @@ void XBee::setApiMode(uint8_t mode)
SerialPort::SerialPort()
{
_tio.c_iflag = IGNBRK | IGNPAR;
_tio.c_cflag = CS8 | CLOCAL | CRTSCTS;
_tio.c_cflag = CS8 | CLOCAL | CRTSCTS | CREAD;
_tio.c_cc[VINTR] = 0;
_tio.c_cc[VTIME] = 10; // 1 sec.
_tio.c_cc[VMIN] = 1;
@@ -464,7 +464,7 @@ bool SerialPort::recv(unsigned char* buf)
FD_SET(_fd, &rfds);
timeout.tv_sec = 0;
timeout.tv_usec = 500000; // 500ms
if ( select(1, &rfds, 0, 0, &timeout) > 0 )
if ( select(_fd + 1, &rfds, 0, 0, &timeout) > 0 )
{
if (read(_fd, buf, 1) > 0)
{