make serial handling more robust to hw errors
This commit is contained in:
parent
2ec88114c6
commit
229932b274
|
@ -7,6 +7,7 @@
|
|||
#ifdef __cplusplus
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#define BAUDRATE B38400
|
||||
|
@ -32,7 +33,7 @@ class serialIoException: public std::runtime_error
|
|||
int fd;
|
||||
int errorNumber;
|
||||
serialIoException(int fd_, int errorNumber_):
|
||||
std::runtime_error("file descriptor error, fd: " + std::to_string(fd_) + " errno: " + std::to_string(errorNumber_) + "\n"), fd(fd_), errorNumber(errorNumber_)
|
||||
std::runtime_error("file descriptor error, fd: " + std::to_string(fd_) + " error: " + strerror(errorNumber_) + "\n"), fd(fd_), errorNumber(errorNumber_)
|
||||
{}
|
||||
};
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue