/****************************************************************************** * FunctionName : upgrade_deinit * Description : * Parameters : * Returns : none *******************************************************************************/ void LOCAL upgrade_deinit(void) { if (system_upgrade_flag_check() != UPGRADE_FLAG_START) { system_upgrade_deinit(); //system_upgrade_reboot(); } }
/****************************************************************************** * FunctionName : upgrade_deinit * Description : disconnect the connection with the host * Parameters : bin -- server number * Returns : none *******************************************************************************/ void ICACHE_FLASH_ATTR LOCAL upgrade_deinit(void) { if (system_upgrade_flag_check() != UPGRADE_FLAG_START) { system_upgrade_deinit(); } }
/****************************************************************************** * FunctionName : upgrade_10s_cb * Description : Processing the client when connected with host time out * Parameters : pespconn -- A point to the host * Returns : none *******************************************************************************/ LOCAL void ICACHE_FLASH_ATTR upgrade_10s_cb(struct espconn *pespconn) { if (pespconn == NULL) { return; } system_upgrade_deinit(); os_free(pespconn->proto.tcp); pespconn->proto.tcp = NULL; os_free(pespconn); pespconn = NULL; }
//连接服务器超时回调 LOCAL void ICACHE_FLASH_ATTR upgrade_connect_timeout_cb(struct espconn *pespconn){ struct upgrade_server_info *server; if (pespconn == NULL) { return; } server = pespconn->reverse; os_timer_disarm(&upgrade_timer); system_upgrade_flag_set(UPGRADE_FLAG_IDLE); server->upgrade_flag = false; if (server->check_cb != NULL) { server->check_cb(server); } system_upgrade_deinit(); os_free(pespconn->proto.tcp); pespconn->proto.tcp = NULL; os_free(pespconn); pespconn = NULL; upgrade_conn = NULL; }