简体   繁体   English

如何通过BLE传输数据?

[英]How to stream data via BLE?

I am currently evaluating the board of Maxim Integrated MAXREFDES100# . 我目前正在评估Maxim Integrated MAXREFDES100#的电路板。 As part of my thesis, I would like to examine whether there is the possibility of using BLE for data streaming. 作为论文的一部分,我想研究一下是否有可能使用BLE进行数据流传输。

The supplied software is fully functional and can already transfer data. 随附的软件功能齐全,可以传输数据。 Of course, only smaller data packets over a longer period like Temperature or precalculated Heart Rate values. 当然,在更长的时间内只有较小的数据包,例如温度或预先计算的心率值。 I am aware that BLE is not suitable and has not been designed to transmit data continuously. 我知道BLE不适合并且尚未设计为连续传输数据。 Nevertheless, I would like to try to transfer the ECG raw data also via the BLE interface. 不过,我也想尝试通过BLE接口传输ECG原始数据。 So that I can check whether my data has been arrived completely and correctly in time (prerequisite for ECG data), I have developed the following test setup: 为了开发出以下测试设置,以便我可以检查我的数据是否及时完整,正确地到达(心电图数据的前提):

Currently, I store data of a sine wave to a large FIFO and transfer 20-byte sine packets to a characteristic. 目前,我将正弦波的数据存储到较大的FIFO中,并将20字节的正弦数据包传输到特性中。 So far everything works wonderfully. 到目前为止,一切正常。 Using an Android device and a BLE sniffer I catch the data packets and check if the sine has any interruptions. 使用Android设备和BLE嗅探器,我捕获了数据包并检查正弦是否有任何中断。 The following graphic is taken from a longer measurement: (I have tested my FIFO and the sine datas are complete without any inerruption): This is a capture of my Android and my BLE Sniffer: Data packets are missing. 下图是从更长的时间中获取的:(我已经测试了我的FIFO,正弦数据完整无任何干扰):这是我的Android和BLE嗅探器的捕获:数据包丢失。

Sine & Spektrogram Image 正弦和频谱图图像

正弦和频谱图图像

Further measurements show that the errors do not occur sequentially, they can always be found at different times. 进一步的测量表明,错误不是顺序发生的,它们总是可以在不同的时间被发现。 (The Fifo Implementation must be correct) (Fifo实施必须正确)

Sine & Spektrogram Image 2 正弦和频谱图图像2

正弦和频谱图图像2

Since my phone and my Adafruit BLE sniffer have identical errors in the same place, the data packages on the board-side must be corrupt. 由于我的手机和Adafruit BLE嗅探器在同一位置有相同的错误,因此主板侧的数据包必须损坏。 I suspect they are lost at some protocol level (GAP maybe?). 我怀疑它们在某些协议级别上丢失了(也许是GAP?)。 Interestingly, errors affect at least 200 following bytes (256 bytes data are a complete sine). 有趣的是,错误会影响至少200个后续字节(256字节数据是一个完整的正弦)。 This means that at least 10 data packets each 20 Bytes would have to be in order to get such a graphic. 这意味着必须至少有10个数据包(每个20字节)才能获得这样的图形。

  • What options are there for continuously sending data via the BLE interface? 有哪些选项可以通过BLE接口连续发送数据?
  • Is it possible to send the data directly via L2CAP without GATT/ATT? 是否可以在没有GATT / ATT的情况下直接通过L2CAP发送数据?
  • Are there any more wireless, low power protocols that allow data streaming? 是否还有其他允许数据流传输的无线低功耗协议? (So ​​with acknowledgment like TCP for completeness and chronological correctness) (因此具有TCP的确认性,以确保完整性和时间正确性)

Best regards, Emin 最好的问候,艾敏

  • What options are there for continuously sending data via the BLE interface? 有哪些选项可以通过BLE接口连续发送数据?
  • Is it possible to send the data directly via L2CAP without GATT/ATT? 是否可以在没有GATT / ATT的情况下直接通过L2CAP发送数据?

BLE v4.1 introduced LE Connection-Oriented Channels which is a way to send data directly via L2CAP without GATT/ATT (think about network sockets). BLE v4.1引入了面向LE连接的通道 ,这是一种直接通过L2CAP发送数据而无需GATT / ATT(考虑网络套接字)的方法。 See also Bluetooth Core Specification Vol. 另请参阅“蓝牙核心规范”。 3 Part A Section 3.4. 3 A部分第3.4节。

The board you are using has a EM9301 BLE chip which seems to support BLE v4.1. 您正在使用的板上有一块EM9301 BLE芯片,该芯片似乎支持BLE v4.1。 However, the mbed library you are using doesn't allow you to use them. 但是,您使用的mbed库不允许您使用它们。 See here , you have an interface for connect/disconnect callbacks and GATT characteristics read/write/notification. 看到这里 ,您有一个用于连接/断开回调和GATT特性读/写/通知的接口。 Nothing about LE Connection-Oriented Channel. 与面向LE连接的通道无关。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM