Merge pull request #710 from nostar/M17_AX25_FM

This commit is contained in:
Jonathan Naylor 2021-08-13 20:18:50 +01:00 committed by GitHub
commit 9cea26ec62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 3 deletions

View file

@ -30,6 +30,9 @@ public:
virtual int write(const unsigned char* buffer, unsigned int length) = 0;
virtual void close() = 0;
#if defined(__APPLE__)
virtual int setNonblock(bool nonblock) = 0;
#endif
private:
};

View file

@ -35,6 +35,10 @@ public:
virtual int write(const unsigned char* buffer, unsigned int length);
virtual void close();
#if defined(__APPLE__)
int setNonblock(bool nonblock) { return 0; }
#endif
private:
CRingBuffer<unsigned char> m_buffer;

View file

@ -32,7 +32,11 @@
#include <fcntl.h>
#include <unistd.h>
#include <termios.h>
#include <pty.h>
#if defined(__APPLE__)
#include <util.h>
#else
#include <pty.h>
#endif
CPseudoTTYController::CPseudoTTYController(const std::string& symlink, unsigned int speed, bool assertRTS) :

View file

@ -328,8 +328,13 @@ bool CUARTController::setRaw()
::cfsetispeed(&termios, B230400);
break;
case 460800U:
::cfsetospeed(&termios, B460800);
::cfsetispeed(&termios, B460800);
#if defined(__APPLE__)
::cfsetospeed(&termios, 460800);
::cfsetispeed(&termios, 460800);
#else
::cfsetospeed(&termios, B460800);
::cfsetispeed(&termios, B460800);
#endif
break;
default:
LogError("Unsupported serial port speed - %u", m_speed);

View file

@ -37,6 +37,10 @@ public:
virtual int write(const unsigned char* buffer, unsigned int length);
virtual void close();
#if defined(__APPLE__)
int setNonblock(bool nonblock) { return 0; }
#endif
protected:
CUDPSocket m_socket;