Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into define_display_sizes
Browse files Browse the repository at this point in the history
Conflicts:
	HD44780.cpp
  • Loading branch information
phl0 committed Apr 16, 2016
2 parents a8cd27f + d14da84 commit a853a8c
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 25 deletions.
30 changes: 18 additions & 12 deletions DMRSlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,14 @@ void CDMRSlot::writeModem(unsigned char *data)
m_rfState = RS_RF_AUDIO;

std::string src = m_lookup->find(id);
std::string dst = m_lookup->find(m_rfLC->getDstId());

if (m_netState == RS_NET_IDLE) {
setShortLC(m_slotNo, m_rfLC->getDstId(), m_rfLC->getFLCO(), true);
m_display->writeDMR(m_slotNo, src.c_str(), m_rfLC->getFLCO() == FLCO_GROUP, m_rfLC->getDstId(), "R");
m_display->writeDMR(m_slotNo, src.c_str(), m_rfLC->getFLCO() == FLCO_GROUP, dst.c_str(), "R");
}

LogMessage("DMR Slot %u, received RF voice header from %s to %s%u", m_slotNo, src.c_str(), m_rfLC->getFLCO() == FLCO_GROUP ? "TG " : "", m_rfLC->getDstId());
LogMessage("DMR Slot %u, received RF voice header from %s to %s%s", m_slotNo, src.c_str(), m_rfLC->getFLCO() == FLCO_GROUP ? "TG " : "", dst.c_str());
} else if (dataType == DT_VOICE_PI_HEADER) {
if (m_rfState != RS_RF_AUDIO)
return;
Expand Down Expand Up @@ -284,13 +285,14 @@ void CDMRSlot::writeModem(unsigned char *data)
m_rfState = RS_RF_DATA;

std::string src = m_lookup->find(srcId);
std::string dst = m_lookup->find(dstId);

if (m_netState == RS_NET_IDLE) {
setShortLC(m_slotNo, dstId, gi ? FLCO_GROUP : FLCO_USER_USER, false);
m_display->writeDMR(m_slotNo, src.c_str(), gi, dstId, "R");
m_display->writeDMR(m_slotNo, src.c_str(), gi, dst.c_str(), "R");
}

LogMessage("DMR Slot %u, received RF data header from %s to %s%u, %u blocks", m_slotNo, src.c_str(), gi ? "TG ": "", dstId, m_rfFrames);
LogMessage("DMR Slot %u, received RF data header from %s to %s%s, %u blocks", m_slotNo, src.c_str(), gi ? "TG ": "", dst.c_str(), m_rfFrames);
} else if (dataType == DT_CSBK) {
CDMRCSBK csbk;
bool valid = csbk.put(data + 2U);
Expand Down Expand Up @@ -559,13 +561,14 @@ void CDMRSlot::writeModem(unsigned char *data)
m_rfState = RS_RF_AUDIO;

std::string src = m_lookup->find(m_rfLC->getSrcId());
std::string dst = m_lookup->find(m_rfLC->getDstId());

if (m_netState == RS_NET_IDLE) {
setShortLC(m_slotNo, m_rfLC->getDstId(), m_rfLC->getFLCO(), true);
m_display->writeDMR(m_slotNo, src.c_str(), m_rfLC->getFLCO() == FLCO_GROUP, m_rfLC->getDstId(), "R");
m_display->writeDMR(m_slotNo, src.c_str(), m_rfLC->getFLCO() == FLCO_GROUP, dst.c_str(), "R");
}

LogMessage("DMR Slot %u, received RF late entry from %s to %s%u", m_slotNo, src.c_str(), m_rfLC->getFLCO() == FLCO_GROUP ? "TG " : "", m_rfLC->getDstId());
LogMessage("DMR Slot %u, received RF late entry from %s to %s%s", m_slotNo, src.c_str(), m_rfLC->getFLCO() == FLCO_GROUP ? "TG " : "", dst.c_str());
}
}
}
Expand Down Expand Up @@ -738,14 +741,15 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
setShortLC(m_slotNo, m_netLC->getDstId(), m_netLC->getFLCO(), true);

std::string src = m_lookup->find(m_netLC->getSrcId());
std::string dst = m_lookup->find(m_netLC->getDstId());

