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
10 changed files with 34 additions and 34 deletions

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);
}