QuickAlert/watchapp/src/quick_alert.c
// inbox received callback - reads and interprets info from companion
//    key 0 -> new timer length
//    key 1 -> new passcode
inbox received callback - reads and interprets info from companion
key 0 -> new timer length
key 1 -> new passcode
inbox received callback - reads and interprets info from companion key 0 - > new timer length key 1 - > new passcode
static void inbox_received_callback(DictionaryIterator *iterator, void *context) {
  Tuple *t = dict_read_first(iterator);
  while (t != NULL) {
    switch(t -> key) {
      case 0:
        s_timer_len = (t -> value -> uint8)*1000;
        persist_write_int(TIMERLEN_PERSIST_KEY, s_timer_len);
        break;
      case 1:
        snprintf(s_passcode, PASSCODE_LEN + 1, "%s", t -> value -> cstring);
        persist_write_string(PASSCODE_PERSIST_KEY, s_passcode);
        break;
    }
    t = dict_read_next(iterator);
  }
  APP_LOG(APP_LOG_LEVEL_INFO, "Message received!");
}
static void inbox_received_callback ( DictionaryIterator * iterator , void * context ) { Tuple * t = dict_read_first ( iterator ) ; while ( t != NULL ) { switch ( t -> key ) { case 0 : s_timer_len = ( t -> value -> uint8 ) * 1000 ; persist_write_int ( TIMERLEN_PERSIST_KEY , s_timer_len ) ; break ; case 1 : snprintf ( s_passcode , PASSCODE_LEN + 1 , " " , t -> value -> cstring ) ; persist_write_string ( PASSCODE_PERSIST_KEY , s_passcode ) ; break ; } t = dict_read_next ( iterator ) ; } APP_LOG ( APP_LOG_LEVEL_INFO , " " ) ; }
inbox received callback - reads and interprets info from companion
key 0 -> new timer length
key 1 -> new passcode
inbox received callback - reads and interprets info from companion key 0 - > new timer length key 1 - > new passcode