I'm working with a project I found that processes and displays data in a terminal.
Instead of displaying the output I need it to be sent as SMS over a SIM800L module.
Below is the section of code that references the information I want to be sent over SMS. It is meant to be displayed in a terminal program made by the developer.
debug("**Value#1**: "); *//This is information I need*
while(buff[--i] != FieldSeparator) {
USART_tx(buff[i]);
}
debug("\r");
debug("**Value#2:** "); *//This is information I need*
while(buff[--i] != FieldSeparator) {
USART_tx(buff[i]);
}
debug("\r");
cbuff[0] = buff[--i]; cbuff[1] = buff[--i]; cbuff[2] = buff[--i]; cbuff[3] = buff[--i]; cbuff[4] = '\0';
debug("**Value#3:** "); *//This is information I need*
debug(cbuff); debug("\r");
cbuff[0] = buff[--i]; cbuff[1] = buff[--i]; cbuff[2] = buff[--i]; cbuff[3] = '\0';
debug("**Value#4:** "); *//This is information I need*
debug(cbuff); debug("\r");
debug("**Value#5:** "); *//This is information I need*
cbuff[0] = buff[--i]; cbuff[1] = buff[--i]; cbuff[2] = buff[--i]; cbuff[3] = buff[--i]; cbuff[4] = '\0';
debug(cbuff); debug("\r");
debug("**Value#6:** "); *//This is information I need*
while(buff[i] != FieldSeparator && buff[i] != StopSentinel) {
USART_tx(buff[i]);
--i;
}
debug("\r");
}
else { // Process other formats here
}
}
In the terminal program, the processed data is shown after the colon.
"Value#1 : xxxxx"
I need all data values #1-#6. Preferably in the same text message but separate will not be a problem.
Where should I start? This is one of my first Arduino projects so I'm still clueless.
Okay I understand it a bit better now. So, I'll just send everything in the buffer as an SMS and manually separate it.
How could I reference this specific buffer in the serial monitor?
well the data is stored in reverse order, so it requires to be read from the end to be "readable" apparently
They all seem to be cStrings, so just create 6 buffers large enough to accommodate the text and copy the relevant bits into each buffer and add the trailing null
that's what they do with this for example