Change variable types for strings used in writeDMR

This commit is contained in:
phl0 2016-04-21 14:01:53 +02:00
parent ba63f7fb19
commit 23738d97f6
No known key found for this signature in database
GPG Key ID: 48EA1E640798CA9A
10 changed files with 34 additions and 34 deletions

View File

@ -178,7 +178,7 @@ void CDMRSlot::writeModem(unsigned char *data)
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, dst.c_str(), "R");
m_display->writeDMR(m_slotNo, src, m_rfLC->getFLCO() == FLCO_GROUP, dst, "R");
}
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());
@ -288,7 +288,7 @@ void CDMRSlot::writeModem(unsigned char *data)
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, dst.c_str(), "R");
m_display->writeDMR(m_slotNo, src, gi, dst, "R");
}
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);
@ -550,7 +550,7 @@ void CDMRSlot::writeModem(unsigned char *data)
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, dst.c_str(), "R");
m_display->writeDMR(m_slotNo, src, m_rfLC->getFLCO() == FLCO_GROUP, dst, "R");
}
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());

View File

@ -36,7 +36,7 @@ public:
virtual void writeDStar(const char* my1, const char* my2, const char* your, const char* type, const char* reflector) = 0;
virtual void clearDStar() = 0;
virtual void writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, const char* type) = 0;
virtual void writeDMR(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type) = 0;
virtual void clearDMR(unsigned int slotNo) = 0;
virtual void writeFusion(const char* source, const char* dest) = 0;

View File

@ -210,10 +210,10 @@ void CHD44780::clearDStar()
}
}
void CHD44780::writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, const char* type)
void CHD44780::writeDMR(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type)
{
assert(src != NULL);
assert(dst != NULL);
assert(src.c_str() != NULL);
assert(dst.c_str() != NULL);
assert(type != NULL);
if (!m_dmr) {
@ -262,44 +262,44 @@ void CHD44780::writeDMR(unsigned int slotNo, const char* src, bool group, const
if (m_rows == 2U && m_cols == 16U) {
char buffer[16U];
if (slotNo == 1U) {
::sprintf(buffer, "%s > %s%s", src, group ? "TG" : "", dst);
::sprintf(buffer, "%s > %s%s", src.c_str(), group ? "TG" : "", dst.c_str());
::lcdPosition(m_fd, 0, 0);
::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, buffer);
} else {
::sprintf(buffer, "%s > %s%s", src, group ? "TG" : "", dst);
::sprintf(buffer, "%s > %s%s", src.c_str(), group ? "TG" : "", dst.c_str());
::lcdPosition(m_fd, 0, 1);
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, buffer);
}
} else if (m_rows == 4U && m_cols == 16U) {
char buffer[16U];
if (slotNo == 1U) {
::sprintf(buffer, "%s %s > %s%s", type, src, group ? "TG" : "", dst);
::sprintf(buffer, "%s %s > %s%s", type, src.c_str(), group ? "TG" : "", dst.c_str());
::lcdPosition(m_fd, 0, 1);
::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, buffer);
} else {
::sprintf(buffer, "%s %s > %s%s", type, src, group ? "TG" : "", dst);
::sprintf(buffer, "%s %s > %s%s", type, src.c_str(), group ? "TG" : "", dst.c_str());
::lcdPosition(m_fd, 0, 2);
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, buffer);
}
} else if (m_rows == 4U && m_cols == 20U) {
char buffer[20U];
if (slotNo == 1U) {
::sprintf(buffer, "%s %s > %s%s", type, src, group ? "TG" : "", dst);
::sprintf(buffer, "%s %s > %s%s", type, src.c_str(), group ? "TG" : "", dst.c_str());
::lcdPosition(m_fd, 0, 1);
::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, buffer);
} else {
::sprintf(buffer, "%s %s > %s%s", type, src, group ? "TG" : "", dst);
::sprintf(buffer, "%s %s > %s%s", type, src.c_str(), group ? "TG" : "", dst.c_str());
::lcdPosition(m_fd, 0, 2);
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, buffer);
}
} else if (m_rows == 2U && m_cols == 40U) {
char buffer[40U];
if (slotNo == 1U) {
::sprintf(buffer, "%s %s > %s%s", type, src, group ? "TG" : "", dst);
::sprintf(buffer, "%s %s > %s%s", type, src.c_str(), group ? "TG" : "", dst.c_str());
::lcdPosition(m_fd, 0, 0);
::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, buffer);
} else {
::sprintf(buffer, "%s %s > %s%s", type, src, group ? "TG" : "", dst);
::sprintf(buffer, "%s %s > %s%s", type, src.c_str(), group ? "TG" : "", dst.c_str());
::lcdPosition(m_fd, 0, 1);
::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, buffer);
}