m_display->writeDMR(m_slotNo, src.c_str(), m_netLC->getFLCO() == FLCO_GROUP, m_netLC->getDstId(), "N");
m_display->writeDMR(m_slotNo, src.c_str(), m_netLC->getFLCO() == FLCO_GROUP, dst.c_str(), "N");

#if defined(DUMP_DMR)
openFile();
writeFile(data);
#endif
LogMessage("DMR Slot %u, received network voice header from %s to %s%u", m_slotNo, src.c_str(), m_netLC->getFLCO() == FLCO_GROUP ? "TG " : "", m_netLC->getDstId());
LogMessage("DMR Slot %u, received network voice header from %s to %s%s", m_slotNo, src.c_str(), m_netLC->getFLCO() == FLCO_GROUP ? "TG " : "", dst.c_str());
} else if (dataType == DT_VOICE_PI_HEADER) {
if (m_netState != RS_NET_AUDIO)
return;
Expand Down Expand Up @@ -855,10 +859,11 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
setShortLC(m_slotNo, dmrData.getDstId(), gi ? FLCO_GROUP : FLCO_USER_USER, false);

std::string src = m_lookup->find(dmrData.getSrcId());
std::string dst = m_lookup->find(dmrData.getDstId());

m_display->writeDMR(m_slotNo, src.c_str(), gi, dmrData.getDstId(), "N");
m_display->writeDMR(m_slotNo, src.c_str(), gi, dst.c_str(), "N");

LogMessage("DMR Slot %u, received network data header from %s to %s%u, %u blocks", m_slotNo, src.c_str(), gi ? "TG ": "", dmrData.getDstId(), m_netFrames);
LogMessage("DMR Slot %u, received network data header from %s to %s%s, %u blocks", m_slotNo, src.c_str(), gi ? "TG ": "", dst.c_str(), m_netFrames);
} else if (dataType == DT_VOICE_SYNC) {
if (m_netState == RS_NET_IDLE) {
m_netLC = new CDMRLC(dmrData.getFLCO(), dmrData.getSrcId(), dmrData.getDstId());
Expand All @@ -882,10 +887,11 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
setShortLC(m_slotNo, m_netLC->getDstId(), m_netLC->getFLCO(), true);

std::string src = m_lookup->find(m_netLC->getSrcId());
std::string dst = m_lookup->find(m_netLC->getDstId());

m_display->writeDMR(m_slotNo, src.c_str(), m_netLC->getFLCO() == FLCO_GROUP, m_netLC->getDstId(), "N");
m_display->writeDMR(m_slotNo, src.c_str(), m_netLC->getFLCO() == FLCO_GROUP, dst.c_str(), "N");

LogMessage("DMR Slot %u, received network late entry from %s to %s%u", m_slotNo, src.c_str(), m_netLC->getFLCO() == FLCO_GROUP ? "TG " : "", m_netLC->getDstId());
LogMessage("DMR Slot %u, received network late entry from %s to %s%s", m_slotNo, src.c_str(), m_netLC->getFLCO() == FLCO_GROUP ? "TG " : "", dst.c_str());
}

if (m_netState == RS_NET_AUDIO) {
Expand Down
2 changes: 1 addition & 1 deletion Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class IDisplay
virtual void writeDStar(const char* my1, const char* my2, const char* your, const char* type) = 0;
virtual void clearDStar() = 0;

virtual void writeDMR(unsigned int slotNo, const char* src, bool group, unsigned int dstId, const char* type) = 0;
virtual void writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, const char* type) = 0;
virtual void clearDMR(unsigned int slotNo) = 0;

virtual void writeFusion(const char* source, const char* dest) = 0;
Expand Down
2 changes: 1 addition & 1 deletion HD44780.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void CHD44780::clearDStar()
}
}

void CHD44780::writeDMR(unsigned int slotNo, const char* src, bool group, unsigned int dstId, const char* type)
void CHD44780::writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, const char* type)
{
assert(src != NULL);
assert(type != NULL);
Expand Down
2 changes: 1 addition & 1 deletion HD44780.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CHD44780 : public IDisplay
virtual void writeDStar(const char* my1, const char* my2, const char* your, const char* type);
virtual void clearDStar();

virtual void writeDMR(unsigned int slotNo, const char* src, bool group, unsigned int dstId, const char* type);
virtual void writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, const char* type);
virtual void clearDMR(unsigned int slotNo);

