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.

CC2541传输丢包问题

Other Parts Discussed in Thread: CC2541

我使用CC2541芯片遇到了两个问题。

1.我使用设置characteristic启动notify的方式来获取数据,在40ms发一次的情况下,notify发送的数据包会丢失。

2.在使用上面的方式发送数据时,一个包包含的数据只能支持29字节的,而代码里面的注释上说明的是

typedef struct attAttribute_t

{

    gattAttrType_t type;

    uint8 permissions;

    uint16 handle;

    uint8* const pValue;//!< Attribute value - encoding of the octet array is defined in

                                   //!< the Application profile.The maximum length of an attaribute

                                   //!< value shall be 512 octets

} gattAttribute_t;

  • li,

    1. 接收方是个啥?能用packet sniffer 抓包看看空中包的情况吗?

    2. 正确来说,notification 允许带的数据包最长只有20字节。这是协议栈规定。这个定义只是广泛的定义,针对于所有的attribute. 读写数据的时候,是可以有更长数据的,但是到了底层,还是分包发送。

  • 接收使用的套间里面的USB 接收器,用BTool查看的数据。

    我刚才看到了之前的帖子,里面有说到一个Blob 读,我使用TI的android Demo是不是能够实现Blob读喃。

    谢谢

  • 接收是通过usb dongle使用Btool接收包。

    在之前的帖子里面我看到了一个Blob 写的一个说法,我想问在Ti 提供的androidDemo里面怎么实现blob读去我再cc2541从设备里面设置的长度超过20字节的特征值。

  • li,

    由于google 已经把BlueDroid协议栈给封装了,并没有完全把BlueDroid 的所有接口都提供出来,虽然你可以找到BlueDroid 源码,自己编译到Android 内核里面去,因为BlueDroid是开源的。

    所以,Google提供的API,看上去只有write和read,并没有说明是何种方式读取。

  • Yan,

    我再追问一个问题哈,如果一个特征值需要以blob的方式读取,我在cc2541单片机程序中定义这个特征值是是否需要一些特殊的设定。

  • li,

    不需要特殊设定。

    blob读只是读的一种方式,和特征值本质没有关系。