View File

@ -50,7 +50,7 @@ public:
virtual void writeDStar(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
virtual void clearDStar();
virtual void writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, const char* type);
virtual void writeDMR(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type);
virtual void clearDMR(unsigned int slotNo);
virtual void writeFusion(const char* source, const char* dest);

View File

@ -125,10 +125,10 @@ void CNextion::clearDStar()
sendCommand("t1.txt=\"\"");
}
void CNextion::writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, const char* type)
void CNextion::writeDMR(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type)
{
assert(src != NULL);
assert(dst != NULL);
assert(src.c_str() != NULL);
assert(dst.c_str() != NULL);
assert(type != NULL);
if (m_mode != MODE_DMR) {
@ -143,18 +143,18 @@ void CNextion::writeDMR(unsigned int slotNo, const char* src, bool group, const
if (slotNo == 1U) {
char text[30U];
::sprintf(text, "t0.txt=\"1 %s %s\"", type, src);
::sprintf(text, "t0.txt=\"1 %s %s\"", type, src.c_str());
sendCommand(text);
::sprintf(text, "t1.txt=\"%s%s\"", group ? "TG" : "", dst);
::sprintf(text, "t1.txt=\"%s%s\"", group ? "TG" : "", dst.c_str());
sendCommand(text);
} else {
char text[30U];
::sprintf(text, "t2.txt=\"2 %s %s\"", type, src);
::sprintf(text, "t2.txt=\"2 %s %s\"", type, src.c_str());
sendCommand(text);
::sprintf(text, "t3.txt=\"%s%s\"", group ? "TG" : "", dst);
::sprintf(text, "t3.txt=\"%s%s\"", group ? "TG" : "", dst.c_str());
sendCommand(text);
}

View File

@ -41,7 +41,7 @@ public:
virtual void writeDStar(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
virtual void clearDStar();
virtual void writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, const char* type);
virtual void writeDMR(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type);
virtual void clearDMR(unsigned int slotNo);
virtual void writeFusion(const char* source, const char* dest);

View File

@ -51,7 +51,7 @@ void CNullDisplay::clearDStar()
{
}
void CNullDisplay::writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, const char* type)
void CNullDisplay::writeDMR(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type)
{
}

View File

@ -39,7 +39,7 @@ public:
virtual void writeDStar(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
virtual void clearDStar();
virtual void writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, const char* type);
virtual void writeDMR(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type);
virtual void clearDMR(unsigned int slotNo);
virtual void writeFusion(const char* source, const char* dest);

View File

@ -188,10 +188,10 @@ void CTFTSerial::clearDStar()
displayText(" ");
}
void CTFTSerial::writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, const char* type)
void CTFTSerial::writeDMR(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type)
{
assert(src != NULL);
assert(dst != NULL);
assert(src.c_str() != NULL);
assert(dst.c_str() != NULL);
assert(type != NULL);
if (m_mode != MODE_DMR) {
@ -215,21 +215,21 @@ void CTFTSerial::writeDMR(unsigned int slotNo, const char* src, bool group, cons
if (slotNo == 1U) {
char text[30U];
::sprintf(text, "1 %s %s", type, src);
::sprintf(text, "1 %s %s", type, src.c_str());
gotoPosPixel(5U, 55U);
displayText(text);
::sprintf(text, "%s%s", group ? "TG" : "", dst);
::sprintf(text, "%s%s", group ? "TG" : "", dst.c_str());
gotoPosPixel(65U, 72U);
displayText(text);
} else {
char text[30U];
::sprintf(text, "2 %s %s", type, src);
::sprintf(text, "2 %s %s", type, src.c_str());
gotoPosPixel(5U, 90U);
displayText(text);
::sprintf(text, "%s%s", group ? "TG" : "", dst);
::sprintf(text, "%s%s", group ? "TG" : "", dst.c_str());
gotoPosPixel(65U, 107U);
displayText(text);
}

View File

@ -41,7 +41,7 @@ public:
virtual void writeDStar(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
virtual void clearDStar();
virtual void writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, const char* type);
virtual void writeDMR(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type);
virtual void clearDMR(unsigned int slotNo);
virtual void writeFusion(const char* source, const char* dest);