问答 店铺
热搜: ZYNQ FPGA discuz

QQ登录

只需一步,快速开始

微信登录

微信扫码,快速开始

微信扫一扫 分享朋友圈

已有 6685 人浏览分享

开启左侧

关于tcp接收网络调试助手数据

[复制链接]
6685 2
tcp接收的数据信息主要是pbuf结构体提供的,但是我不知道如何利用指针将数据读出来,比如读到一个数组中,并对其进行判断?
struct pbuf {
  /** next pbuf in singly linked pbuf chain */
  struct pbuf *next;

  /** pointer to the actual data in the buffer */
  void *payload;

  /**
   * total length of this buffer and all next buffers in chain
   * belonging to the same packet.
   *
   * For non-queue packet chains this is the invariant:
   * p->tot_len == p->len + (p->next? p->next->tot_len: 0)
   */
  u16_t tot_len;

  /** length of this buffer */
  u16_t len;

  /** pbuf_type as u8_t instead of enum to save space */
  u8_t /*pbuf_type*/ type;

  /** misc flags */
  u8_t flags;

  /**
   * the reference count always equals the number of pointers
   * that refer to this pbuf. This can be pointers from an application,
   * the stack itself, or pbuf->next pointers from a chain.
   */
  u16_t ref;
};

评论 2

江苏-天文  新手上路  发表于 2019-7-12 16:34:04 | 显示全部楼层
主要是c语言没有学好,和我遇到一样问题的同学建议去百度一些memcpy()函数,其实就是一个内存拷贝的函数。
路漫漫其修远兮,吾将上下而求索!
uisrc  管理员  发表于 2019-7-12 16:42:52 | 显示全部楼层
搞定就好
越努力越幸运!加油!

举报 使用道具

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

本版积分规则

精彩推荐
热门资讯
网友晒图
图文推荐

  • 微信公众平台

  • 扫描访问手机版