diff --git a/Display.cpp b/Display.cpp index d75afdd..93c3029 100644 --- a/Display.cpp +++ b/Display.cpp @@ -155,10 +155,9 @@ void CDisplay::clearFusion() } } -void CDisplay::writeP25(const char* source, bool group, const char* dest, const char* type) +void CDisplay::writeP25(const char* source, bool group, unsigned int dest, const char* type) { assert(source != NULL); - assert(dest != NULL); assert(type != NULL); m_timer1.start(); diff --git a/Display.h b/Display.h index ae63872..e9e7f4c 100644 --- a/Display.h +++ b/Display.h @@ -44,7 +44,7 @@ public: void writeFusion(const char* source, const char* dest, const char* type, const char* origin); void clearFusion(); - void writeP25(const char* source, bool group, const char* dest, const char* type); + void writeP25(const char* source, bool group, unsigned int dest, const char* type); void clearP25(); virtual void close() = 0; @@ -65,7 +65,7 @@ protected: virtual void writeFusionInt(const char* source, const char* dest, const char* type, const char* origin) = 0; virtual void clearFusionInt() = 0; - virtual void writeP25Int(const char* source, bool group, const char* dest, const char* type) = 0; + virtual void writeP25Int(const char* source, bool group, unsigned int dest, const char* type) = 0; virtual void clearP25Int() = 0; virtual void clockInt(unsigned int ms); diff --git a/HD44780.cpp b/HD44780.cpp index 65a8274..fc04a13 100644 --- a/HD44780.cpp +++ b/HD44780.cpp @@ -730,10 +730,9 @@ void CHD44780::clearFusionInt() } } -void CHD44780::writeP25Int(const char* source, bool group, const char* dest, const char* type) +void CHD44780::writeP25Int(const char* source, bool group, unsigned int dest, const char* type) { assert(source != NULL); - assert(dest != NULL); assert(type != NULL); #ifdef ADAFRUIT_DISPLAY @@ -764,7 +763,7 @@ void CHD44780::writeP25Int(const char* source, bool group, const char* dest, con ::lcdPosition(m_fd, 0, 1); ::lcdPrintf(m_fd, "%.*s", m_cols, m_buffer1); - ::sprintf(m_buffer1, "%s%.10s", group ? "TG" : "", dest); + ::sprintf(m_buffer1, "%s%u", group ? "TG" : "", dest); ::lcdPosition(m_fd, 0, 2); ::lcdPrintf(m_fd, "%.*s", m_cols, m_buffer1); } else if (m_rows == 4U && m_cols == 20U) { @@ -773,12 +772,12 @@ void CHD44780::writeP25Int(const char* source, bool group, const char* dest, con ::lcdPosition(m_fd, 0, 1); ::lcdPrintf(m_fd, "%.*s", m_cols, m_buffer1); - ::sprintf(m_buffer1, "%s%.10s", group ? "TG" : "", dest); + ::sprintf(m_buffer1, "%s%u", group ? "TG" : "", dest); ::lcdPosition(m_fd, 0, 2); ::lcdPrintf(m_fd, "%.*s", m_cols, m_buffer1); } else if (m_rows == 2 && m_cols == 40U) { char m_buffer1[40U]; - ::sprintf(m_buffer1, "%.10s > %s%.10s", source, group ? "TG" : "", dest); + ::sprintf(m_buffer1, "%.10s > %s%u", source, group ? "TG" : "", dest); ::lcdPosition(m_fd, 0, 1); ::lcdPrintf(m_fd, "%.*s", m_cols, m_buffer1); diff --git a/HD44780.h b/HD44780.h index ac4c73b..3c2eddf 100644 --- a/HD44780.h +++ b/HD44780.h @@ -110,7 +110,7 @@ protected: virtual void writeFusionInt(const char* source, const char* dest, const char* type, const char* origin); virtual void clearFusionInt(); - virtual void writeP25Int(const char* source, bool group, const char* dest, const char* type); + virtual void writeP25Int(const char* source, bool group, unsigned int dest, const char* type); virtual void clearP25Int(); virtual void clockInt(unsigned int ms); diff --git a/Nextion.cpp b/Nextion.cpp index c67c5c1..f54ae5e 100644 --- a/Nextion.cpp +++ b/Nextion.cpp @@ -233,10 +233,9 @@ void CNextion::clearFusionInt() sendCommand("t2.txt=\"\""); } -void CNextion::writeP25Int(const char* source, bool group, const char* dest, const char* type) +void CNextion::writeP25Int(const char* source, bool group, unsigned int dest, const char* type) { assert(source != NULL); - assert(dest != NULL); assert(type != NULL); if (m_mode != MODE_P25) @@ -249,7 +248,7 @@ void CNextion::writeP25Int(const char* source, bool group, const char* dest, con ::sprintf(text, "t0.txt=\"%s %.10s\"", type, source); sendCommand(text); - ::sprintf(text, "t1.txt=\"%s%.10s\"", group ? "TG" : "", dest); + ::sprintf(text, "t1.txt=\"%s%u\"", group ? "TG" : "", dest); sendCommand(text); m_clockDisplayTimer.stop(); diff --git a/Nextion.h b/Nextion.h index 6f6329a..edea236 100644 --- a/Nextion.h +++ b/Nextion.h @@ -50,7 +50,7 @@ protected: virtual void writeFusionInt(const char* source, const char* dest, const char* type, const char* origin); virtual void clearFusionInt(); - virtual void writeP25Int(const char* source, bool group, const char* dest, const char* type); + virtual void writeP25Int(const char* source, bool group, unsigned int dest, const char* type); virtual void clearP25Int(); virtual void clockInt(unsigned int ms); diff --git a/NullDisplay.cpp b/NullDisplay.cpp index b3018c8..d975d57 100644 --- a/NullDisplay.cpp +++ b/NullDisplay.cpp @@ -68,7 +68,7 @@ void CNullDisplay::clearFusionInt() { } -void CNullDisplay::writeP25Int(const char* source, bool group, const char* dest, const char* type) +void CNullDisplay::writeP25Int(const char* source, bool group, unsigned int dest, const char* type) { } diff --git a/NullDisplay.h b/NullDisplay.h index ad25aee..c225c63 100644 --- a/NullDisplay.h +++ b/NullDisplay.h @@ -47,7 +47,7 @@ protected: virtual void writeFusionInt(const char* source, const char* dest, const char* type, const char* origin); virtual void clearFusionInt(); - virtual void writeP25Int(const char* source, bool group, const char* dest, const char* type); + virtual void writeP25Int(const char* source, bool group, unsigned int dest, const char* type); virtual void clearP25Int(); private: diff --git a/OLED.cpp b/OLED.cpp index 2e4a687..ac15908 100644 --- a/OLED.cpp +++ b/OLED.cpp @@ -210,7 +210,7 @@ void COLED::clearFusionInt() display.display(); } -void COLED::writeP25Int(const char* source, bool group, const char* dest, const char* type) +void COLED::writeP25Int(const char* source, bool group, unsigned int dest, const char* type) { m_mode = MODE_P25; display.fillRect(0, OLED_LINE1, display.width(), 10, BLACK); @@ -218,7 +218,7 @@ void COLED::writeP25Int(const char* source, bool group, const char* dest, const display.printf("%s %.10s", type, source); display.fillRect(0, OLED_LINE2, display.width(), 10, BLACK); display.setCursor(0,OLED_LINE2); - display.printf(" %s%.10s", group ? "TG" : "", dest); + display.printf(" %s%u", group ? "TG" : "", dest); OLED_statusbar(); display.display(); } diff --git a/OLED.h b/OLED.h index 9c2d08f..e7cc4b4 100644 --- a/OLED.h +++ b/OLED.h @@ -94,7 +94,7 @@ public: virtual void writeFusionInt(const char* source, const char* dest, const char* type, const char* origin); virtual void clearFusionInt(); - virtual void writeP25Int(const char* source, bool group, const char* dest, const char* type); + virtual void writeP25Int(const char* source, bool group, unsigned int dest, const char* type); virtual void clearP25Int(); virtual void close(); diff --git a/TFTSerial.cpp b/TFTSerial.cpp index ee2d7c4..d433f4a 100644 --- a/TFTSerial.cpp +++ b/TFTSerial.cpp @@ -311,10 +311,9 @@ void CTFTSerial::clearFusionInt() displayText(" "); } -void CTFTSerial::writeP25Int(const char* source, bool group, const char* dest, const char* type) +void CTFTSerial::writeP25Int(const char* source, bool group, unsigned int dest, const char* type) { assert(source != NULL); - assert(dest != NULL); assert(type != NULL); if (m_mode != MODE_P25) { @@ -333,7 +332,7 @@ void CTFTSerial::writeP25Int(const char* source, bool group, const char* dest, c gotoPosPixel(5U, 70U); displayText(text); - ::sprintf(text, " %s%.10s", group ? "TG" : "", dest); + ::sprintf(text, " %s%u", group ? "TG" : "", dest); gotoPosPixel(5U, 90U); displayText(text); diff --git a/TFTSerial.h b/TFTSerial.h index a0ad7d0..63fd969 100644 --- a/TFTSerial.h +++ b/TFTSerial.h @@ -49,7 +49,7 @@ protected: virtual void writeFusionInt(const char* source, const char* dest, const char* type, const char* origin); virtual void clearFusionInt(); - virtual void writeP25Int(const char* source, bool group, const char* dest, const char* type); + virtual void writeP25Int(const char* source, bool group, unsigned int dest, const char* type); virtual void clearP25Int(); private: