BLE 4.2数据包长度扩展?

14 posts / 0 new
最后一篇
最大限度44
离线
最后一次露面:10个月4天前
加入:2016-02-08 15:58
BLE 4.2数据包长度扩展?

嗨对话框,

我知道你已经说过“简而言之,DA1458X现在正式被称为BT 4.2设备,而无需支持可选功能。”但它并不清楚我是251字节的BLE PDU扩展被视为可选功能。如果它在SDK 5.0.3中得到支持,则需要一些配置吗?

我确实阅读了使用gatt_exc_mtu_cmd的帖子来定义一个较大的mtu,我正在调查一下。

谢谢,最大

Device:
mt_dialog.
离线
最后一次露面:3 months 3 days ago
职员
加入:2015-06-08 11:34
Hi Max44,

Hi Max44,

4.2的新功能将LE的链路层PDU从27到251字节的有效载荷扩展,这是580不支持的,因为它是一个4.2可选功能。选择较大的MTU时,您不会更改LE的PDU,但上层的缩放性,在L2CAP上方接受较大的有效载荷,发送数据包的实际有效载荷保持不变。

谢谢mt_dialog.

最大限度44
离线
最后一次露面:10个月4天前
加入:2016-02-08 15:58
公吨,

公吨,

好,谢谢。

正如您可能从以前的问题猜到,我正在尝试发送记录到EEPROM的一些传感器数据。我想发送EEPROM数据的页面(256字节)。我尝试使用在BLE_APP_PERITWAL中设置20个字节的数据的自定义特征来发送单个读取的单个页面,并且需要几乎1秒钟即可完成。

I'm not sure if creating a characteristic with a larger number of bytes and increasing the MTU value would result in a faster data transfer. Do you think it will help?

问候,最大

Joacimwe
离线
最后一次露面:1 year 6 months ago
Guru
加入:2014-01-14 06:45
What you should do is use

What you should do is use Write Without Response rather than Write With Response in order to be able to send multiple 20 bytes packets in one connection event. That will give you about the same performance as increasing the MTU.

最大限度44
离线
最后一次露面:10个月4天前
加入:2016-02-08 15:58
Joacimwe,

Joacimwe,

感谢您的输入,我的数据流是从DA到Android平板电脑/手机,读取数据存储在连接到DA14580的EEPROM中。我已经研究了对数据读取的通知,但从最近与MT_Dialog讨论的讨论没有任何反馈,平板电脑/电话已读取和存储数据。我担心这可能导致数据丢失,如果我刚刚将数据推入数据特征,所以我实现了作为确认的流量控制特性。当然,这会增加BLE开销并进一步减慢数据传输。如果您知道处理此操作的一些更好的技术,请告诉我。现在,我计划查看数据特征中的字节数....如果似乎没有多大,可能会增加MTU值。这是我的新领域,所以我正在采取较小的步骤。

问候,最大

Joacimwe
离线
最后一次露面:1 year 6 months ago
Guru
加入:2014-01-14 06:45
I see. I thought you were

I see. I thought you were writing data in the other direction.

如果您只需用通知推动数据(一个接一个地发送它们并等待GattC_CMP_EVT发送下一个),那么它们将以最大速度顺序发送,并且由于链接层等待的链路层没有数据包将被丢弃为了确认在发送下一个数据包之前。

Android is also built in such a way that it never drops incoming notifications but forwards all of them in the correct order to the app that is listening for the characteristic.

The only thing that can happen is that the connection is lost which means transmission is aborted, but all received notifications have still been received in the correct order. The most simple way here is to just restart everything.

如果你想知道Androi的外围d device has received all notifications, just write some value over any characteristic indicating this. You don't need to acknowledge intermediate packets, just the last one.

最大限度44
离线
最后一次露面:10个月4天前
加入:2016-02-08 15:58
谢谢!I'll give it a

谢谢!我会试一试。

最大限度44
离线
最后一次露面:10个月4天前
加入:2016-02-08 15:58
Unfortunately, I'm not

Unfortunately, I'm not getting this to work. I modified the DA code to add a notify attribute to the data characteristic and see that it is pushing out the data as expected. The Android end is not working, however. I can't enable notifications, getting a write declaration error in the process. I'm stuck at this point.

