add support for "pty" port type (reuses uart fields for pty file and speed);

pull/12/head
Bryan Biedenkapp 4 years ago
parent 664e448bbc
commit 4f12bb575a

@ -117,6 +117,7 @@ typedef unsigned long long ulong64_t;
#define NULL_PORT "null"
#define UART_PORT "uart"
#define PTY_PORT "pty"
#define UDP_PORT "udp"
#define UDP_MODE_MASTER "master"

@ -36,6 +36,7 @@
#include "p25/P25Utils.h"
#include "modem/port/ModemNullPort.h"
#include "modem/port/UARTPort.h"
#include "modem/port/PseudoPTYPort.h"
#include "modem/port/UDPPort.h"
#include "network/UDPSocket.h"
#include "lookups/RSSIInterpolator.h"
@ -1586,9 +1587,16 @@ bool Host::createModem()
break;
}
modemPort = new port::UARTPort(uartPort, serialSpeed, true);
LogInfo(" UART Port: %s", uartPort.c_str());
LogInfo(" UART Speed: %u", uartSpeed);
if (portType == PTY_PORT) {
modemPort = new port::PseudoPTYPort(uartPort, serialSpeed, true);
LogInfo(" PTY File: %s", uartPort.c_str());
LogInfo(" PTY Speed: %u", uartSpeed);
}
else {
modemPort = new port::UARTPort(uartPort, serialSpeed, true);
LogInfo(" UART Port: %s", uartPort.c_str());
LogInfo(" UART Speed: %u", uartSpeed);
}
}
else {
LogError(LOG_HOST, "Invalid protocol port type, %s!", portType.c_str());

Loading…
Cancel
Save

Powered by TurnKey Linux.