91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 9.59MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-08-22
  • 語(yǔ)言: 其他
  • 標(biāo)簽:

資源簡(jiǎn)介

EPS8266在線升級(jí)例程,OTA例程。

資源截圖

代碼片段和文件信息

/*
?*?ESPRESSIF?MIT?License
?*
?*?Copyright?(c)?2016?
?*
?*?Permission?is?hereby?granted?for?use?on?ESPRESSIF?SYSTEMS?ESP8266?only?in?which?case
?*?it?is?free?of?charge?to?any?person?obtaining?a?copy?of?this?software?and?associated
?*?documentation?files?(the?“Software“)?to?deal?in?the?Software?without?restriction?including
?*?without?limitation?the?rights?to?use?copy?modify?merge?publish?distribute?sublicense
?*?and/or?sell?copies?of?the?Software?and?to?permit?persons?to?whom?the?Software?is?furnished
?*?to?do?so?subject?to?the?following?conditions:
?*
?*?The?above?copyright?notice?and?this?permission?notice?shall?be?included?in?all?copies?or
?*?substantial?portions?of?the?Software.
?*
?*?THE?SOFTWARE?IS?PROVIDED?“AS?IS“?WITHOUT?WARRANTY?OF?ANY?KIND?EXPRESS?OR
?*?IMPLIED?INCLUDING?BUT?NOT?LIMITED?TO?THE?WARRANTIES?OF?MERCHANTABILITY?FITNESS
?*?FOR?A?PARTICULAR?PURPOSE?AND?NONINFRINGEMENT.?IN?NO?EVENT?SHALL?THE?AUTHORS?OR
?*?COPYRIGHT?HOLDERS?BE?LIABLE?FOR?ANY?CLAIM?DAMAGES?OR?OTHER?LIABILITY?WHETHER
?*?IN?AN?ACTION?OF?CONTRACT?TORT?OR?OTHERWISE?ARISING?FROM?OUT?OF?OR?IN
?*?CONNECTION?WITH?THE?SOFTWARE?OR?THE?USE?OR?OTHER?DEALINGS?IN?THE?SOFTWARE.
?*
?*/

#include?“ets_sys.h“
#include?“osapi.h“
#include?“ip_addr.h“
#include?“espconn.h“
#include?“mem.h“
#include?“user_interface.h“
#include?“smartconfig.h“
#include?“airkiss.h“
#include?“c_types.h“
#include?“upgrade.h“

#define?fileBinPath??“xuhong/8266NewBin/“

LOCAL?esp_udp?ssdp_udp;
LOCAL?struct?espconn?pssdpudpconn;
LOCAL?os_timer_t?ssdp_time_serv;


void?ICACHE_FLASH_ATTR?ota_finished_callback(void?*arg)
{
struct?upgrade_server_info?*update?=?arg;
if?(update->upgrade_flag?==?true){
os_printf(“OTA??Success?!?rebooting!\n“);
system_upgrade_reboot();
}else{
os_printf(“OTA?failed!\n“);
}

os_free(update->pespconn);
os_free(update->url);
os_free(update);
}

