[X]关闭

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

文档创建者:江苏-天文
浏览次数:4459
最后更新:2019-07-12
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 | 显示全部楼层

搞定就好
越努力越幸运!加油!
回复

使用道具 举报

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

本版积分规则