Skip to content

Commit

Permalink
Commit of old fixes pre-esp POC
Browse files Browse the repository at this point in the history
- Need to read all chars of incoming SMS to be able to delete it.
- no longer send a message when receiving unknown message
  • Loading branch information
reivaxy committed Jul 13, 2018
1 parent 7c63005 commit b67c967
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions aquaMonitor.ino
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
void loop() __attribute__((__optimize__("O2")));

#include <OneWire.h>
#include <GSM.h>
Expand Down Expand Up @@ -464,12 +465,16 @@ void checkSMS() {
sms.flush();
} else {
// Read message bytes
while ((c = sms.read()) && (cptr < MAX_SMS_LENGTH)) {
while (c = sms.read()) {
// If uppercase, convert to lowercase
if ((c > 64) && (c < 91)) {
c = c + 32;
}
msgIn[cptr++] = c;
// To be able to delete a SMS, all characters must be read
// But only keep the max handled count
if (cptr < MAX_SMS_LENGTH) {
msgIn[cptr++] = c;
}
}
msgIn[cptr] = 0;
// Delete message from modem memory
Expand Down Expand Up @@ -528,7 +533,9 @@ void processMessage(char *msgIn, char *from) {
setTime(from, msgIn);
} else {
displayTransient(getProgMemMsg(UNKNOWN_MSG));
sendSMS(from, getProgMemMsg(UNKNOWN_MSG));
// Some stupid spam services send back a message each time
// you answer them, so, do not send unknown message :(
// sendSMS(from, getProgMemMsg(UNKNOWN_MSG));
}
}

Expand Down Expand Up @@ -1034,7 +1041,7 @@ void resetConfig(char *toNumber) {
// In charge of displaying messages
void refreshDisplay() {
char message[100];
char scrolledMessage[100];
char scrolledMessage[200];
char transferChar;
int remaining;
unsigned long now = millis();
Expand Down

0 comments on commit b67c967

Please sign in to comment.