Skip to content

Commit

Permalink
The P25 destination is an integer.
Browse files Browse the repository at this point in the history
  • Loading branch information
g4klx committed Sep 12, 2016
1 parent e2ec529 commit 7171af3
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 23 deletions.
3 changes: 1 addition & 2 deletions Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class CDisplay
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;
Expand All @@ -65,7 +65,7 @@ class CDisplay
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);
Expand Down
9 changes: 4 additions & 5 deletions HD44780.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion HD44780.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class CHD44780 : public CDisplay
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);
Expand Down
5 changes: 2 additions & 3 deletions Nextion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion Nextion.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class CNextion : public CDisplay
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);
Expand Down
2 changes: 1 addition & 1 deletion NullDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}

Expand Down
2 changes: 1 addition & 1 deletion NullDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class CNullDisplay : public CDisplay
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:
Expand Down
4 changes: 2 additions & 2 deletions OLED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,15 @@ 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);
display.setCursor(0,OLED_LINE1);
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();
}
Expand Down
2 changes: 1 addition & 1 deletion OLED.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class COLED : public CDisplay
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();
Expand Down
5 changes: 2 additions & 3 deletions TFTSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion TFTSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class CTFTSerial : public CDisplay
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:
Expand Down

0 comments on commit 7171af3

Please sign in to comment.