| 205 | } |
| 206 | |
| 207 | bool Everything::sendSmartString(String &str) |
| 208 | { |
| 209 | while(str.length()>1 && str[0]=='|') //get rid of leading pipes (messes up sendStrings()'s parsing technique) |
| 210 | { |
| 211 | str=str.substring(1); |
| 212 | } |
| 213 | if((str.length()==1 && str[0]=='|') || str.length()==0) |
| 214 | { |
| 215 | return false; |
| 216 | } |
| 217 | |
| 218 | if(Return_String.length()+str.length()>=Constants::RETURN_STRING_RESERVE) |
| 219 | { |
| 220 | if (debug) |
| 221 | { |
| 222 | Serial.print(F("Everything: ERROR: \"")); |
| 223 | Serial.print(str); |
| 224 | Serial.println(F("\" would overflow the Return_String 'buffer'")); |
| 225 | } |
| 226 | return false; |
| 227 | } |
| 228 | else |
| 229 | { |
| 230 | Return_String+=str+"|"; //add the new message to the queue to be sent to ST Shield with a "|" delimiter |
| 231 | return true; |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | bool Everything::sendSmartStringNow(String &str) |
| 236 | { |