Cypress技术william hill官网
直播中

胡书琴

7年用户 209经验值
私信 关注
[问答]

BLE通知无法发送数据

你好,
我用CYBLY-01400—EVE来开发。
我已经创建了一个定制的BLE服务(字段:9x4字节=36字节,属性:通知)。
在与CyScript 1.2和“启用所有通知”链接之后,我无法得到通知的数据。
但是,如果将“字段”数据的大小设置为36字节到12字节,则可以得到通知的数据。
通知的数据大小有什么限制吗?
谢谢!
特里

以上来自于百度翻译


     以下为原文
  Hi,

I am using CYBLE-014008-EVAL for my development.

I have created a custom BLE service (Fields: 9x4 bytes == 36 bytes, Properties: Notify).
After linked with CySmart 1.2 and 'Enable All Notifications', I cannot get the notified data.

However, if I set the size of the 'Fields' data from 36 bytes to 12 bytes, I can get the notified data.

Is there any limitation on the data size of the notification?

Thanks!
Terry

回帖(4)

蒋进如

2018-10-23 15:40:53
你好,特里,
将MTU大小增加到39,然后再试一次。确保MTU大小被交换。
请参阅蓝牙4规范第3卷F 3.4.7.1部分。(通知的属性值大小应该在0到MTU - 3之间)。
当做,

以上来自于百度翻译


     以下为原文
  Hello Terry,
 
Increase the MTU size to 39 and try again. Make sure that the MTU size is exchanged.
 
Please see Bluetooth 4.0 specification Vol 3 Part F 3.4.7.1. (Attribute Value size for notifications should be between 0 and MTU - 3)
 
Regards,
举报

胡书琴

2018-10-23 15:52:53
引用: wang_901218 发表于 2018-10-23 12:41
你好,特里,
将MTU大小增加到39,然后再试一次。确保MTU大小被交换。
请参阅蓝牙4规范第3卷F 3.4.7.1部分。(通知的属性值大小应该在0到MTU - 3之间)。

嗨,CFMM,
只想确认在“间隙设置”中改变MTU是否可以?
我需要改变“L2CAP MTU”吗?
谢谢,
特里

以上来自于百度翻译


     以下为原文
  Hi cfmm,
 
Just want to confirm that is it ok for just to change the MTU in 'GAP settings'?
Do I need to change the 'L2CAP MTU' also?
 
Thanks,
Terry
举报

蒋进如

2018-10-23 15:58:56
引用: EnjoyL 发表于 2018-10-23 12:53
嗨,CFMM,
只想确认在“间隙设置”中改变MTU是否可以?
我需要改变“L2CAP MTU”吗?

你好,特里,
在间隙设置选项卡中。

以上来自于百度翻译


     以下为原文
  Hello Terry,
 
Yes in the GAP Settings tab.
举报

李兆水

2018-10-23 16:12:17
卡洛斯费尔南多梅尔马丁内兹是正确的。根据BLE规范,通知的最大大小是MTU - 3。默认MTU大小是23,这意味着最大通知有效载荷可以是20字节。这就是为什么12字节为你工作,而不是为36工作。当数据长度大于MTU - 3时,GATSnNoTIFICTION()API将返回一个错误。您可以在代码中检查这一点。
如果要发送大小为36字节的通知,则将MTU大小更改为36 + 3=39字节。你不必改变L2CAP MTU的大小。只更改关贸总协定MTU大小。

以上来自于百度翻译


     以下为原文
  [size=0.9em]Carlos Fernando Meier Martinez is correct. According to the BLE spec, the max size for a notification is MTU - 3. The default MTU size is 23 which means that the max notification payload can be 20 bytes. This is why 12 bytes work for you and not 36.

[size=0.9em]The GattsNotification() API will be returning an error when the length of the data is greater than MTU - 3. You can check this in your code.

[size=0.9em] 
[size=0.9em]If you want to send a notification of size 36 bytes, then change the MTU size to 36 + 3 = 39 bytes. You don't have to change the L2CAP MTU size. Change only the GATT MTU size.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分