BLE:交换MTU后,MTU值的大小较小(差异较大) [英] BLE: Lower MTU value size(big difference) after MTU exchange

查看:1341
本文介绍了BLE:交换MTU后,MTU值的大小较小(差异较大)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是BLE开发的新手.我想以最大的吞吐量通过BLE连接发送大量数据.

I am new to the BLE development. I want to send some large amount of data over a BLE connection with maximum throughput.

我有一个在Linux上运行的GATT服务器和一个在Android上作为应用程序运行的客户端.我创建了一个具有最大允许大小(512字节)的自定义特征.我正在通过读取操作从应用程序请求它.每次收到服务器端的读取请求时,我都会更改它的值,直到完成所有数据为止(我知道这不是最好的方法,但现在不是问题).

I have a GATT server, which is running on Linux, and a client which is running as an app on Android. I have created a custom characteristic with the maximum allowed size(512 bytes). I am requesting it from the app with a read operation. Every time I receive a call for reading on the server side I change it's value until I am finished with all the data(I know this isn't the best way but that's not the problem for now).

至于使用android的requestConnectionPriority(CONNECTION_PRIORITY_HIGH)的连接参数,我可以看到他们正在尝试协商7.5ms的连接间隔,但由于某种原因,它更改为15ms并保留在那里.也许我的手机不支持它,但我不这么认为.

As for the connection parameters using android's requestConnectionPriority(CONNECTION_PRIORITY_HIGH) i can see that they are trying to negotiate a connection interval of 7.5ms but for some reason, it changes to 15ms and it remains there. Maybe my phone doesn't support it but I don't think so.

接下来的事情和主要问题是MTU.使用hcidump,我可以看到他们开始协商MTU,因为我可以看到来自客户端的MTU请求(默认值为517)和服务器Response的值相同.但是当我触发数据交换时,我可以看到(使用Wireshark)数据包仅包含32个字节的有效负载.我不知道这对我的蓝牙适配器是否有限制.

The next thing and the main problem is the MTU. Using hcidump, I can see that they are starting to negotiate the MTU as I can see an MTU Request from the client with a value of 517(by default) and a server Response with the same value. But when I trigger the data exchange I can see(using Wireshark) that the packets are containing only 32 bytes of payload. I don't know if it's a restriction with my Bluetooth adapter.

推荐答案

MTU数据包可以包含许多无线电数据包,而32字节的无线电数据包有效负载可能是您的蓝牙适配器的限制.目前没有电话支持7.5毫秒的连接间隔.如果您的手机和设备支持,请同时启用数据长度扩展".这将允许您在整个连接事件中传输多个MTU.

An MTU packet can consist of many radio packets and the 32byte radio packet payload is probably a restriction in your bluetooth adapter. No phone supports 7.5ms connection intervals at this point in time. You should also enable Data Length Extention if your phone and device supports it. This will allow you to transmit multiple MTUs throughout the connection event.

这篇关于BLE:交换MTU后,MTU值的大小较小(差异较大)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