Skip to content

Instantly share code, notes, and snippets.

@arihantdaga
Created January 23, 2019 06:15
Show Gist options
  • Save arihantdaga/0ecc7cb9f1aedb47d6041202ec5fce6d to your computer and use it in GitHub Desktop.
Save arihantdaga/0ecc7cb9f1aedb47d6041202ec5fce6d to your computer and use it in GitHub Desktop.
bool checkUnreadMessage(bool changeStatusToRead = true, SMSARRAY {Takes a pointer to array of SMS structs} , uint8_t skip = 0,uint8_t limit = 10 ){
sendAT(GF("+CMGL=\"REC UNREAD\","), static_cast<const uint8_t>(!changeStatusToRead));
if (waitResponse(5000L, GF(GSM_NL "+CMGL: \"")) != 1) {
stream.readString();
return {};
}
// read Messages from this
use skip and limit to control what messages to be filled in the sms pointer
// SMSARRAY.push(SMS)
// return waitResponse() == 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment