Skip to content

Commit d7ea271

Browse files
committed
Try to fix Mac.
1 parent d1873a6 commit d7ea271

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Common/Cpp/SerialConnection/SerialConnectionPOSIX.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ class SerialConnection : public UnreliableStreamConnectionPushing{
7777
}
7878

7979
void set_baud_rate(uint32_t baud_rate){
80+
#ifdef __APPLE__
81+
speed_t baud = baud_rate;
82+
#else
8083
speed_t baud = B9600;
8184
switch (baud_rate){
8285
case 9600: baud = B9600; break;
@@ -100,6 +103,7 @@ class SerialConnection : public UnreliableStreamConnectionPushing{
100103
default:
101104
throw ConnectionException(nullptr, "Unsupported Baud Rate: " + std::to_string(baud_rate));
102105
}
106+
#endif
103107

104108
struct termios options;
105109
if (tcgetattr(m_fd, &options) == -1){

0 commit comments

Comments
 (0)