Convert POCSAG text to be multi-line.

This commit is contained in:
Jonathan Naylor 2018-06-12 19:23:38 +01:00
parent 84dd3bf887
commit a084e14fdf
1 changed files with 15 additions and 1 deletions

View File

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