Skip to content
Snippets Groups Projects
Commit c8c586fd authored by Kyrre Ness Sjobaek's avatar Kyrre Ness Sjobaek
Browse files

TXTserver: Send a leading '+' for positive numbers, ensuring that all numbers stay the same length.

parent c8cc7ec7
No related branches found
No related tags found
1 merge request!1Fixes output formatting and variable initialization, moving config to separate file, project folder correctly named, hopefully fixes network crashes
......@@ -557,6 +557,10 @@ void TXTserver (uint8_t ch) {
//clients[i].println(ch);
//Feed the new client some data right away
if(measData[ch] >= 0) {
//Add the '+' so that the string is always the same length
clients[i].print('+');
}
clients[i].print(measData[ch],3);
if (measDataIsValid[ch]) {
if (measDataIsMm[ch]) {
......@@ -595,6 +599,10 @@ void TXTserver (uint8_t ch) {
if (measDataFresh[ch]) {
for (byte i = 0; i < MAX_SOCK_NUM; i++) {
if (clients[i] && (clients_ch[i]==ch)) {
if(measData[ch] >= 0) {
//Add the '+' so that the string is always the same length
clients[i].print('+');
}
clients[i].print(measData[ch],3);
if (measDataIsValid[ch]) {
if (measDataIsMm[ch]) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment