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 NULL_PORT "null"
#define UART_PORT "uart" #define UART_PORT "uart"
#define PTY_PORT "pty"
#define UDP_PORT "udp" #define UDP_PORT "udp"
#define UDP_MODE_MASTER "master" #define UDP_MODE_MASTER "master"

@ -36,6 +36,7 @@
#include "p25/P25Utils.h" #include "p25/P25Utils.h"
#include "modem/port/ModemNullPort.h" #include "modem/port/ModemNullPort.h"
#include "modem/port/UARTPort.h" #include "modem/port/UARTPort.h"
#include "modem/port/PseudoPTYPort.h"
#include "modem/port/UDPPort.h" #include "modem/port/UDPPort.h"
#include "network/UDPSocket.h" #include "network/UDPSocket.h"
#include "lookups/RSSIInterpolator.h" #include "lookups/RSSIInterpolator.h"
@ -1586,10 +1587,17 @@ bool Host::createModem()
break; break;
} }
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); modemPort = new port::UARTPort(uartPort, serialSpeed, true);
LogInfo(" UART Port: %s", uartPort.c_str()); LogInfo(" UART Port: %s", uartPort.c_str());
LogInfo(" UART Speed: %u", uartSpeed); LogInfo(" UART Speed: %u", uartSpeed);
} }
}
else { else {
LogError(LOG_HOST, "Invalid protocol port type, %s!", portType.c_str()); LogError(LOG_HOST, "Invalid protocol port type, %s!", portType.c_str());
return false; return false;

Loading…
Cancel
Save

Powered by TurnKey Linux.