From ff9712b36a1e5f0bb6f9a07728f763c24ec4814d Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Tue, 16 Feb 2021 20:05:03 +0000 Subject: [PATCH] Refactored some class names. --- AX25Network.h | 6 +- Display.cpp | 8 +- MMDVMHost.cpp | 6 +- MMDVMHost.vcxproj | 8 +- MMDVMHost.vcxproj.filters | 24 +-- SerialModem.cpp => MMDVMModem.cpp | 176 ++++++++++----------- SerialModem.h => MMDVMModem.h | 12 +- Makefile | 10 +- Makefile.Pi | 10 +- Makefile.Pi.Adafruit | 10 +- Makefile.Pi.HD44780 | 10 +- Makefile.Pi.OLED | 10 +- Makefile.Pi.PCF8574 | 10 +- PseudoTTYController.cpp | 8 +- PseudoTTYController.h | 6 +- SerialController.cpp => UARTController.cpp | 40 ++--- SerialController.h => UARTController.h | 14 +- Version.h | 2 +- 18 files changed, 184 insertions(+), 186 deletions(-) rename SerialModem.cpp => MMDVMModem.cpp (91%) rename SerialModem.h => MMDVMModem.h (97%) rename SerialController.cpp => UARTController.cpp (89%) rename SerialController.h => UARTController.h (80%) diff --git a/AX25Network.h b/AX25Network.h index f46de155b..c972ccb41 100644 --- a/AX25Network.h +++ b/AX25Network.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 by Jonathan Naylor G4KLX + * Copyright (C) 2020,2021 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ #define AX25Network_H #if defined(_WIN32) || defined(_WIN64) -#include "SerialController.h" +#include "UARTController.h" #else #include "PseudoTTYController.h" #endif @@ -47,7 +47,7 @@ class CAX25Network { private: #if defined(_WIN32) || defined(_WIN64) - CSerialController m_serial; + CUARTController m_serial; #else CPseudoTTYController m_serial; #endif diff --git a/Display.cpp b/Display.cpp index 7d4b1a960..5170ea042 100644 --- a/Display.cpp +++ b/Display.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016,2017,2018,2020 by Jonathan Naylor G4KLX + * Copyright (C) 2016,2017,2018,2020,2021 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ #include "Display.h" #include "Defines.h" -#include "SerialController.h" +#include "UARTController.h" #include "ModemSerialPort.h" #include "NullDisplay.h" #include "TFTSurenoo.h" @@ -556,7 +556,7 @@ CDisplay* CDisplay::createDisplay(const CConf& conf, IModem* modem) if (port == "modem") serial = new IModemSerialPort(modem); else - serial = new CSerialController(port, 115200U); + serial = new CUARTController(port, 115200U); display = new CTFTSurenoo(conf.getCallsign(), dmrid, serial, brightness, conf.getDuplex()); } else if (type == "Nextion") { @@ -605,7 +605,7 @@ CDisplay* CDisplay::createDisplay(const CConf& conf, IModem* modem) baudrate = 115200U; LogInfo(" Display baudrate: %u ", baudrate); - ISerialPort* serial = new CSerialController(port, baudrate); + ISerialPort* serial = new CUARTController(port, baudrate); display = new CNextion(conf.getCallsign(), dmrid, serial, brightness, displayClock, utc, idleBrightness, screenLayout, txFrequency, rxFrequency, displayTempInF); } } else if (type == "LCDproc") { diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index d289353be..7929f2dfe 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -22,8 +22,8 @@ #include "NXDNKenwoodNetwork.h" #include "NXDNIcomNetwork.h" #include "RSSIInterpolator.h" -#include "SerialController.h" -#include "SerialModem.h" +#include "UARTController.h" +#include "MMDVMModem.h" #include "NullModem.h" #include "Version.h" #include "StopWatch.h" @@ -1393,7 +1393,7 @@ bool CMMDVMHost::createModem() if (port == "NullModem") m_modem = new CNullModem; else - m_modem = new CSerialModem(port, m_duplex, rxInvert, txInvert, pttInvert, txDelay, dmrDelay, useCOSAsLockout, trace, debug); + m_modem = new CMMDVMModem(port, m_duplex, rxInvert, txInvert, pttInvert, txDelay, dmrDelay, useCOSAsLockout, trace, debug); m_modem->setSerialParams(protocol, address, speed); m_modem->setModeParams(m_dstarEnabled, m_dmrEnabled, m_ysfEnabled, m_p25Enabled, m_nxdnEnabled, m_m17Enabled, m_pocsagEnabled, m_fmEnabled, m_ax25Enabled); m_modem->setLevels(rxLevel, cwIdTXLevel, dstarTXLevel, dmrTXLevel, ysfTXLevel, p25TXLevel, nxdnTXLevel, m17TXLevel, pocsagTXLevel, fmTXLevel, ax25TXLevel); diff --git a/MMDVMHost.vcxproj b/MMDVMHost.vcxproj index 95d241f1b..10ce89c15 100644 --- a/MMDVMHost.vcxproj +++ b/MMDVMHost.vcxproj @@ -243,8 +243,8 @@ - - + + @@ -347,8 +347,8 @@ - - + + diff --git a/MMDVMHost.vcxproj.filters b/MMDVMHost.vcxproj.filters index d110fc5e0..52c2b9fa6 100644 --- a/MMDVMHost.vcxproj.filters +++ b/MMDVMHost.vcxproj.filters @@ -74,9 +74,6 @@ Header Files - - Header Files - Header Files @@ -332,9 +329,6 @@ Header Files - - Header Files - Header Files @@ -344,6 +338,12 @@ Header Files + + Header Files + + + Header Files + @@ -397,9 +397,6 @@ Source Files - - Source Files - Source Files @@ -634,9 +631,6 @@ Source Files - - Source Files - Source Files @@ -646,5 +640,11 @@ Source Files + + Source Files + + + Source Files + \ No newline at end of file diff --git a/SerialModem.cpp b/MMDVMModem.cpp similarity index 91% rename from SerialModem.cpp rename to MMDVMModem.cpp index 721c736cc..e2fd3b928 100644 --- a/SerialModem.cpp +++ b/MMDVMModem.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2018,2020 by Jonathan Naylor G4KLX + * Copyright (C) 2011-2018,2020,2021 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "SerialController.h" +#include "UARTController.h" #if defined(__linux__) #include "I2CController.h" #endif @@ -29,7 +29,7 @@ #include "POCSAGDefines.h" #include "M17Defines.h" #include "Thread.h" -#include "SerialModem.h" +#include "MMDVMModem.h" #include "NullModem.h" #include "Utils.h" #include "Log.h" @@ -114,7 +114,7 @@ const unsigned int MAX_RESPONSES = 30U; const unsigned int BUFFER_LENGTH = 2000U; -CSerialModem::CSerialModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, bool useCOSAsLockout, bool trace, bool debug) : +CMMDVMModem::CMMDVMModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, bool useCOSAsLockout, bool trace, bool debug) : m_port(port), m_protocolVersion(0U), m_dmrColorCode(0U), @@ -251,13 +251,13 @@ m_fmExtEnable(false) assert(!port.empty()); } -CSerialModem::~CSerialModem() +CMMDVMModem::~CMMDVMModem() { delete m_serial; delete[] m_buffer; } -void CSerialModem::setSerialParams(const std::string& protocol, unsigned int address, unsigned int speed) +void CMMDVMModem::setSerialParams(const std::string& protocol, unsigned int address, unsigned int speed) { // Create the serial controller instance according the protocol specified in conf. #if defined(__linux__) @@ -265,10 +265,10 @@ void CSerialModem::setSerialParams(const std::string& protocol, unsigned int add m_serial = new CI2CController(m_port, address); else #endif - m_serial = new CSerialController(m_port, speed, true); + m_serial = new CUARTController(m_port, speed, true); } -void CSerialModem::setRFParams(unsigned int rxFrequency, int rxOffset, unsigned int txFrequency, int txOffset, int txDCOffset, int rxDCOffset, float rfLevel, unsigned int pocsagFrequency) +void CMMDVMModem::setRFParams(unsigned int rxFrequency, int rxOffset, unsigned int txFrequency, int txOffset, int txDCOffset, int rxDCOffset, float rfLevel, unsigned int pocsagFrequency) { m_rxFrequency = rxFrequency + rxOffset; m_txFrequency = txFrequency + txOffset; @@ -278,7 +278,7 @@ void CSerialModem::setRFParams(unsigned int rxFrequency, int rxOffset, unsigned m_pocsagFrequency = pocsagFrequency + txOffset; } -void CSerialModem::setModeParams(bool dstarEnabled, bool dmrEnabled, bool ysfEnabled, bool p25Enabled, bool nxdnEnabled, bool m17Enabled, bool pocsagEnabled, bool fmEnabled, bool ax25Enabled) +void CMMDVMModem::setModeParams(bool dstarEnabled, bool dmrEnabled, bool ysfEnabled, bool p25Enabled, bool nxdnEnabled, bool m17Enabled, bool pocsagEnabled, bool fmEnabled, bool ax25Enabled) { m_dstarEnabled = dstarEnabled; m_dmrEnabled = dmrEnabled; @@ -291,7 +291,7 @@ void CSerialModem::setModeParams(bool dstarEnabled, bool dmrEnabled, bool ysfEna m_ax25Enabled = ax25Enabled; } -void CSerialModem::setLevels(float rxLevel, float cwIdTXLevel, float dstarTXLevel, float dmrTXLevel, float ysfTXLevel, float p25TXLevel, float nxdnTXLevel, float m17TXLevel, float pocsagTXLevel, float fmTXLevel, float ax25TXLevel) +void CMMDVMModem::setLevels(float rxLevel, float cwIdTXLevel, float dstarTXLevel, float dmrTXLevel, float ysfTXLevel, float p25TXLevel, float nxdnTXLevel, float m17TXLevel, float pocsagTXLevel, float fmTXLevel, float ax25TXLevel) { m_rxLevel = rxLevel; m_cwIdTXLevel = cwIdTXLevel; @@ -306,35 +306,35 @@ void CSerialModem::setLevels(float rxLevel, float cwIdTXLevel, float dstarTXLeve m_ax25TXLevel = ax25TXLevel; } -void CSerialModem::setDMRParams(unsigned int colorCode) +void CMMDVMModem::setDMRParams(unsigned int colorCode) { assert(colorCode < 16U); m_dmrColorCode = colorCode; } -void CSerialModem::setYSFParams(bool loDev, unsigned int txHang) +void CMMDVMModem::setYSFParams(bool loDev, unsigned int txHang) { m_ysfLoDev = loDev; m_ysfTXHang = txHang; } -void CSerialModem::setP25Params(unsigned int txHang) +void CMMDVMModem::setP25Params(unsigned int txHang) { m_p25TXHang = txHang; } -void CSerialModem::setNXDNParams(unsigned int txHang) +void CMMDVMModem::setNXDNParams(unsigned int txHang) { m_nxdnTXHang = txHang; } -void CSerialModem::setM17Params(unsigned int txHang) +void CMMDVMModem::setM17Params(unsigned int txHang) { m_m17TXHang = txHang; } -void CSerialModem::setAX25Params(int rxTwist, unsigned int txDelay, unsigned int slotTime, unsigned int pPersist) +void CMMDVMModem::setAX25Params(int rxTwist, unsigned int txDelay, unsigned int slotTime, unsigned int pPersist) { m_ax25RXTwist = rxTwist; m_ax25TXDelay = txDelay; @@ -342,12 +342,12 @@ void CSerialModem::setAX25Params(int rxTwist, unsigned int txDelay, unsigned int m_ax25PPersist = pPersist; } -void CSerialModem::setTransparentDataParams(unsigned int sendFrameType) +void CMMDVMModem::setTransparentDataParams(unsigned int sendFrameType) { m_sendTransparentDataFrameType = sendFrameType; } -bool CSerialModem::open() +bool CMMDVMModem::open() { ::LogMessage("Opening the MMDVM"); @@ -427,7 +427,7 @@ bool CSerialModem::open() return true; } -void CSerialModem::clock(unsigned int ms) +void CMMDVMModem::clock(unsigned int ms) { assert(m_serial != NULL); @@ -1124,7 +1124,7 @@ void CSerialModem::clock(unsigned int ms) } } -void CSerialModem::close() +void CMMDVMModem::close() { assert(m_serial != NULL); @@ -1133,7 +1133,7 @@ void CSerialModem::close() m_serial->close(); } -unsigned int CSerialModem::readDStarData(unsigned char* data) +unsigned int CMMDVMModem::readDStarData(unsigned char* data) { assert(data != NULL); @@ -1147,7 +1147,7 @@ unsigned int CSerialModem::readDStarData(unsigned char* data) return len; } -unsigned int CSerialModem::readDMRData1(unsigned char* data) +unsigned int CMMDVMModem::readDMRData1(unsigned char* data) { assert(data != NULL); @@ -1161,7 +1161,7 @@ unsigned int CSerialModem::readDMRData1(unsigned char* data) return len; } -unsigned int CSerialModem::readDMRData2(unsigned char* data) +unsigned int CMMDVMModem::readDMRData2(unsigned char* data) { assert(data != NULL); @@ -1175,7 +1175,7 @@ unsigned int CSerialModem::readDMRData2(unsigned char* data) return len; } -unsigned int CSerialModem::readYSFData(unsigned char* data) +unsigned int CMMDVMModem::readYSFData(unsigned char* data) { assert(data != NULL); @@ -1189,7 +1189,7 @@ unsigned int CSerialModem::readYSFData(unsigned char* data) return len; } -unsigned int CSerialModem::readP25Data(unsigned char* data) +unsigned int CMMDVMModem::readP25Data(unsigned char* data) { assert(data != NULL); @@ -1203,7 +1203,7 @@ unsigned int CSerialModem::readP25Data(unsigned char* data) return len; } -unsigned int CSerialModem::readNXDNData(unsigned char* data) +unsigned int CMMDVMModem::readNXDNData(unsigned char* data) { assert(data != NULL); @@ -1217,7 +1217,7 @@ unsigned int CSerialModem::readNXDNData(unsigned char* data) return len; } -unsigned int CSerialModem::readM17Data(unsigned char* data) +unsigned int CMMDVMModem::readM17Data(unsigned char* data) { assert(data != NULL); @@ -1231,7 +1231,7 @@ unsigned int CSerialModem::readM17Data(unsigned char* data) return len; } -unsigned int CSerialModem::readFMData(unsigned char* data) +unsigned int CMMDVMModem::readFMData(unsigned char* data) { assert(data != NULL); @@ -1245,7 +1245,7 @@ unsigned int CSerialModem::readFMData(unsigned char* data) return len; } -unsigned int CSerialModem::readAX25Data(unsigned char* data) +unsigned int CMMDVMModem::readAX25Data(unsigned char* data) { assert(data != NULL); @@ -1259,7 +1259,7 @@ unsigned int CSerialModem::readAX25Data(unsigned char* data) return len; } -unsigned int CSerialModem::readTransparentData(unsigned char* data) +unsigned int CMMDVMModem::readTransparentData(unsigned char* data) { assert(data != NULL); @@ -1273,7 +1273,7 @@ unsigned int CSerialModem::readTransparentData(unsigned char* data) return len; } -unsigned int CSerialModem::readSerial(unsigned char* data, unsigned int length) +unsigned int CMMDVMModem::readSerial(unsigned char* data, unsigned int length) { assert(data != NULL); assert(length > 0U); @@ -1287,14 +1287,14 @@ unsigned int CSerialModem::readSerial(unsigned char* data, unsigned int length) return n; } -bool CSerialModem::hasDStarSpace() const +bool CMMDVMModem::hasDStarSpace() const { unsigned int space = m_txDStarData.freeSpace() / (DSTAR_FRAME_LENGTH_BYTES + 4U); return space > 1U; } -bool CSerialModem::writeDStarData(const unsigned char* data, unsigned int length) +bool CMMDVMModem::writeDStarData(const unsigned char* data, unsigned int length) { assert(data != NULL); assert(length > 0U); @@ -1328,21 +1328,21 @@ bool CSerialModem::writeDStarData(const unsigned char* data, unsigned int length return true; } -bool CSerialModem::hasDMRSpace1() const +bool CMMDVMModem::hasDMRSpace1() const { unsigned int space = m_txDMRData1.freeSpace() / (DMR_FRAME_LENGTH_BYTES + 4U); return space > 1U; } -bool CSerialModem::hasDMRSpace2() const +bool CMMDVMModem::hasDMRSpace2() const { unsigned int space = m_txDMRData2.freeSpace() / (DMR_FRAME_LENGTH_BYTES + 4U); return space > 1U; } -bool CSerialModem::writeDMRData1(const unsigned char* data, unsigned int length) +bool CMMDVMModem::writeDMRData1(const unsigned char* data, unsigned int length) { assert(data != NULL); assert(length > 0U); @@ -1365,7 +1365,7 @@ bool CSerialModem::writeDMRData1(const unsigned char* data, unsigned int length) return true; } -bool CSerialModem::writeDMRData2(const unsigned char* data, unsigned int length) +bool CMMDVMModem::writeDMRData2(const unsigned char* data, unsigned int length) { assert(data != NULL); assert(length > 0U); @@ -1388,14 +1388,14 @@ bool CSerialModem::writeDMRData2(const unsigned char* data, unsigned int length) return true; } -bool CSerialModem::hasYSFSpace() const +bool CMMDVMModem::hasYSFSpace() const { unsigned int space = m_txYSFData.freeSpace() / (YSF_FRAME_LENGTH_BYTES + 4U); return space > 1U; } -bool CSerialModem::writeYSFData(const unsigned char* data, unsigned int length) +bool CMMDVMModem::writeYSFData(const unsigned char* data, unsigned int length) { assert(data != NULL); assert(length > 0U); @@ -1418,14 +1418,14 @@ bool CSerialModem::writeYSFData(const unsigned char* data, unsigned int length) return true; } -bool CSerialModem::hasP25Space() const +bool CMMDVMModem::hasP25Space() const { unsigned int space = m_txP25Data.freeSpace() / (P25_LDU_FRAME_LENGTH_BYTES + 4U); return space > 1U; } -bool CSerialModem::writeP25Data(const unsigned char* data, unsigned int length) +bool CMMDVMModem::writeP25Data(const unsigned char* data, unsigned int length) { assert(data != NULL); assert(length > 0U); @@ -1448,14 +1448,14 @@ bool CSerialModem::writeP25Data(const unsigned char* data, unsigned int length) return true; } -bool CSerialModem::hasNXDNSpace() const +bool CMMDVMModem::hasNXDNSpace() const { unsigned int space = m_txNXDNData.freeSpace() / (NXDN_FRAME_LENGTH_BYTES + 4U); return space > 1U; } -bool CSerialModem::writeNXDNData(const unsigned char* data, unsigned int length) +bool CMMDVMModem::writeNXDNData(const unsigned char* data, unsigned int length) { assert(data != NULL); assert(length > 0U); @@ -1478,14 +1478,14 @@ bool CSerialModem::writeNXDNData(const unsigned char* data, unsigned int length) return true; } -bool CSerialModem::hasM17Space() const +bool CMMDVMModem::hasM17Space() const { unsigned int space = m_txM17Data.freeSpace() / (M17_FRAME_LENGTH_BYTES + 4U); return space > 1U; } -bool CSerialModem::writeM17Data(const unsigned char* data, unsigned int length) +bool CMMDVMModem::writeM17Data(const unsigned char* data, unsigned int length) { assert(data != NULL); assert(length > 0U); @@ -1512,14 +1512,14 @@ bool CSerialModem::writeM17Data(const unsigned char* data, unsigned int length) return true; } -bool CSerialModem::hasPOCSAGSpace() const +bool CMMDVMModem::hasPOCSAGSpace() const { unsigned int space = m_txPOCSAGData.freeSpace() / (POCSAG_FRAME_LENGTH_BYTES + 4U); return space > 1U; } -bool CSerialModem::writePOCSAGData(const unsigned char* data, unsigned int length) +bool CMMDVMModem::writePOCSAGData(const unsigned char* data, unsigned int length) { assert(data != NULL); assert(length > 0U); @@ -1539,12 +1539,12 @@ bool CSerialModem::writePOCSAGData(const unsigned char* data, unsigned int lengt return true; } -unsigned int CSerialModem::getFMSpace() const +unsigned int CMMDVMModem::getFMSpace() const { return m_txFMData.freeSpace(); } -bool CSerialModem::writeFMData(const unsigned char* data, unsigned int length) +bool CMMDVMModem::writeFMData(const unsigned char* data, unsigned int length) { assert(data != NULL); assert(length > 0U); @@ -1573,14 +1573,14 @@ bool CSerialModem::writeFMData(const unsigned char* data, unsigned int length) return true; } -bool CSerialModem::hasAX25Space() const +bool CMMDVMModem::hasAX25Space() const { unsigned int space = m_txAX25Data.freeSpace() / (AX25_MAX_FRAME_LENGTH_BYTES + 5U); return space > 1U; } -bool CSerialModem::writeAX25Data(const unsigned char* data, unsigned int length) +bool CMMDVMModem::writeAX25Data(const unsigned char* data, unsigned int length) { assert(data != NULL); assert(length > 0U); @@ -1609,7 +1609,7 @@ bool CSerialModem::writeAX25Data(const unsigned char* data, unsigned int length) return true; } -bool CSerialModem::writeTransparentData(const unsigned char* data, unsigned int length) +bool CMMDVMModem::writeTransparentData(const unsigned char* data, unsigned int length) { assert(data != NULL); assert(length > 0U); @@ -1643,7 +1643,7 @@ bool CSerialModem::writeTransparentData(const unsigned char* data, unsigned int return true; } -bool CSerialModem::writeDStarInfo(const char* my1, const char* my2, const char* your, const char* type, const char* reflector) +bool CMMDVMModem::writeDStarInfo(const char* my1, const char* my2, const char* your, const char* type, const char* reflector) { assert(m_serial != NULL); assert(my1 != NULL); @@ -1672,7 +1672,7 @@ bool CSerialModem::writeDStarInfo(const char* my1, const char* my2, const char* return m_serial->write(buffer, 33U) != 33; } -bool CSerialModem::writeDMRInfo(unsigned int slotNo, const std::string& src, bool group, const std::string& dest, const char* type) +bool CMMDVMModem::writeDMRInfo(unsigned int slotNo, const std::string& src, bool group, const std::string& dest, const char* type) { assert(m_serial != NULL); assert(type != NULL); @@ -1698,7 +1698,7 @@ bool CSerialModem::writeDMRInfo(unsigned int slotNo, const std::string& src, boo return m_serial->write(buffer, 47U) != 47; } -bool CSerialModem::writeYSFInfo(const char* source, const char* dest, unsigned char dgid, const char* type, const char* origin) +bool CMMDVMModem::writeYSFInfo(const char* source, const char* dest, unsigned char dgid, const char* type, const char* origin) { assert(m_serial != NULL); assert(source != NULL); @@ -1726,7 +1726,7 @@ bool CSerialModem::writeYSFInfo(const char* source, const char* dest, unsigned c return m_serial->write(buffer, 36U) != 36; } -bool CSerialModem::writeP25Info(const char* source, bool group, unsigned int dest, const char* type) +bool CMMDVMModem::writeP25Info(const char* source, bool group, unsigned int dest, const char* type) { assert(m_serial != NULL); assert(source != NULL); @@ -1751,7 +1751,7 @@ bool CSerialModem::writeP25Info(const char* source, bool group, unsigned int des return m_serial->write(buffer, 31U) != 31; } -bool CSerialModem::writeNXDNInfo(const char* source, bool group, unsigned int dest, const char* type) +bool CMMDVMModem::writeNXDNInfo(const char* source, bool group, unsigned int dest, const char* type) { assert(m_serial != NULL); assert(source != NULL); @@ -1776,7 +1776,7 @@ bool CSerialModem::writeNXDNInfo(const char* source, bool group, unsigned int de return m_serial->write(buffer, 31U) != 31; } -bool CSerialModem::writeM17Info(const char* source, const char* dest, const char* type) +bool CMMDVMModem::writeM17Info(const char* source, const char* dest, const char* type) { assert(m_serial != NULL); assert(source != NULL); @@ -1800,7 +1800,7 @@ bool CSerialModem::writeM17Info(const char* source, const char* dest, const char return m_serial->write(buffer, 23U) != 23; } -bool CSerialModem::writePOCSAGInfo(unsigned int ric, const std::string& message) +bool CMMDVMModem::writePOCSAGInfo(unsigned int ric, const std::string& message) { assert(m_serial != NULL); @@ -1823,7 +1823,7 @@ bool CSerialModem::writePOCSAGInfo(unsigned int ric, const std::string& message) return ret != int(length + 11U); } -bool CSerialModem::writeIPInfo(const std::string& address) +bool CMMDVMModem::writeIPInfo(const std::string& address) { assert(m_serial != NULL); @@ -1844,7 +1844,7 @@ bool CSerialModem::writeIPInfo(const std::string& address) return ret != int(length + 4U); } -bool CSerialModem::writeSerial(const unsigned char* data, unsigned int length) +bool CMMDVMModem::writeSerial(const unsigned char* data, unsigned int length) { assert(m_serial != NULL); assert(data != NULL); @@ -1865,27 +1865,27 @@ bool CSerialModem::writeSerial(const unsigned char* data, unsigned int length) return true; } -bool CSerialModem::hasTX() const +bool CMMDVMModem::hasTX() const { return m_tx; } -bool CSerialModem::hasCD() const +bool CMMDVMModem::hasCD() const { return m_cd; } -bool CSerialModem::hasLockout() const +bool CMMDVMModem::hasLockout() const { return m_lockout; } -bool CSerialModem::hasError() const +bool CMMDVMModem::hasError() const { return m_error; } -bool CSerialModem::readVersion() +bool CMMDVMModem::readVersion() { assert(m_serial != NULL); @@ -1998,7 +1998,7 @@ bool CSerialModem::readVersion() return false; } -bool CSerialModem::readStatus() +bool CMMDVMModem::readStatus() { assert(m_serial != NULL); @@ -2013,7 +2013,7 @@ bool CSerialModem::readStatus() return m_serial->write(buffer, 3U) == 3; } -bool CSerialModem::writeConfig() +bool CMMDVMModem::writeConfig() { switch (m_protocolVersion) { case 1U: @@ -2025,7 +2025,7 @@ bool CSerialModem::writeConfig() } } -bool CSerialModem::setConfig1() +bool CMMDVMModem::setConfig1() { assert(m_serial != NULL); @@ -2140,7 +2140,7 @@ bool CSerialModem::setConfig1() return true; } -bool CSerialModem::setConfig2() +bool CMMDVMModem::setConfig2() { assert(m_serial != NULL); @@ -2266,7 +2266,7 @@ bool CSerialModem::setConfig2() return true; } -bool CSerialModem::setFrequency() +bool CMMDVMModem::setFrequency() { assert(m_serial != NULL); @@ -2339,7 +2339,7 @@ bool CSerialModem::setFrequency() return true; } -RESP_TYPE_MMDVM CSerialModem::getResponse() +RESP_TYPE_MMDVM CMMDVMModem::getResponse() { assert(m_serial != NULL); @@ -2441,17 +2441,17 @@ RESP_TYPE_MMDVM CSerialModem::getResponse() return RTM_OK; } -HW_TYPE CSerialModem::getHWType() const +HW_TYPE CMMDVMModem::getHWType() const { return m_hwType; } -unsigned char CSerialModem::getMode() const +unsigned char CMMDVMModem::getMode() const { return m_mode; } -bool CSerialModem::setMode(unsigned char mode) +bool CMMDVMModem::setMode(unsigned char mode) { assert(m_serial != NULL); @@ -2467,7 +2467,7 @@ bool CSerialModem::setMode(unsigned char mode) return m_serial->write(buffer, 4U) == 4; } -bool CSerialModem::sendCWId(const std::string& callsign) +bool CMMDVMModem::sendCWId(const std::string& callsign) { assert(m_serial != NULL); @@ -2489,7 +2489,7 @@ bool CSerialModem::sendCWId(const std::string& callsign) return m_serial->write(buffer, length + 3U) == int(length + 3U); } -bool CSerialModem::writeDMRStart(bool tx) +bool CMMDVMModem::writeDMRStart(bool tx) { assert(m_serial != NULL); @@ -2510,7 +2510,7 @@ bool CSerialModem::writeDMRStart(bool tx) return m_serial->write(buffer, 4U) == 4; } -bool CSerialModem::writeDMRAbort(unsigned int slotNo) +bool CMMDVMModem::writeDMRAbort(unsigned int slotNo) { assert(m_serial != NULL); @@ -2531,7 +2531,7 @@ bool CSerialModem::writeDMRAbort(unsigned int slotNo) return m_serial->write(buffer, 4U) == 4; } -bool CSerialModem::writeDMRShortLC(const unsigned char* lc) +bool CMMDVMModem::writeDMRShortLC(const unsigned char* lc) { assert(m_serial != NULL); assert(lc != NULL); @@ -2556,7 +2556,7 @@ bool CSerialModem::writeDMRShortLC(const unsigned char* lc) return m_serial->write(buffer, 12U) == 12; } -void CSerialModem::setFMCallsignParams(const std::string& callsign, unsigned int callsignSpeed, unsigned int callsignFrequency, unsigned int callsignTime, unsigned int callsignHoldoff, float callsignHighLevel, float callsignLowLevel, bool callsignAtStart, bool callsignAtEnd, bool callsignAtLatch) +void CMMDVMModem::setFMCallsignParams(const std::string& callsign, unsigned int callsignSpeed, unsigned int callsignFrequency, unsigned int callsignTime, unsigned int callsignHoldoff, float callsignHighLevel, float callsignLowLevel, bool callsignAtStart, bool callsignAtEnd, bool callsignAtLatch) { m_fmCallsign = callsign; m_fmCallsignSpeed = callsignSpeed; @@ -2570,7 +2570,7 @@ void CSerialModem::setFMCallsignParams(const std::string& callsign, unsigned int m_fmCallsignAtLatch = callsignAtLatch; } -void CSerialModem::setFMAckParams(const std::string& rfAck, unsigned int ackSpeed, unsigned int ackFrequency, unsigned int ackMinTime, unsigned int ackDelay, float ackLevel) +void CMMDVMModem::setFMAckParams(const std::string& rfAck, unsigned int ackSpeed, unsigned int ackFrequency, unsigned int ackMinTime, unsigned int ackDelay, float ackLevel) { m_fmRfAck = rfAck; m_fmAckSpeed = ackSpeed; @@ -2580,7 +2580,7 @@ void CSerialModem::setFMAckParams(const std::string& rfAck, unsigned int ackSpee m_fmAckLevel = ackLevel; } -void CSerialModem::setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctcssFrequency, unsigned int ctcssHighThreshold, unsigned int ctcssLowThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime, unsigned int accessMode, bool cosInvert, bool noiseSquelch, unsigned int squelchHighThreshold, unsigned int squelchLowThreshold, unsigned int rfAudioBoost, float maxDevLevel) +void CMMDVMModem::setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctcssFrequency, unsigned int ctcssHighThreshold, unsigned int ctcssLowThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime, unsigned int accessMode, bool cosInvert, bool noiseSquelch, unsigned int squelchHighThreshold, unsigned int squelchLowThreshold, unsigned int rfAudioBoost, float maxDevLevel) { m_fmTimeout = timeout; m_fmTimeoutLevel = timeoutLevel; @@ -2605,14 +2605,14 @@ void CSerialModem::setFMMiscParams(unsigned int timeout, float timeoutLevel, flo m_fmMaxDevLevel = maxDevLevel; } -void CSerialModem::setFMExtParams(const std::string& ack, unsigned int audioBoost) +void CMMDVMModem::setFMExtParams(const std::string& ack, unsigned int audioBoost) { m_fmExtAck = ack; m_fmExtAudioBoost = audioBoost; m_fmExtEnable = true; } -bool CSerialModem::setFMCallsignParams() +bool CMMDVMModem::setFMCallsignParams() { assert(m_serial != NULL); @@ -2673,7 +2673,7 @@ bool CSerialModem::setFMCallsignParams() return true; } -bool CSerialModem::setFMAckParams() +bool CMMDVMModem::setFMAckParams() { assert(m_serial != NULL); @@ -2725,7 +2725,7 @@ bool CSerialModem::setFMAckParams() return true; } -bool CSerialModem::setFMMiscParams() +bool CMMDVMModem::setFMMiscParams() { assert(m_serial != NULL); @@ -2792,7 +2792,7 @@ bool CSerialModem::setFMMiscParams() return true; } -bool CSerialModem::setFMExtParams() +bool CMMDVMModem::setFMExtParams() { assert(m_serial != NULL); @@ -2843,7 +2843,7 @@ bool CSerialModem::setFMExtParams() return true; } -void CSerialModem::printDebug() +void CMMDVMModem::printDebug() { if (m_buffer[2U] == MMDVM_DEBUG1) { LogMessage("Debug: %.*s", m_length - m_offset - 0U, m_buffer + m_offset); diff --git a/SerialModem.h b/MMDVMModem.h similarity index 97% rename from SerialModem.h rename to MMDVMModem.h index 4b560775f..6e73ce8c3 100644 --- a/SerialModem.h +++ b/MMDVMModem.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2018,2020 by Jonathan Naylor G4KLX + * Copyright (C) 2011-2018,2020,2021 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef SERIALMODEM_H -#define SERIALMODEM_H +#ifndef MMDVMMODEM_H +#define MMDVMMODEM_H #include "Modem.h" @@ -42,10 +42,10 @@ enum SERIAL_STATE { SS_DATA }; -class CSerialModem : public IModem { +class CMMDVMModem : public IModem { public: - CSerialModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, bool useCOSAsLockout, bool trace, bool debug); - virtual ~CSerialModem(); + CMMDVMModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, bool useCOSAsLockout, bool trace, bool debug); + virtual ~CMMDVMModem(); virtual void setSerialParams(const std::string& protocol, unsigned int address, unsigned int speed); virtual void setRFParams(unsigned int rxFrequency, int rxOffset, unsigned int txFrequency, int txOffset, int txDCOffset, int rxDCOffset, float rfLevel, unsigned int pocsagFrequency); diff --git a/Makefile b/Makefile index 85a924a2b..108776ad1 100644 --- a/Makefile +++ b/Makefile @@ -11,11 +11,11 @@ OBJECTS = \ DMRDirectNetwork.o DMREMB.o DMREmbeddedData.o DMRFullLC.o DMRGatewayNetwork.o DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o \ DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o DStarSlowData.o FMControl.o FMNetwork.o Golay2087.o Golay24128.o \ Hamming.o I2CController.o IIRDirectForm1Filter.o LCDproc.o Log.o M17Control.o M17Convolution.o M17CRC.o M17LICH.o M17Network.o M17Utils.o MMDVMHost.o \ - Modem.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o \ - NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o \ - P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o P25Utils.o PseudoTTYController.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o \ - RS241213.o RSSIInterpolator.o SerialController.o SerialModem.o SerialPort.o StopWatch.o Sync.o SHA256.o TFTSurenoo.o Thread.o Timer.o UDPSocket.o \ - UserDB.o UserDBentry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o + MMDVMModem.o Modem.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o \ + NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o \ + P25Data.o P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o P25Utils.o PseudoTTYController.o POCSAGControl.o POCSAGNetwork.o QR1676.o \ + RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialPort.o StopWatch.o Sync.o SHA256.o TFTSurenoo.o Thread.o Timer.o UARTController.o \ + UDPSocket.o UserDB.o UserDBentry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o all: MMDVMHost RemoteCommand diff --git a/Makefile.Pi b/Makefile.Pi index 2880c34df..110672b1f 100644 --- a/Makefile.Pi +++ b/Makefile.Pi @@ -11,11 +11,11 @@ OBJECTS = \ DMRDirectNetwork.o DMREMB.o DMREmbeddedData.o DMRFullLC.o DMRGatewayNetwork.o DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o \ DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o DStarSlowData.o FMControl.o FMNetwork.o Golay2087.o Golay24128.o \ Hamming.o I2CController.o IIRDirectForm1Filter.o LCDproc.o Log.o M17Control.o M17Convolution.o M17CRC.o M17LICH.o M17Network.o M17Utils.o MMDVMHost.o \ - Modem.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o \ - NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o \ - P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o P25Utils.o PseudoTTYController.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o \ - RS241213.o RSSIInterpolator.o SerialController.o SerialModem.o SerialPort.o StopWatch.o Sync.o SHA256.o TFTSurenoo.o Thread.o Timer.o UDPSocket.o \ - UserDB.o UserDBentry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o + MMDVMModem.o Modem.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o \ + NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o \ + P25Data.o P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o P25Utils.o PseudoTTYController.o POCSAGControl.o POCSAGNetwork.o QR1676.o \ + RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialPort.o StopWatch.o Sync.o SHA256.o TFTSurenoo.o Thread.o Timer.o UARTController.o \ + UDPSocket.o UserDB.o UserDBentry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o all: MMDVMHost RemoteCommand diff --git a/Makefile.Pi.Adafruit b/Makefile.Pi.Adafruit index 019b46a1e..2fe709853 100644 --- a/Makefile.Pi.Adafruit +++ b/Makefile.Pi.Adafruit @@ -12,11 +12,11 @@ OBJECTS = \ DMRDirectNetwork.o DMREMB.o DMREmbeddedData.o DMRFullLC.o DMRGatewayNetwork.o DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o \ DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o DStarSlowData.o FMControl.o FMNetwork.o Golay2087.o Golay24128.o \ Hamming.o HD44780.o I2CController.o IIRDirectForm1Filter.o LCDproc.o Log.o M17Control.o M17Convolution.o M17CRC.o M17LICH.o M17Network.o M17Utils.o \ - MMDVMHost.o Modem.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o \ - NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o \ - P25Data.o P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o P25Utils.o PseudoTTYController.o POCSAGControl.o POCSAGNetwork.o QR1676.o \ - RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialModem.o SerialPort.o StopWatch.o Sync.o SHA256.o TFTSurenoo.o Thread.o \ - Timer.o UDPSocket.o UserDB.o UserDBentry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o + MMDVMHost.o MMDVMModem.o Modem.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o \ + NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o \ + NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o P25Utils.o PseudoTTYController.o POCSAGControl.o \ + POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialPort.o StopWatch.o Sync.o SHA256.o TFTSurenoo.o Thread.o Timer.o \ + UARTController.o UDPSocket.o UserDB.o UserDBentry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o all: MMDVMHost RemoteCommand diff --git a/Makefile.Pi.HD44780 b/Makefile.Pi.HD44780 index 811a0accd..1db3fcfe0 100644 --- a/Makefile.Pi.HD44780 +++ b/Makefile.Pi.HD44780 @@ -11,11 +11,11 @@ OBJECTS = \ DMRDirectNetwork.o DMREMB.o DMREmbeddedData.o DMRFullLC.o DMRGatewayNetwork.o DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o \ DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o DStarSlowData.o FMControl.o FMNetwork.o Golay2087.o Golay24128.o \ Hamming.o HD44780.o I2CController.o IIRDirectForm1Filter.o LCDproc.o Log.o M17Control.o M17Convolution.o M17CRC.o M17LICH.o M17Network.o M17Utils.o \ - MMDVMHost.o Modem.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o \ - NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o \ - P25Data.o P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o P25Utils.o PseudoTTYController.o POCSAGControl.o POCSAGNetwork.o QR1676.o \ - RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialModem.o SerialPort.o StopWatch.o Sync.o SHA256.o TFTSurenoo.o Thread.o \ - Timer.o UDPSocket.o UserDB.o UserDBentry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o + MMDVMHost.o MMDVMModem.o Modem.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o \ + NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o \ + NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o P25Utils.o PseudoTTYController.o POCSAGControl.o \ + POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialPort.o StopWatch.o Sync.o SHA256.o TFTSurenoo.o Thread.o Timer.o \ + UARTController.o UDPSocket.o UserDB.o UserDBentry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o all: MMDVMHost RemoteCommand diff --git a/Makefile.Pi.OLED b/Makefile.Pi.OLED index a8beaecfc..5c692cec4 100644 --- a/Makefile.Pi.OLED +++ b/Makefile.Pi.OLED @@ -15,11 +15,11 @@ OBJECTS = \ DMRDirectNetwork.o DMREMB.o DMREmbeddedData.o DMRFullLC.o DMRGatewayNetwork.o DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o \ DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o DStarSlowData.o FMControl.o FMNetwork.o Golay2087.o Golay24128.o \ Hamming.o I2CController.o IIRDirectForm1Filter.o LCDproc.o Log.o M17Control.o M17Convolution.o M17CRC.o M17LICH.o M17Network.o M17Utils.o MMDVMHost.o \ - Modem.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o \ - NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o OLED.o P25Audio.o P25Control.o \ - P25Data.o P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o P25Utils.o PseudoTTYController.o POCSAGControl.o POCSAGNetwork.o QR1676.o \ - RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialModem.o SerialPort.o StopWatch.o Sync.o SHA256.o TFTSurenoo.o Thread.o \ - Timer.o UDPSocket.o UserDB.o UserDBentry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o + MMDVMModem.o Modem.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o \ + NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o OLED.o P25Audio.o \ + P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o P25Utils.o PseudoTTYController.o POCSAGControl.o POCSAGNetwork.o QR1676.o \ + RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialPort.o StopWatch.o Sync.o SHA256.o TFTSurenoo.o Thread.o Timer.o UARTController.o \ + UDPSocket.o UserDB.o UserDBentry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o all: MMDVMHost RemoteCommand diff --git a/Makefile.Pi.PCF8574 b/Makefile.Pi.PCF8574 index 21d4ed055..8da7d05a2 100644 --- a/Makefile.Pi.PCF8574 +++ b/Makefile.Pi.PCF8574 @@ -12,11 +12,11 @@ OBJECTS = \ DMRDirectNetwork.o DMREMB.o DMREmbeddedData.o DMRFullLC.o DMRGatewayNetwork.o DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o \ DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o DStarSlowData.o FMControl.o FMNetwork.o Golay2087.o Golay24128.o \ Hamming.o HD44780.o I2CController.o IIRDirectForm1Filter.o LCDproc.o Log.o M17Control.o M17Convolution.o M17CRC.o M17LICH.o M17Network.o M17Utils.o \ - MMDVMHost.o Modem.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o \ - NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o \ - P25Data.o P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o P25Utils.o PseudoTTYController.o POCSAGControl.o POCSAGNetwork.o QR1676.o \ - RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialModem.o SerialPort.o StopWatch.o Sync.o SHA256.o TFTSurenoo.o Thread.o \ - Timer.o UDPSocket.o UserDB.o UserDBentry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o + MMDVMHost.o MMDVMModem.o Modem.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o \ + NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o \ + NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o P25Utils.o PseudoTTYController.o POCSAGControl.o \ + POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialPort.o StopWatch.o Sync.o SHA256.o TFTSurenoo.o Thread.o Timer.o \ + UARTController.o UDPSocket.o UserDB.o UserDBentry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o all: MMDVMHost RemoteCommand diff --git a/PseudoTTYController.cpp b/PseudoTTYController.cpp index 52a4ac950..8c3cd7ab5 100644 --- a/PseudoTTYController.cpp +++ b/PseudoTTYController.cpp @@ -1,6 +1,5 @@ /* - * Copyright (C) 2002-2004,2007-2011,2013,2014-2017,2019,2020 by Jonathan Naylor G4KLX - * Copyright (C) 1999-2001 by Thomas Sailor HB9JNX + * Copyright (C) 2020,2021 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,7 +36,7 @@ CPseudoTTYController::CPseudoTTYController(const std::string& symlink, unsigned int speed, bool assertRTS) : -CSerialController(speed, assertRTS), +CUARTController(speed, assertRTS), m_symlink(symlink) { } @@ -77,10 +76,9 @@ bool CPseudoTTYController::open() void CPseudoTTYController::close() { - CSerialController::close(); + CUARTController::close(); ::unlink(m_symlink.c_str()); } #endif - diff --git a/PseudoTTYController.h b/PseudoTTYController.h index ccf6ba12f..228f153d4 100644 --- a/PseudoTTYController.h +++ b/PseudoTTYController.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 by Jonathan Naylor G4KLX + * Copyright (C) 2020,2021 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,9 +23,9 @@ #include -#include "SerialController.h" +#include "UARTController.h" -class CPseudoTTYController : public CSerialController { +class CPseudoTTYController : public CUARTController { public: CPseudoTTYController(const std::string& symlink, unsigned int speed, bool assertRTS = false); virtual ~CPseudoTTYController(); diff --git a/SerialController.cpp b/UARTController.cpp similarity index 89% rename from SerialController.cpp rename to UARTController.cpp index 99fe5764a..cc748b1de 100644 --- a/SerialController.cpp +++ b/UARTController.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2004,2007-2011,2013,2014-2017,2019,2020 by Jonathan Naylor G4KLX + * Copyright (C) 2002-2004,2007-2011,2013,2014-2017,2019,2020,2021 by Jonathan Naylor G4KLX * Copyright (C) 1999-2001 by Thomas Sailor HB9JNX * * This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "SerialController.h" +#include "UARTController.h" #include "Log.h" #include @@ -39,7 +39,7 @@ #if defined(_WIN32) || defined(_WIN64) -CSerialController::CSerialController(const std::string& device, unsigned int speed, bool assertRTS) : +CUARTController::CUARTController(const std::string& device, unsigned int speed, bool assertRTS) : m_device(device), m_speed(speed), m_assertRTS(assertRTS), @@ -48,7 +48,7 @@ m_handle(INVALID_HANDLE_VALUE) assert(!device.empty()); } -CSerialController::CSerialController(unsigned int speed, bool assertRTS) : +CUARTController::CUARTController(unsigned int speed, bool assertRTS) : m_device(), m_speed(speed), m_assertRTS(assertRTS), @@ -56,11 +56,11 @@ m_handle(INVALID_HANDLE_VALUE) { } -CSerialController::~CSerialController() +CUARTController::~CUARTController() { } -bool CSerialController::open() +bool CUARTController::open() { assert(m_handle == INVALID_HANDLE_VALUE); @@ -140,7 +140,7 @@ bool CSerialController::open() return true; } -int CSerialController::read(unsigned char* buffer, unsigned int length) +int CUARTController::read(unsigned char* buffer, unsigned int length) { assert(m_handle != INVALID_HANDLE_VALUE); assert(buffer != NULL); @@ -162,7 +162,7 @@ int CSerialController::read(unsigned char* buffer, unsigned int length) return int(length); } -int CSerialController::readNonblock(unsigned char* buffer, unsigned int length) +int CUARTController::readNonblock(unsigned char* buffer, unsigned int length) { assert(m_handle != INVALID_HANDLE_VALUE); assert(buffer != NULL); @@ -194,7 +194,7 @@ int CSerialController::readNonblock(unsigned char* buffer, unsigned int length) return int(bytes); } -int CSerialController::write(const unsigned char* buffer, unsigned int length) +int CUARTController::write(const unsigned char* buffer, unsigned int length) { assert(m_handle != INVALID_HANDLE_VALUE); assert(buffer != NULL); @@ -218,7 +218,7 @@ int CSerialController::write(const unsigned char* buffer, unsigned int length) return int(length); } -void CSerialController::close() +void CUARTController::close() { assert(m_handle != INVALID_HANDLE_VALUE); @@ -228,7 +228,7 @@ void CSerialController::close() #else -CSerialController::CSerialController(const std::string& device, unsigned int speed, bool assertRTS) : +CUARTController::CUARTController(const std::string& device, unsigned int speed, bool assertRTS) : m_device(device), m_speed(speed), m_assertRTS(assertRTS), @@ -237,7 +237,7 @@ m_fd(-1) assert(!device.empty()); } -CSerialController::CSerialController(unsigned int speed, bool assertRTS) : +CUARTController::CUARTController(unsigned int speed, bool assertRTS) : m_device(), m_speed(speed), m_assertRTS(assertRTS), @@ -245,11 +245,11 @@ m_fd(-1) { } -CSerialController::~CSerialController() +CUARTController::~CUARTController() { } -bool CSerialController::open() +bool CUARTController::open() { assert(m_fd == -1); @@ -269,7 +269,7 @@ bool CSerialController::open() return true; } -bool CSerialController::setRaw() +bool CUARTController::setRaw() { termios termios; if (::tcgetattr(m_fd, &termios) < 0) { @@ -368,7 +368,7 @@ bool CSerialController::setRaw() } #if defined(__APPLE__) -int CSerialController::setNonblock(bool nonblock) +int CUARTController::setNonblock(bool nonblock) { int flag = ::fcntl(m_fd, F_GETFD, 0); @@ -381,7 +381,7 @@ int CSerialController::setNonblock(bool nonblock) } #endif -int CSerialController::read(unsigned char* buffer, unsigned int length) +int CUARTController::read(unsigned char* buffer, unsigned int length) { assert(buffer != NULL); assert(m_fd != -1); @@ -429,7 +429,7 @@ int CSerialController::read(unsigned char* buffer, unsigned int length) return length; } -bool CSerialController::canWrite(){ +bool CUARTController::canWrite(){ #if defined(__APPLE__) fd_set wset; FD_ZERO(&wset); @@ -449,7 +449,7 @@ bool CSerialController::canWrite(){ #endif } -int CSerialController::write(const unsigned char* buffer, unsigned int length) +int CUARTController::write(const unsigned char* buffer, unsigned int length) { assert(buffer != NULL); assert(m_fd != -1); @@ -476,7 +476,7 @@ int CSerialController::write(const unsigned char* buffer, unsigned int length) return length; } -void CSerialController::close() +void CUARTController::close() { assert(m_fd != -1); diff --git a/SerialController.h b/UARTController.h similarity index 80% rename from SerialController.h rename to UARTController.h index e4adb7d84..e1e245f62 100644 --- a/SerialController.h +++ b/UARTController.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2004,2007-2009,2011-2013,2015-2017,2020 by Jonathan Naylor G4KLX + * Copyright (C) 2002-2004,2007-2009,2011-2013,2015-2017,2020,2021 by Jonathan Naylor G4KLX * Copyright (C) 1999-2001 by Thomas Sailor HB9JNX * * This program is free software; you can redistribute it and/or modify @@ -17,8 +17,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef SerialController_H -#define SerialController_H +#ifndef UARTController_H +#define UARTController_H #include "SerialPort.h" @@ -28,10 +28,10 @@ #include #endif -class CSerialController : public ISerialPort { +class CUARTController : public ISerialPort { public: - CSerialController(const std::string& device, unsigned int speed, bool assertRTS = false); - virtual ~CSerialController(); + CUARTController(const std::string& device, unsigned int speed, bool assertRTS = false); + virtual ~CUARTController(); virtual bool open(); @@ -46,7 +46,7 @@ class CSerialController : public ISerialPort { #endif protected: - CSerialController(unsigned int speed, bool assertRTS = false); + CUARTController(unsigned int speed, bool assertRTS = false); std::string m_device; unsigned int m_speed; diff --git a/Version.h b/Version.h index 2dedd1967..50453e8e3 100644 --- a/Version.h +++ b/Version.h @@ -19,6 +19,6 @@ #if !defined(VERSION_H) #define VERSION_H -const char* VERSION = "20210101"; +const char* VERSION = "20210216"; #endif