virtual void writeFusion(const char* source, const char* dest);
Expand Down
6 changes: 3 additions & 3 deletions Nextion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void CNextion::clearDStar()
sendCommand("t1.txt=\"\"");
}

void CNextion::writeDMR(unsigned int slotNo, const char* src, bool group, unsigned int dstId, const char* type)
void CNextion::writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, const char* type)
{
assert(src != NULL);
assert(type != NULL);
Expand All @@ -139,15 +139,15 @@ void CNextion::writeDMR(unsigned int slotNo, const char* src, bool group, unsign
::sprintf(text, "t0.txt=\"1 %s %s\"", type, src);
sendCommand(text);

::sprintf(text, "t1.txt=\"%s%u\"", group ? "TG" : "", dstId);
::sprintf(text, "t1.txt=\"%s%s\"", group ? "TG" : "", dst);
sendCommand(text);
} else {
char text[30U];

::sprintf(text, "t2.txt=\"2 %s %s\"", type, src);
sendCommand(text);

::sprintf(text, "t3.txt=\"%s%u\"", group ? "TG" : "", dstId);
::sprintf(text, "t3.txt=\"%s%s\"", group ? "TG" : "", dst);
sendCommand(text);
}

Expand Down
2 changes: 1 addition & 1 deletion Nextion.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CNextion : public IDisplay
virtual void writeDStar(const char* my1, const char* my2, const char* your, const char* type);
virtual void clearDStar();

virtual void writeDMR(unsigned int slotNo, const char* src, bool group, unsigned int dstId, const char* type);
virtual void writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, const char* type);
virtual void clearDMR(unsigned int slotNo);

virtual void writeFusion(const char* source, const char* dest);
Expand Down
2 changes: 1 addition & 1 deletion NullDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void CNullDisplay::clearDStar()
{
}

void CNullDisplay::writeDMR(unsigned int slotNo, const char* src, bool group, unsigned int dstId, const char* type)
void CNullDisplay::writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, 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 @@ -39,7 +39,7 @@ class CNullDisplay : public IDisplay
virtual void writeDStar(const char* my1, const char* my2, const char* your, const char* type);
virtual void clearDStar();

virtual void writeDMR(unsigned int slotNo, const char* src, bool group, unsigned int dstId, const char* type);
virtual void writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, const char* type);
virtual void clearDMR(unsigned int slotNo);

virtual void writeFusion(const char* source, const char* dest);
Expand Down
6 changes: 3 additions & 3 deletions TFTSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void CTFTSerial::clearDStar()
displayText(" ");
}

void CTFTSerial::writeDMR(unsigned int slotNo, const char* src, bool group, unsigned int dstId, const char* type)
void CTFTSerial::writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, const char* type)
{
assert(src != NULL);
assert(type != NULL);
Expand Down Expand Up @@ -212,7 +212,7 @@ void CTFTSerial::writeDMR(unsigned int slotNo, const char* src, bool group, unsi
gotoPosPixel(5U, 55U);
displayText(text);

::sprintf(text, "%s%u", group ? "TG" : "", dstId);
::sprintf(text, "%s%s", group ? "TG" : "", dst);
gotoPosPixel(65U, 72U);
displayText(text);
} else {
Expand All @@ -222,7 +222,7 @@ void CTFTSerial::writeDMR(unsigned int slotNo, const char* src, bool group, unsi
gotoPosPixel(5U, 90U);
displayText(text);

::sprintf(text, "%s%u", group ? "TG" : "", dstId);
::sprintf(text, "%s%s", group ? "TG" : "", dst);
gotoPosPixel(65U, 107U);
displayText(text);
}
Expand Down
2 changes: 1 addition & 1 deletion TFTSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CTFTSerial : public IDisplay
virtual void writeDStar(const char* my1, const char* my2, const char* your, const char* type);
virtual void clearDStar();

virtual void writeDMR(unsigned int slotNo, const char* src, bool group, unsigned int dstId, const char* type);
virtual void writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, const char* type);
virtual void clearDMR(unsigned int slotNo);

virtual void writeFusion(const char* source, const char* dest);
Expand Down

0 comments on commit a853a8c

Please sign in to comment.