mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 15:09:23 +08:00
Change variable types for strings used in writeDMR
This commit is contained in:
14
Nextion.cpp
14
Nextion.cpp
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user