I'm running a Samsung Galaxy Tab A tablet with Android 6.0.1. The test app is generated by Bluetooth Developer Studio and is fairly simple. Each custom characteristic (only slightly modified from the ble_app_peripherals SDK example) has buttons for write, read, and enable notifications for what has been defined for the characteristic.. So .... I can scan, connect, and read and write other characteristics, but when I click the button for enable notifications on the data characteristic it results in the write declaration error (seen via debug mode of Android Studio). The BLE code in the app to enable notifications looks almost identical to the Android Developer examples ..... so I don't understand why it's not working as advertised. The error message isn't any help .... status code 129.

如果你知道任何细微的事情要纠正这种error, let me know. I don't think it's appropriate to get into a detailed Android discussion here, but I can post an email address if you'd like to take the discussion offline. I've seen a great deal of complaining online about Samsung's version of Marshmallow, so perhaps I have run across something in it that doesn't work. I don't have another Android device to try, but could consider backing down to Android 5 on the Samsung tablet.

Joacimwe
离线
最后一次露面:1 year 6 months ago
Guru
加入:2014-01-14 06:45
你是如何启用的

你是如何启用的notifications on the DA14580 side? You both need to set the ATT permission, and also set a bit on the GATT characteristic declaration. A client characteristic config descriptor must also exist.

Easiest is to just follow existing sample code that has a notification characteristic.

在Android方面,您需要写入描述符并在本地注册通知。

最大限度44
离线
最后一次露面:10个月4天前
加入:2016-02-08 15:58
好决定!I went back and

好决定!我回去了,发现了我的user_custs_config.h文件中的一些错误。我在建议时遵循了一个现有的实例,但它是表示属性的。我错过了编辑所有地点来改变它以通知。

I'm now able to successfully write the descriptor on the Android side and at least enable notifications. I have a little more work to do to see if I can complete the data transfers in my test case but will report back.

Thanks for the continued help. Very much appreciated.

最大限度

最大限度44
离线
最后一次露面:10个月4天前
加入:2016-02-08 15:58
Joacimwe,

Joacimwe,

在纠正启用通知问题后,我的测试用例发送了200个字节(连续10个连续读取的20字节)。我在Android平板电脑上测量了30毫秒,从WRITE命令开始响应时启动将数据发送到从存储在平板电脑上的数组中存储的DA中获取所有200个字节。

This is a huge improvement!!! Thanks again for your guidance.

我要看看我是否可以将测试扩展到1KB传输。你知道是否有限制我可以以这种方式流流的限制?我的EEPROM是一个2 Mbit,我也计划用作启动内存。我可能有大约230KB的记录数据发送。

Best regards, Max

Joacimwe
离线
最后一次露面:1 year 6 months ago
Guru
加入:2014-01-14 06:45
I guess the BLE throughput is

我猜BLE吞吐量小于EEPROM,因此EEPROM不是瓶颈。

A tip is to lower the connection interval (look for connection parameter update request) to send data faster. Otherwise there is no limit how much you can stream as far as I know.

最大限度44
离线
最后一次露面:10个月4天前
加入:2016-02-08 15:58
My data rate fell off

My data rate fell off dramatically with a larger 1KB block, 820 msec. transfer time. I'm fairly sure this isn't due to any EEPROM timing as I read the data into a large array prior to running the test, but I'll check on it. I suppose this might be due to the connection interval you mentioned? On the DA side, I see in user_config.h there are connection interval values which appear to be 10 msec min and 20 msec max. This looks OK if they're the default connection parameters. I tried altering the values in user_config.h. If I set both to 10 msec, things stop working. If I set the max value to 11.25, I only get a slightly better transfer time, 791 msec. Times also seem to vary over iterations of the test.

在连接时,我看到了Android Studio调试器报告:OnClientConnParamsChanged() - 设备= 80:EA:CA:00:00:03间隔= 9状态= 0

I think the DA14580 sets the intervals in increments of 1.25 msec according to the comments, so 9 would be the 11.25 msec?

并且在20毫秒的最大间隔我得到:OnClientConnParamsChanged() - 设备= 80:EA:CA:00:00:03间隔= 15状态= 0 15 x 1.25 = 18.75

所以看来我可以稍微调整一些东西,但没有大大改进。

最大限度44
离线
最后一次露面:10个月4天前
加入:2016-02-08 15:58
I realized I was using time

我意识到我在da上使用时间来编写UART上的调试消息。我配置了所有这些,关闭了开发调试模式。现在,连接间隔最大设置为11.25毫秒如上所述,我将获得161毫秒的转移时间,每个分组为20字节为20个字节。这很好!

主题锁定