野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7178|回复: 5

关于SMT32F407上调用lwip_send后没数据包发送

[复制链接]
发表于 2016-9-6 16:47:23 | 显示全部楼层 |阅读模式
最近在LWIP上移植MQTT协议栈,实现TCP握手后明明调用了lwip_send函数想将MQTT数据包发送出去,但是PC上没有抓到MQTT的包。

是lwip_send中netconn_write_partly()函数在某种只有写入功能,不会发送吗?望大神指教!!

附上串口调试信息

BSP_Tick Init Success
LAN8720A BSP INIT AND COMFIGURE SUCCESS
Creating Application kernel objects

Creating Application Tasks

  Static IP address   
IP: 222.204.248.122
NETMASK: 255.255.255.0
Gateway: 222.204.248.1
mqtt client created
Connecting to serverURI 222.204.248.143:1883 with MQTT version 4
the src string is truncated
lwip_socket(PF_INET, SOCK_STREAM, 0) = 0
New socket 0 for 222.204.248.143, port 1883
lwip_connect(0, addr= 222. 204. 248. 143 port=1883)
lwip_connect(0) failed, err=-5
Connect pending
/* TCP connect started - wait for completion */
/* TCP connect complete */
lwip_send(0, data=20011620, size=      25, flags=0x0)
lwip_send(0) err=0 written=      25
rc == MQTTCLIENT_SUCCESS
mqtt client connect
lwip_send(0, data=20011630, size=      36, flags=0x0)
lwip_send(0) err=0 written=      36
mqtt client publish,  return code = -1



回复

使用道具 举报

发表于 2016-9-6 17:57:42 | 显示全部楼层
你移植的是MQTT官方的C版源代码吗?我有空也学习下
回复 支持 反对

使用道具 举报

发表于 2016-9-6 17:58:24 | 显示全部楼层
你移植的是MQTT官方的C版源代码吗?有空我也学习下
回复 支持 反对

使用道具 举报

 楼主| 发表于 2016-9-6 19:10:03 | 显示全部楼层
flyleaf 发表于 2016-9-6 17:58
你移植的是MQTT官方的C版源代码吗?有空我也学习下

不是官方的。。。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2016-9-6 19:10:42 | 显示全部楼层
flyleaf 发表于 2016-9-6 17:58
你移植的是MQTT官方的C版源代码吗?有空我也学习下

不是官方的。。。。
回复 支持 反对

使用道具 举报

发表于 2016-9-6 19:15:59 | 显示全部楼层
这么强,连我大哥都不会的东西你都会了。。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2024-4-30 21:22 , Processed in 0.032700 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表