/**
?*?server_ip:?服務(wù)器地址
?*?port:服務(wù)器端口
?*?path:文件
?*/
void?ICACHE_FLASH_ATTR?ota_start_Upgrade(const?char?*server_ip?uint16_t?portconst?char?*path)?{
const?char*?file;
//獲取系統(tǒng)的目前加載的是哪個(gè)bin文件
uint8_t?userBin?=?system_upgrade_userbin_check();

switch?(userBin)?{

//如果檢查當(dāng)前的是處于user1的加載文件,那么拉取的就是user2.bin
case?UPGRADE_FW_BIN1:
file?=?“user2.4096.new.6.bin“;
break;

//如果檢查當(dāng)前的是處于user2的加載文件,那么拉取的就是user1.bin
case?UPGRADE_FW_BIN2:
file?=?“user1.4096.new.6.bin“;
break;

//如果檢查都不是,可能此刻不是OTA的bin固件
default:
os_printf(“Fail?read?system_upgrade_userbin_check!?\n\n“);
return;
}

struct?upgrade_server_info*?update?=
(struct?upgrade_server_info?*)?os_zalloc(
sizeof(struct?upgrade_server_info));
update->pespconn?=?(struct?espconn?*)?os_zalloc(sizeof(struct?espconn));
//設(shè)置服務(wù)器地址
os_memcpy(update->ip?server_ip?4);
//設(shè)置服務(wù)器端口
update->port?=?port;
//設(shè)置OTA回調(diào)函數(shù)
update->check_cb?=?ota_finished_callback;
//設(shè)置定時(shí)回調(diào)時(shí)間
update->check_times?=?10000;
//從?4M?*1024?=4096申請(qǐng)內(nèi)存
update->url?=?(uint8?*)os_zalloc(4096);

//打印下請(qǐng)求地址
os_printf(“Http?Server?Address:%d.%d.%d.

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-04-26?12:06??19_Esp8266_OTA_NONOS\
?????文件????????3719??2018-04-26?12:06??19_Esp8266_OTA_NONOS\.cproject
?????文件?????????798??2018-04-26?12:06??19_Esp8266_OTA_NONOS\.project
?????目錄???????????0??2018-04-26?12:06??19_Esp8266_OTA_NONOS\.settings\
?????目錄???????????0??2018-04-27?11:38??19_Esp8266_OTA_NONOS\app\
?????目錄???????????0??2018-04-26?12:06??19_Esp8266_OTA_NONOS\app\.output\
?????目錄???????????0??2018-04-27?11:38??19_Esp8266_OTA_NONOS\app\.output\eagle\
?????目錄???????????0??2018-04-27?11:38??19_Esp8266_OTA_NONOS\app\.output\eagle\debug\
?????目錄???????????0??2018-04-27?11:38??19_Esp8266_OTA_NONOS\app\.output\eagle\debug\bin\
?????目錄???????????0??2018-04-27?11:38??19_Esp8266_OTA_NONOS\app\.output\eagle\debug\image\
?????文件??????337118??2018-04-27?11:38??19_Esp8266_OTA_NONOS\app\.output\eagle\debug\image\eagle.app.v6.out
?????文件????????3080??2018-02-06?04:45??19_Esp8266_OTA_NONOS\app\gen_misc.bat
?????文件????????3788??2018-02-06?04:45??19_Esp8266_OTA_NONOS\app\gen_misc.sh
?????目錄???????????0??2018-04-26?12:04??19_Esp8266_OTA_NONOS\app\include\
?????文件????????1296??2018-02-06?04:45??19_Esp8266_OTA_NONOS\app\include\user_config.h
?????文件????????2814??2018-02-06?04:45??19_Esp8266_OTA_NONOS\app\Makefile
?????目錄???????????0??2018-04-26?14:41??19_Esp8266_OTA_NONOS\app\user\
?????目錄???????????0??2018-04-26?12:06??19_Esp8266_OTA_NONOS\app\user\.output\
?????目錄???????????0??2018-04-27?11:38??19_Esp8266_OTA_NONOS\app\user\.output\eagle\
?????目錄???????????0??2018-04-27?11:38??19_Esp8266_OTA_NONOS\app\user\.output\eagle\debug\
?????目錄???????????0??2018-04-27?11:38??19_Esp8266_OTA_NONOS\app\user\.output\eagle\debug\lib\
?????文件???????22956??2018-04-27?11:38??19_Esp8266_OTA_NONOS\app\user\.output\eagle\debug\lib\libuser.a
?????目錄???????????0??2018-04-27?11:38??19_Esp8266_OTA_NONOS\app\user\.output\eagle\debug\obj\
?????文件????????1317??2018-04-27?11:38??19_Esp8266_OTA_NONOS\app\user\.output\eagle\debug\obj\user_main.d
?????文件???????22692??2018-04-27?11:38??19_Esp8266_OTA_NONOS\app\user\.output\eagle\debug\obj\user_main.o
?????文件????????1477??2018-02-06?04:45??19_Esp8266_OTA_NONOS\app\user\Makefile
?????文件????????7560??2018-04-27?11:37??19_Esp8266_OTA_NONOS\app\user\user_main.c
?????目錄???????????0??2018-04-26?14:49??19_Esp8266_OTA_NONOS\bin\
?????目錄???????????0??2018-02-06?04:45??19_Esp8266_OTA_NONOS\bin\at\
?????目錄???????????0??2018-02-06?04:45??19_Esp8266_OTA_NONOS\bin\at\1024+1024\
?????文件??????407796??2018-02-06?04:45??19_Esp8266_OTA_NONOS\bin\at\1024+1024\user1.2048.new.5.bin
............此處省略112個(gè)文件信息

評(píng)論

共有 條評(píng)論

相關(guān)資源