mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 23:45:49 +08:00
Convert POCSAG text to be multi-line.
This commit is contained in:
16
Nextion.cpp
16
Nextion.cpp
@@ -694,7 +694,21 @@ void CNextion::writePOCSAGInt(uint32_t ric, const std::string& message)
|
||||
sendCommand(text);
|
||||
sendCommandAction(132U);
|
||||
|
||||
::sprintf(text, "t1.txt=\"MSG: %s\"", message.c_str());
|
||||
// Convert the text to multi-line with \r characters between.
|
||||
std::string display;
|
||||
unsigned int n = 0U;
|
||||
for (std::string::const_iterator it = message.cbegin(); it != message.cend(); ++it) {
|
||||
char c = *it;
|
||||
display.push_back(c);
|
||||
n++;
|
||||
|
||||
if (n == 16U) {
|
||||
display.push_back('\r');
|
||||
n = 0U;
|
||||
}
|
||||
}
|
||||
|
||||
::sprintf(text, "t1.txt=\"%s\"", display.c_str());
|
||||
sendCommand(text);
|
||||
sendCommandAction(133U);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user