資源簡(jiǎn)介
Esp8266 百萬條消息免費(fèi)之樂鑫esp8266使用TCP直連模式MQTT協(xié)議接入阿里云物聯(lián)網(wǎng)平臺(tái),支持私家服務(wù)器對(duì)接,支持阿里云規(guī)則引擎。。 - CSDN博客 https://blog.csdn.net/xh870189248/article/details/83149619

代碼片段和文件信息
/*
/*?config.c
*
*?Copyright?(c)?2014-2015?Tuan?PM?
*?All?rights?reserved.
*
*?Redistribution?and?use?in?source?and?binary?forms?with?or?without
*?modification?are?permitted?provided?that?the?following?conditions?are?met:
*
*?*?Redistributions?of?source?code?must?retain?the?above?copyright?notice
*?this?list?of?conditions?and?the?following?disclaimer.
*?*?Redistributions?in?binary?form?must?reproduce?the?above?copyright
*?notice?this?list?of?conditions?and?the?following?disclaimer?in?the
*?documentation?and/or?other?materials?provided?with?the?distribution.
*?*?Neither?the?name?of?Redis?nor?the?names?of?its?contributors?may?be?used
*?to?endorse?or?promote?products?derived?from?this?software?without
*?specific?prior?written?permission.
*
*?THIS?SOFTWARE?IS?PROVIDED?BY?THE?COPYRIGHT?HOLDERS?AND?CONTRIBUTORS?“AS?IS“
*?AND?ANY?EXPRESS?OR?IMPLIED?WARRANTIES?INCLUDING?BUT?NOT?LIMITED?TO?THE
*?IMPLIED?WARRANTIES?OF?MERCHANTABILITY?AND?FITNESS?FOR?A?PARTICULAR?PURPOSE
*?ARE?DISCLAIMED.?IN?NO?EVENT?SHALL?THE?COPYRIGHT?OWNER?OR?CONTRIBUTORS?BE
*?LIABLE?FOR?ANY?DIRECT?INDIRECT?INCIDENTAL?SPECIAL?EXEMPLARY?OR
*?CONSEQUENTIAL?DAMAGES?(INCLUDING?BUT?NOT?LIMITED?TO?PROCUREMENT?OF
*?SUBSTITUTE?GOODS?OR?SERVICES;?LOSS?OF?USE?DATA?OR?PROFITS;?OR?BUSINESS
*?INTERRUPTION)?HOWEVER?CAUSED?AND?ON?ANY?THEORY?OF?LIABILITY?WHETHER?IN
*?CONTRACT?STRICT?LIABILITY?OR?TORT?(INCLUDING?NEGLIGENCE?OR?OTHERWISE)
*?ARISING?IN?ANY?WAY?OUT?OF?THE?USE?OF?THIS?SOFTWARE?EVEN?IF?ADVISED?OF?THE
*?POSSIBILITY?OF?SUCH?DAMAGE.
*/
#include?“ets_sys.h“
#include?“os_type.h“
#include?“mem.h“
#include?“osapi.h“
#include?“user_interface.h“
#include?“mqtt.h“
#include?“config.h“
#include?“user_config.h“
#include?“debug.h“
SYSCFG?sysCfg;
SAVE_FLAG?saveFlag;
void?ICACHE_FLASH_ATTR
CFG_Save()
{
spi_flash_read((CFG_LOCATION?+?3)?*?SPI_FLASH_SEC_SIZE
???(uint32?*)&saveFlag?sizeof(SAVE_FLAG));
if?(saveFlag.flag?==?0)
{
spi_flash_erase_sector(CFG_LOCATION?+?1);
spi_flash_write((CFG_LOCATION?+?1)?*?SPI_FLASH_SEC_SIZE
(uint32?*)&sysCfg?sizeof(SYSCFG));
saveFlag.flag?=?1;
spi_flash_erase_sector(CFG_LOCATION?+?3);
spi_flash_write((CFG_LOCATION?+?3)?*?SPI_FLASH_SEC_SIZE
(uint32?*)&saveFlag?sizeof(SAVE_FLAG));
}
else
{
spi_flash_erase_sector(CFG_LOCATION?+?0);
spi_flash_write((CFG_LOCATION?+?0)?*?SPI_FLASH_SEC_SIZE
(uint32?*)&sysCfg?sizeof(SYSCFG));
saveFlag.flag?=?0;
spi_flash_erase_sector(CFG_LOCATION?+?3);
spi_flash_write((CFG_LOCATION?+?3)?*?SPI_FLASH_SEC_SIZE
(uint32?*)&saveFlag?sizeof(SAVE_FLAG));
}
}
void?ICACHE_FLASH_ATTR
CFG_Load()
{
INFO(“\r\nload?...\r\n“);
spi_flash_read((CFG_LOCATION?+?3)?*?SPI_FLASH_SEC_SIZE
???(uint32?*)&saveFlag?sizeof(SAVE_FLAG));
if?(saveFlag.flag?==?0)
{
spi_flash_read((CFG_LOCATION?+?0)?*?SPI_FLASH_SEC_SIZE
???(uint32?*)&sysCfg?sizeof(SYSCFG));
}
else
{
spi_flash_read((CFG_LOCATION?+?1)?*?SPI_FLASH_SEC_SIZE
???(uint32?*)&sysCfg?si
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-10-19?12:03??26_ESP8266_ALiYun_TCP_MQTT\
?????文件????????4445??2018-10-19?10:17??26_ESP8266_ALiYun_TCP_MQTT\.cproject
?????文件?????????791??2018-01-24?14:41??26_ESP8266_ALiYun_TCP_MQTT\.project
?????目錄???????????0??2018-10-19?12:03??26_ESP8266_ALiYun_TCP_MQTT\.settings\
?????文件????????1225??2018-10-18?15:05??26_ESP8266_ALiYun_TCP_MQTT\.settings\language.settings.xm
?????目錄???????????0??2018-10-19?12:03??26_ESP8266_ALiYun_TCP_MQTT\.vscode\
?????文件??????????71??2018-10-18?15:47??26_ESP8266_ALiYun_TCP_MQTT\.vscode\settings.json
?????目錄???????????0??2018-10-19?12:03??26_ESP8266_ALiYun_TCP_MQTT\app\
?????目錄???????????0??2018-10-19?12:03??26_ESP8266_ALiYun_TCP_MQTT\app\.output\
?????目錄???????????0??2018-10-19?12:03??26_ESP8266_ALiYun_TCP_MQTT\app\.output\eagle\
?????目錄???????????0??2018-10-19?12:03??26_ESP8266_ALiYun_TCP_MQTT\app\.output\eagle\debug\
?????目錄???????????0??2018-10-19?11:59??26_ESP8266_ALiYun_TCP_MQTT\app\.output\eagle\debug\bin\
?????目錄???????????0??2018-10-19?12:03??26_ESP8266_ALiYun_TCP_MQTT\app\.output\eagle\debug\image\
?????文件??????437373??2018-10-19?11:59??26_ESP8266_ALiYun_TCP_MQTT\app\.output\eagle\debug\image\eagle.app.v6.out
?????文件????????3226??2017-05-05?03:01??26_ESP8266_ALiYun_TCP_MQTT\app\gen_misc.bat
?????文件????????3798??2017-05-05?03:01??26_ESP8266_ALiYun_TCP_MQTT\app\gen_misc.sh
?????目錄???????????0??2018-10-19?12:03??26_ESP8266_ALiYun_TCP_MQTT\app\include\
?????目錄???????????0??2018-10-19?12:03??26_ESP8266_ALiYun_TCP_MQTT\app\include\driver\
?????文件????????3406??2017-05-05?03:01??26_ESP8266_ALiYun_TCP_MQTT\app\include\driver\uart.h
?????文件????????5801??2017-05-05?03:01??26_ESP8266_ALiYun_TCP_MQTT\app\include\driver\uart_register.h
?????目錄???????????0??2018-10-19?12:03??26_ESP8266_ALiYun_TCP_MQTT\app\include\modules\
?????文件????????2111??2017-05-05?03:01??26_ESP8266_ALiYun_TCP_MQTT\app\include\modules\config.h
?????文件?????????285??2017-05-05?03:01??26_ESP8266_ALiYun_TCP_MQTT\app\include\modules\wifi.h
?????目錄???????????0??2018-10-19?12:03??26_ESP8266_ALiYun_TCP_MQTT\app\include\mqtt\
?????文件?????????386??2017-05-05?03:01??26_ESP8266_ALiYun_TCP_MQTT\app\include\mqtt\debug.h
?????文件????????5301??2017-05-05?03:01??26_ESP8266_ALiYun_TCP_MQTT\app\include\mqtt\mqtt.h
?????文件????????4946??2017-05-05?03:01??26_ESP8266_ALiYun_TCP_MQTT\app\include\mqtt\mqtt_msg.h
?????文件?????????860??2017-05-05?03:01??26_ESP8266_ALiYun_TCP_MQTT\app\include\mqtt\proto.h
?????文件????????2029??2017-05-05?03:01??26_ESP8266_ALiYun_TCP_MQTT\app\include\mqtt\queue.h
?????文件?????????524??2017-05-05?03:01??26_ESP8266_ALiYun_TCP_MQTT\app\include\mqtt\ringbuf.h
?????文件?????????263??2017-05-05?03:01??26_ESP8266_ALiYun_TCP_MQTT\app\include\mqtt\typedef.h
............此處省略202個(gè)文件信息
評(píng)論
共有 條評(píng)論