资源简介
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个文件信息
相关资源
- 价值2k的H漫画小说系统
- Pythonamp;课堂amp;笔记(高淇amp;400;集第
- ddos压力测试工具99657
- UML建模大全
- 开源1A锂电池充电板TP4056原理图+PCB
- m1卡 ic卡可选择扇区初始化加密软件
- TSCC.exe
- FTP课程设计(服务端+客户端)
- 计算机图形学 边填充算法实现代码
- 电力系统潮流计算程序集合
- oracle数据迁移项目实施方案
- Web Api 通过文件流 文件到本地
- Visio图标-最新最全的网络通信图标库
- Spire API文档
- OpenGL参考手册
- Python中Numpy库最新教程
- SPD博士V5.3.exe
- 直流无刷电机方波驱动 stm32 例程代码
- layui后台管理模板
- 仿知乎界面小程序源代码
- 云平台-阿里云详细介绍
- photoshop经典1000例
- scratch垃圾分类源码(最终版本).sb
- IAR ARM 7.8破解
- TI CCS V5.4 安装步骤及破解文件
- 松下plc FP-XH的驱动
- 局域网硬件信息收集工具
- 加快Windows XP操作系统开机速度
- 联想启天M4350 BIOS升级文件
- 操作系统教程课后答案华中科技大学
评论
共有 条评论