Chinaunix首页 | 论坛 | 博客
  • 博客访问: 112856
  • 博文数量: 23
  • 博客积分: 245
  • 博客等级: 二等列兵
  • 技术积分: 200
  • 用 户 组: 普通用户
  • 注册时间: 2012-06-11 17:18
文章分类

全部博文(23)

文章存档

2016年(3)

2013年(16)

2012年(4)

我的朋友

分类: 嵌入式

2016-07-21 08:58:55

Bluetooth Low Energy (BLE) is designed for low data rate applications, like control signals, sensor readings, etc. However, occasionally there is a need for higher data rates with BLE. The theoretical over-the-air data rate of BLE is 1 Mb/s, but that’s the PHY layer transfer rate between devices and doesn’t account for protocol overhead. The maximum achievable data rate is closer to 10kB/s but this is device dependent, as we’ll explain below.

Contents

 [] 

BLE Connection Parameters

There are multiple connection parameters (defined in Bluetooth 4.0 specification, Volume 3, Part A, Section 4.20) that will determine the throughput. Keep in mind that higher throughput will result in more power consumption.

Connection Interval

This defines how often that the central communicates with the peripheral. There can be a maximum of four packets sent per connection interval, and each packet can have up to 20B of payload. According to the BLE specification, the allowable range for connection parameters is from 7.5mSec to 4000mSec. The Connection Interval is the parameter that most affects data rate. Think of the Connection Interval as the train schedule: for example, trains leave the station every half hour. Each train can have 1-4 cars, and each car can hold 0 to 20 bytes. So if you have a 20 ms Connection Interval, then the theoretical maximum for sending a message and receiving the ACK is 80 bytes (of data) in 40 mS (one Connection Interval to send, plus one Interval to receive the ACK). But trains leave whether full or not. So you might only send 20 bytes every 80 mS — or less.

Slave latency

This is the number of connection intervals that the slave is allowed to skip. For example, if the connection interval is 20mSec and slave latency is 4, then if the peripheral wants to then it only needs to answer the master every 80mSec. Slave latency is useful if you want to mostly stay asleep, but then burst out data at a faster rate occasionally. In this case, the peripheral only needs to respond to the master every 80mSec to keep the connection alive, but if it has a lot of data then it can send data every 20mSec. Slave Latency is any value between 0 and 499, though it cannot exceed: ((supervisionTimeout / connInterval) – 1)

Connection Supervision Timeout

This parameter specifies the maximum amount of time that either the master or slave can go before receiving a link-layer packet. Both slave and master device maintain their own “Supervision timer”, which resets to zero every time a packet is received. If supervision timer ever reaches the supervision timeout, the device considers the connection lost, and exits the connection state (returning to the advertising, scanning, or standby state). The Connection Supervision Timeout is in the range of 100ms and 32.0s. It Must be larger than (1 + slaveLatency) * (ConnInterval).

Packets Per Connection Interval

This is the number of packets that can be sent in each connection interval. According to the Bluetooth specification, the maximum packets per connection interval is 6, but iOS limits this to 4.

Connection Parameters between two modules

Here you may set the Connection Parameters to their maximum values, with a Connection Interval as low as 7.5mSec to give the highest throughput.

Connection Parameters for iOS

Recall earlier where we mentioned that the maximum achievable data rate is device dependent. According to the Apple, the connection parameters are restricted as follows:

  • Interval Max * (Slave Latency + 1) ≤ 2 seconds Interval Min ≥ 20 ms (not 7.5mSec)
  • Interval Min + 20 ms ≤ Interval Max Slave Latency ≤ 4 connSupervisionTimeout ≤ 6 seconds
  • Interval Max * (Slave Latency + 1) * 3 < connSupervisionTimeout

If Bluetooth Low Energy HID is one of the connected services of an accessory, connection interval down to 11.25 ms may be accepted by the Apple product.

Theoretical maximum throughput for iOS is: 80B per 40mSec, which results in 2kB/Sec. Using Notifications / Indications may increase this.

Connection Parameters for Android

Connection Parameters for Android are device dependent, but some devices can support a Connection Interval as short as 7.5mSec. YMMV.

Graph of Throughput

Throughput

阅读(1108) | 评论(0) | 转发(0) |
0

上一篇:ble低功耗蓝牙走过的那些坑

下一篇:没有了

给主人留下些什么吧!~~