void received_data(DictionaryIterator *received, void *context) { uint8_t packetId = dict_find(received, 0)->value->uint8; if (packetId == 3) { received_config(received); return; } else if (!gotConfig) return; if ((packetId == 0 || packetId == 4) && curWindow > 1) { switchWindow(1); } switch (curWindow) { case 0: menu_data_received(packetId, received); break; case 1: notification_received_data(packetId, received); break; case 2: list_data_received(packetId, received); break; } app_comm_set_sniff_interval(SNIFF_INTERVAL_REDUCED); }
static void received_data(DictionaryIterator *received, void *context) { app_comm_set_sniff_interval(SNIFF_INTERVAL_REDUCED); uint8_t destModule = dict_find(received, 0)->value->uint8; uint8_t packetId = dict_find(received, 1)->value->uint8; bool autoSwitch = dict_find(received, 999) != NULL; if (destModule == 0 && packetId == 0) { received_config(received); return; } if (!gotConfig) //Do not react to anything until we got config return; if (destModule == 2) { if (curWindow != 2) { if (autoSwitch) switchWindow(2); else return; } list_window_data_received(packetId, received); } else { if (curWindow != 1) { if (autoSwitch) switchWindow(1); else return; } nw_received_data_callback(destModule, packetId, received); } }
static void received_data(DictionaryIterator *received, void *context) { app_comm_set_sniff_interval(SNIFF_INTERVAL_REDUCED); uint8_t destModule = dict_find(received, 0)->value->uint8; uint8_t packetId = dict_find(received, 1)->value->uint8; bool autoSwitch = dict_find(received, 999) != NULL; if (destModule == 0 && packetId == 0) { received_config(received); return; } if (!gotConfig) //Do not react to anything until we got config return; if (destModule == 0) { if (packetId == 1) { closingMode = true; window_stack_pop_all(false); switchWindow(0); return; } if (curWindow != 0) { if (autoSwitch) switchWindow(0); else return; } main_menu_data_received(packetId, received); } else if (destModule == 1) { if (curWindow != 1) { if (autoSwitch) switchWindow(1); else return; } call_window_data_received(destModule, packetId, received); } else if (destModule == 2) { if (curWindow != 2) { if (autoSwitch) switchWindow(2); else return; } call_log_window_data_received(packetId, received); } else if (destModule == 3) { if (curWindow != 3) { if (autoSwitch) switchWindow(3); else return; } contacts_window_data_received(packetId, received); } else if (destModule == 4) { if (curWindow != 4) { if (autoSwitch) switchWindow(4); else return; } number_picker_window_data_received(packetId, received); } else if (destModule == 5) { actions_menu_got_data(packetId, received); } }