1.具体使用方法可参考:sample.c
SDK使用的三种类型:
1.组包-发送-删包
只需要调用接口函数封装一包数据,成发送即可。
2.组包-发送-等待平台返回-删包
连接平台和心跳请求需要等待平台的返回结果。
3.数据点上传
数据点上传分5步:1.获取json格式数据流长度
2.根据长度封装协议头
3.封装一包数据
4.发送数据
5.释放内存
内存方案的三种方式
1.动态分配
只需要声明 EDP_PACKET_STRUCTURE edpPacket = {NULL, 0, 0, 0};
然后调用组包函数即可。
2.全局数
声明一个全局数组,如 unsigned char dataMem[128]
然后再调用组包函数之前
edpPacket._data = dataMem;
edpPacket._size = sizeof(dataMem);
即可。
3.局部数组
方式同2,数组为局部变量。
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
基于stm32和esp8266的智能家居系统 (127个子文件)
keilkilll.bat 372B
stm32f10x_tim.c 104KB
stm32f10x_flash.c 59KB
stm32f10x_rcc.c 49KB
stm32f10x_adc.c 45KB
stm32f10x_i2c.c 43KB
stm32f10x_can.c 43KB
stm32f10x_usart.c 36KB
system_stm32f10x.c 35KB
MqttKit.c 35KB
stm32f10x_fsmc.c 34KB
stm32f10x_spi.c 29KB
stm32f10x_dma.c 28KB
stm32f10x_sdio.c 27KB
cJSON.c 26KB
stm32f10x_gpio.c 22KB
stm32f10x_dac.c 18KB
core_cm3.c 16KB
sample.c 14KB
stm32f10x_cec.c 11KB
onenet.c 10KB
oled.c 10KB
stm32f10x_pwr.c 8KB
stm32f10x_rtc.c 8KB
stm32f10x_bkp.c 8KB
bh1750.c 7KB
esp8266.c 7KB
misc.c 7KB
stm32f10x_exti.c 7KB
delay.c 6KB
usart.c 6KB
stm32f10x_wwdg.c 5KB
stm32f10x_dbgmcu.c 5KB
stm32f10x_iwdg.c 5KB
timer.c 4KB
stm32f10x_crc.c 3KB
main.c 3KB
dht11.c 3KB
exti.c 2KB
stm32f10x_it.c 2KB
led.c 1KB
key.c 579B
beep.c 526B
sys.c 336B
LED_STM32F103RC.dbgconf 7KB
LED_STM32F103C8.dbgconf 7KB
.gitignore 350B
stm32f10x.h 611KB
core_cm3.h 82KB
stm32f10x_tim.h 50KB
oledfont.h 43KB
stm32f10x_rcc.h 29KB
stm32f10x_i2c.h 29KB
stm32f10x_can.h 26KB
stm32f10x_fsmc.h 26KB
stm32f10x_flash.h 24KB
stm32f10x_sdio.h 21KB
stm32f10x_adc.h 21KB
stm32f10x_dma.h 20KB
stm32f10x_gpio.h 19KB
stm32f10x_spi.h 17KB
stm32f10x_usart.h 16KB
stm32f10x_dac.h 15KB
bmp.h 10KB
misc.h 9KB
cJSON.h 7KB
stm32f10x_bkp.h 7KB
MqttKit.h 7KB
stm32f10x_exti.h 6KB
stm32f10x_cec.h 6KB
stm32f10x_pwr.h 4KB
stm32f10x_rtc.h 4KB
stm32f10x_dbgmcu.h 4KB
stm32f10x_iwdg.h 4KB
stm32f10x_conf.h 3KB
bh1750.h 3KB
stm32f10x_wwdg.h 3KB
sys.h 3KB
stm32f10x_crc.h 2KB
system_stm32f10x.h 2KB
stm32f10x_it.h 2KB
oled.h 1KB
dht11.h 676B
timer.h 585B
Common.h 551B
usart.h 378B
esp8266.h 331B
key.h 281B
onenet.h 249B
led.h 175B
delay.h 171B
beep.h 150B
exti.h 108B
JLinkSettings.ini 268B
mqtt.js 183KB
index.js 3KB
.eslintrc.js 587B
util.js 460B
app.js 364B
logs.js 305B
共 127 条
- 1
- 2
资源评论
- 2301_763135602024-05-13非常有用的资源,可以直接使用,对我很有用,果断支持!
Java程序员-张凯
- 粉丝: 1w+
- 资源: 6735
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功