资源简介
ESP8266_NONOS_SDK-2.2.1_based_USARTrevised.rar
代码片段和文件信息
/* mqtt.c
* Protocol: http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html
*
* 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 “user_interface.h“
#include “osapi.h“
#include “espconn.h“
#include “os_type.h“
#include “mem.h“
#include “mqtt_msg.h“
#include “debug.h“
#include “user_config.h“
#include “mqtt.h“
#include “queue.h“
#define MQTT_TASK_PRIO 2
#define MQTT_TASK_QUEUE_SIZE 1
#define MQTT_SEND_TIMOUT 5
#ifndef QUEUE_BUFFER_SIZE
#define QUEUE_BUFFER_SIZE 2048
#endif
unsigned char *default_certificate;
unsigned int default_certificate_len = 0;
unsigned char *default_private_key;
unsigned int default_private_key_len = 0;
os_event_t mqtt_procTaskQueue[MQTT_TASK_QUEUE_SIZE];
LOCAL void ICACHE_FLASH_ATTR
mqtt_dns_found(const char *name ip_addr_t *ipaddr void *arg)
{
struct espconn *pConn = (struct espconn *)arg;
MQTT_Client* client = (MQTT_Client *)pConn->reverse;
if (ipaddr == NULL)
{
INFO(“DNS: Found but got no ip try to reconnect\r\n“);
client->connState = TCP_RECONNECT_REQ;
return;
}
INFO(“DNS: found ip %d.%d.%d.%d\n“
*((uint8 *) &ipaddr->addr)
*((uint8 *) &ipaddr->addr + 1)
*((uint8 *) &ipaddr->addr + 2)
*((uint8 *) &ipaddr->addr + 3));
if (client->ip.addr == 0 && ipaddr->addr != 0)
{
os_memcpy(client->pCon->proto.tcp->remote_ip &ipaddr->addr 4);
if (client->security) {
#ifdef MQTT_SSL_ENABLE
espconn_secure_connect(client->pCon);
#else
INFO(“TCP: Do not support SSL\r\n“);
#en
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 259 2018-10-05 15:01 .settings\org.eclipse.core.resources.prefs
文件 442565 2019-07-05 09:00 app\.output\eagle\debug\image\eagle.app.v6.out
文件 3080 2018-09-17 13:44 app\gen_misc.bat
文件 3286 2018-09-17 13:44 app\gen_misc.sh
文件 1324 2018-09-17 13:44 app\include\aliyun_mqtt.h
文件 13990 2018-09-17 11:14 app\include\cJSON.h
文件 1414 2018-06-08 16:20 app\include\driver\gpio16.h
文件 3116 2018-06-08 16:20 app\include\driver\i2c_master.h
文件 1824 2018-06-08 16:20 app\include\driver\key.h
文件 1659 2018-06-08 16:20 app\include\driver\sdio_slv.h
文件 12044 2018-06-08 16:20 app\include\driver\slc_register.h
文件 2630 2018-06-08 16:20 app\include\driver\spi.h
文件 9229 2018-06-08 16:20 app\include\driver\spi_interface.h
文件 2789 2018-06-08 16:20 app\include\driver\spi_overlap.h
文件 8242 2018-06-08 16:20 app\include\driver\spi_register.h
文件 4357 2018-10-07 01:09 app\include\driver\uart.h
文件 13646 2018-10-07 00:31 app\include\driver\uart_register.h
文件 1336 2018-09-17 13:44 app\include\md5.h
文件 646 2018-10-05 10:48 app\include\mqtt\debug.h
文件 5458 2018-10-07 22:51 app\include\mqtt\mqtt.h
文件 4946 2018-09-17 13:44 app\include\mqtt\mqtt_msg.h
文件 860 2018-09-17 13:44 app\include\mqtt\proto.h
文件 2029 2018-09-17 13:44 app\include\mqtt\queue.h
文件 524 2018-09-17 13:44 app\include\mqtt\ringbuf.h
文件 263 2018-09-17 13:44 app\include\mqtt\typedef.h
文件 246 2018-09-17 13:44 app\include\mqtt\utils.h
文件 1072 2018-09-17 13:44 app\include\mqtt_config.h
文件 1499 2019-07-05 08:59 app\include\user_config.h
文件 260 2018-09-17 13:44 app\include\user_wifi.h
文件 3844 2018-10-07 00:34 app\Makefile
............此处省略204个文件信息
相关资源
- StardockFences3.0.3(FULL+Patch).zip
- 新一代高效视频编码H.265HEVC原理、标
- 百度云管家5.4.3无限速VIP.exe
- 数据结构与算法图解.pdf
- 信号处理引论.pdf
- zw_csharp_ffmpeg_rtsp_demo.zip
- GNSSApplicationsandMethods.pdf
- TimeSat3.1.rar
- 含激活码AOMEIDynamicDiskManager12.zip
- Game.rar42396
- Driver_Windows.zip
- 嗷呜职教云3.3.7.exe
- win7激活UEFI工具.rar
- zw_DiscreteMathematicsandItsApplications7thKen
- UU加速器2.11.1破解版.exe
- fenban.exe
- 思远CMS.zip
- X-CAN安装程序-1.9.zip
- 20161007182439558.NETReactor.rar
- qlv直转mp4破解版.zip
- 百度干净云大神版.7z
- V程序.rar
- 10.FPGA数字信号处理十ASK调制技术.7z
- 黑侠外推蜘蛛池V1.3完整破解版.rar
- JPA.rar
- RocketPro.rar
- 工程伦理11.1.pptx
- VirtualLocation.zip
- 474316692wushua.zip
- CC_Antenna_DKREFDESIGN.zip
评论
共有 条评论