This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

characteristic定义为数组,数组空间能设多大?20字节后连接不上主机!




在从机中,从机给主机发送数据可以采用notification的方式传递给主机,传递的数据结构是下面这个结构体:

typedef struct
{
uint16 handle; //!< Handle of the attribute that has been changed (must be first field)
uint8 len; //!< Length of value
uint8 value[ATT_MTU_SIZE-3]; //!< New value of the attribute ,Minimum ATT MTU size =23 宏定义为23
} attHandleValueNoti_t;

value[ATT_MTU_SIZE-3]; //!< New value of the attribute ,Minimum ATT MTU size =23 宏定义为23

而ATT_MTU_SIZE大小可以设置为23-517字节!所以说BLE是可以实现最大517字节帧的传递的!现在主要是在设置属性表characteristic数组大小的时候,不能超过20字节,超过20字节的大小的数组就连接不上主机,估计是程序跑偏,我想问的问题就是characteristic为何最大只能定义20字节,超过20字节就连接不上了主机?

notification数据value的数组大小可以在23-517字节之间的范围内选择,如果characteristic只能是20字节,notification数据有517字节有何用啊?按照BLE传递的数据包结构推算,传递20字节的characteristic整个数据包不会超过50字节!好比水池里的水就是1吨,你要用适配100吨的水管去放水池的水,是不是有点老牛拉小车?

Ti员工和各位真正了解底层的朋友能不能给个正确的解释?