diff --git a/Modem.h b/Modem.h index caede0a..e92dcc0 100644 --- a/Modem.h +++ b/Modem.h @@ -105,7 +105,6 @@ public: virtual unsigned int readSerial(unsigned char* data, unsigned int length) = 0; virtual bool writeI2C(const unsigned char* data, unsigned int length) = 0; - virtual unsigned int readI2C(unsigned char* data, unsigned int length) = 0; virtual unsigned char getMode() const = 0; virtual bool setMode(unsigned char mode) = 0; diff --git a/NullModem.h b/NullModem.h index 771b56c..a5f0d06 100644 --- a/NullModem.h +++ b/NullModem.h @@ -107,7 +107,6 @@ public: virtual unsigned int readSerial(unsigned char* data, unsigned int length) { return 0U; }; virtual bool writeI2C(const unsigned char* data, unsigned int length) { return true; }; - virtual unsigned int readI2C(unsigned char* data, unsigned int length) { return 0U; }; virtual unsigned char getMode() const { return MODE_IDLE; }; virtual bool setMode(unsigned char mode) { return true; }; diff --git a/SerialModem.cpp b/SerialModem.cpp index bff9be3..aeb84f8 100644 --- a/SerialModem.cpp +++ b/SerialModem.cpp @@ -184,9 +184,6 @@ m_txFMData(5000U, "Modem TX FM"), m_rxAX25Data(1000U, "Modem RX AX.25"), m_txAX25Data(1000U, "Modem TX AX.25"), m_rxSerialData(1000U, "Modem RX Serial"), -m_txSerialData(1000U, "Modem TX Serial"), -m_rxI2CData(1000U, "Modem RX I2C"), -m_txI2CData(1000U, "Modem TX I2C"), m_rxTransparentData(1000U, "Modem RX Transparent"), m_txTransparentData(1000U, "Modem TX Transparent"), m_sendTransparentDataFrameType(0U), @@ -875,12 +872,6 @@ void CSerialModem::clock(unsigned int ms) m_rxSerialData.addData(m_buffer + m_offset, m_length - m_offset); break; - case MMDVM_I2C_DATA: - if (m_trace) - CUtils::dump(1U, "RX I2C Data", m_buffer, m_length); - m_rxI2CData.addData(m_buffer + m_offset, m_length - m_offset); - break; - default: LogMessage("Unknown message, type: %02X", m_type); CUtils::dump("Buffer dump", m_buffer, m_length); @@ -1099,32 +1090,6 @@ void CSerialModem::clock(unsigned int ms) if (ret != int(len)) LogWarning("Error when writing Transparent data to the MMDVM"); } - - if (!m_txSerialData.isEmpty()) { - unsigned char len = 0U; - m_txSerialData.getData(&len, 1U); - m_txSerialData.getData(m_buffer, len); - - if (m_trace) - CUtils::dump(1U, "TX Serial Data", m_buffer, len); - - int ret = m_serial->write(m_buffer, len); - if (ret != int(len)) - LogWarning("Error when writing Serial data to the MMDVM"); - } - - if (!m_txI2CData.isEmpty()) { - unsigned char len = 0U; - m_txI2CData.getData(&len, 1U); - m_txI2CData.getData(m_buffer, len); - - if (m_trace) - CUtils::dump(1U, "TX I2C Data", m_buffer, len); - - int ret = m_serial->write(m_buffer, len); - if (ret != int(len)) - LogWarning("Error when writing I2C data to the MMDVM"); - } } void CSerialModem::close() @@ -1290,20 +1255,6 @@ unsigned int CSerialModem::readSerial(unsigned char* data, unsigned int length) return n; } -unsigned int CSerialModem::readI2C(unsigned char* data, unsigned int length) -{ - assert(data != NULL); - assert(length > 0U); - - unsigned int n = 0U; - while (!m_rxI2CData.isEmpty() && n < length) { - m_rxI2CData.getData(data + n, 1U); - n++; - } - - return n; -} - bool CSerialModem::hasDStarSpace() const { unsigned int space = m_txDStarData.freeSpace() / (DSTAR_FRAME_LENGTH_BYTES + 4U); @@ -1670,9 +1621,7 @@ bool CSerialModem::writeSerial(const unsigned char* data, unsigned int length) ::memcpy(buffer + 3U, data, length); - unsigned char len = length + 3U; - m_txSerialData.addData(&len, 1U); - m_txSerialData.addData(buffer, len); + m_serial->write(buffer, length + 3U); return true; } @@ -1691,9 +1640,7 @@ bool CSerialModem::writeI2C(const unsigned char* data, unsigned int length) ::memcpy(buffer + 3U, data, length); - unsigned char len = length + 3U; - m_txI2CData.addData(&len, 1U); - m_txI2CData.addData(buffer, len); + m_serial->write(buffer, length + 3U); return true; } diff --git a/SerialModem.h b/SerialModem.h index ae0d754..c33139b 100644 --- a/SerialModem.h +++ b/SerialModem.h @@ -125,7 +125,6 @@ public: virtual unsigned int readSerial(unsigned char* data, unsigned int length); virtual bool writeI2C(const unsigned char* data, unsigned int length); - virtual unsigned int readI2C(unsigned char* data, unsigned int length); virtual unsigned char getMode() const; virtual bool setMode(unsigned char mode); @@ -208,9 +207,6 @@ private: CRingBuffer m_rxAX25Data; CRingBuffer m_txAX25Data; CRingBuffer m_rxSerialData; - CRingBuffer m_txSerialData; - CRingBuffer m_rxI2CData; - CRingBuffer m_txI2CData; CRingBuffer m_rxTransparentData; CRingBuffer m_txTransparentData; unsigned int m_sendTransparentDataFrameType; diff --git a/Version.h b/Version.h index 3f190ee..6434cb8 100644 --- a/Version.h +++ b/Version.h @@ -19,6 +19,6 @@ #if !defined(VERSION_H) #define VERSION_H -const char* VERSION = "20201113"; +const char* VERSION = "20201115"; #endif