码迷,mamicode.com
首页 > 其他好文 > 详细

afDataReqMTU()基于 输入参数可以发送字节数的最大值

时间:2017-07-04 13:18:46      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:letter   conf   uri   clu   数据   for   length   color   including   

在API的手册中可以看出,

技术分享

根据此函数,能读取最大有效载荷的大小;

ti论坛的解释:

The maximum payload size for an application is based on several factors. The MAC layer provides a constant payload length of 116 (can be changed in f8wConfig.cfg – MAC_MAX_FRAME_SIZE). The NWK layer requires a fixed header size, one size with security and one without security. The APS layer has a required, but variable,header size based on a variety of settings, including the ZigBee Protocol Version, APS frame control settings, etc.

Ultimately, the user does not have to calculate the maximum payload size using the aforementioned factors. The AF module provides an API that allows the user to query the stack for the maximum payload size, or the maximum transport unit (MTU). The user can call the function, “afDataReqMTU” (see “af.h”) which will return the MTU, or maximum payload size

 

 

自己实测:

  int a=512;
   char temp[3];
  afDataReqMTU_t *pafData;
  afDataReqMTU_t afData;
  
  afData.kvp=0;
  afData.aps.secure=0;
  *pafData=afData;
  a=afDataReqMTU(pafData);
  sprintf(temp, (const char *)"%d",a); 
  MT_UartInit ();
  MT_UartRegisterTaskID(task_id);//注册串口任务
  HalUARTWrite(0,(unsigned  char *)&temp[0],4); //发送数据

利用串口发送,数据最大载荷为99.

afDataReqMTU()基于 输入参数可以发送字节数的最大值

标签:letter   conf   uri   clu   数据   for   length   color   including   

原文地址:http://www.cnblogs.com/mm327596194/p/7115865.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!