What to do in main loop while waiting for SMS?

I’m making a device that uses incoming SMS messages to update an e-paper display. I’ve used attachHandlerSMS and everything seems to be working, but now I’m curious about how best to save power while waiting for messages, which will be the majority of the time.

I’ve seen in the docs that sms events are polled each time the loop runs, I just don’t know if I need to wait for the handling to complete before putting the device into deepSleep again. The example code does a bunch of different things, sets alarms, etc… which I don’t think are applicable.

My guess for a main loop would be something like this (pollEvents probably not needed?)

void loop(void)
{ 
  while (!HologramCloud.isConnected()) {
    Dash.snooze(1000);
  }
  HologramCloud.pollEvents();
  HologramCloud.powerDown();
  Dash.deepSleepAtMostMin(15);
  HologramCloud.powerUp();
}

Also, and maybe not for this group, but is there some “max shelf life” for an SMS? That is, does the device need to retrieve it within a certain time frame or it is lost?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.