|
|
|
@ -47,6 +47,7 @@
@@ -47,6 +47,7 @@
|
|
|
|
|
#include <sys/ioctl.h> |
|
|
|
|
#include <assert.h> |
|
|
|
|
#include <unistd.h> |
|
|
|
|
#include <termios.h> |
|
|
|
|
#include <cstdint> |
|
|
|
|
#include <string.h> |
|
|
|
|
|
|
|
|
@ -220,6 +221,8 @@ DevCommon::DevCommon(const char *device_path)
@@ -220,6 +221,8 @@ DevCommon::DevCommon(const char *device_path)
|
|
|
|
|
DevCommon::~DevCommon() |
|
|
|
|
{ |
|
|
|
|
if (_fd >= 0) { |
|
|
|
|
/* discard all pending data, as close() might block otherwise on NuttX with flow control enabled */ |
|
|
|
|
tcflush(_fd, TCIOFLUSH); |
|
|
|
|
::close(_fd); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|