static void http_capture_timer_handler(AppContextRef app_ctx, AppTimerHandle handle, uint32_t cookie) { if (cookie == http_capture_COOKIE_send) { http_capture_send_buffer(); } else if (cookie == http_capture_COOKIE_start) { http_capture_make_framebuffer_copy(); http_capture_send_buffer(); } else if (http_capture_timer_next_handler) { http_capture_timer_next_handler(app_ctx, handle, cookie); } }
void http_capture_send(int wait) { if (http_capture_sending) return; if (wait) { http_capture_sending = true; app_timer_send_event(http_capture_app_context_ref, wait, http_capture_COOKIE_start); } else { http_capture_make_framebuffer_copy(); http_capture_sending = true; app_timer_send_event(http_capture_app_context_ref, 10, http_capture_COOKIE_send); } }