int main(void) { appmessage_max_size = app_message_inbox_size_maximum(); if (appmessage_max_size > 4096) appmessage_max_size = 4096; //Limit inbox size to conserve RAM. #ifdef PBL_PLATFORM_APLITE //Aplite has so little memory, we can't squeeze much more than that out of appmessage buffer. appmessage_max_size = 124; #endif app_message_register_inbox_received(received_data); app_message_register_outbox_sent(sent_data); app_message_open(appmessage_max_size, 408); loadingMode = true; send_initial_packet(); app_timer_register(3000, loading_retry_timer, NULL); switchWindow(0); app_event_loop(); window_stack_pop_all(false); free(config_periodicVibrationPattern); AppLaunchReason appLaunchReason = launch_reason(); if (appLaunchReason == APP_LAUNCH_PHONE && !config_dontClose) { // If app was launched by phone and close to last app is disabled, always exit to the watchface instead of to the menu exit_reason_set(APP_EXIT_ACTION_PERFORMED_SUCCESSFULLY); } return 0; }
void success_auto_close(void* context) { exit_reason_set(APP_EXIT_ACTION_PERFORMED_SUCCESSFULLY); window_stack_pop_all(true); }