问题描述
我想让我的Zedboard使用Xilinx lwIP示例作为基础返回一个数字值,但是无论我做什么,我都无法弄清楚存储接收或传输的数据的原因。
我已经找到了空类型有效载荷,但是我不知道该怎么做。
Snapshot of one instance of payload and a list of lwIP files
以下是最接近我目标的功能:
err_t recv_callback(void *arg,struct tcp_pcb *tpcb,struct pbuf *p,err_t err){
/* do not read the packet if we are not in ESTABLISHED state */
if (!p) {
tcp_close(tpcb);
tcp_recv(tpcb,NULL);
return ERR_OK;
}
/* indicate that the packet has been received */
tcp_recved(tpcb,p->len);
/* echo back the payload */
/* in this case,we assume that the payload is < TCP_SND_BUF */
if (tcp_sndbuf(tpcb) > p->len) {
err = tcp_write(tpcb,p->payload,p->len,1);
//I need to change p->paylod but IDK where it is given a value.
} else
xil_printf("no space in tcp_sndbuf\n\r");
/* free the received pbuf */
pbuf_free(p);
return ERR_OK;
}
任何指导表示赞赏。
谢谢, Turtlemii
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)