Bluetooth low energy介绍

1. 介绍

Bluetooth low energy,也称BLE(低功耗蓝牙),在4.0规范中提出

BLE分为两种设备

- 单模(single-mode): Logo为「Bluetooth?Smart」
- 双模(dual-mode):   Logo为「Bluetooth?Smart Ready」

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

tip: 传统蓝牙的Logo为「Bluetooth?」

BLE与传统蓝牙的兼容性如下图所示

可以看出他们之间的通信规则如下(Bluetooth指代传统蓝牙,下同):

Smart Ready: Smart Ready、Bluetooth、Smart
Bluetooth:   Smart Ready、Bluetooth
Smart:       Smart Ready、Smart

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

2. 协议栈

BLE协议栈如下图所示

BLE协议栈由Controller和Host两部分组成

Profile和Service基于GAP和GATT

应用协议定义其使用的服务,说明是传感器端还是接收端

定义GATT的角色(Server/Client)和GAP的角色(Peripheral/Central)

单芯片方案中,Controller和Host、Profile及应用都在同一芯片中

网络控制器模式中,COntroller和Host运行在设备中,但是Profile和应用则在其他设备上,比如PC或者其他微控制器,可以通过UART、USB进行操作

双芯片模式中,Controller运行在一个控制器,而Host、Profile和应用运行在另一个控制器上

1 - PHY: 1Mbps自适应跳频GFSK,运行在2.4GHz频段。

2 - LL:  RF控制器,控制设备处于准备(standby)、广播(Advertising)、监听/扫描(scanning)、初始化(initiating)、连接(connected)这5中状态中的一种

3 - HCI: 为接口层,向上为主机提供软件应用程序接口(API),对外为外部硬件控制接口,可以通过串口、SPI、USB来实现设备控制

4 - L2CAP: 为上层提供数据封装服务,允许逻辑上的端到端数据通信

5 - SM: 提供配对和密钥分发服务,实现安全连接和数据交换

6 - GAP: 直接与应用程序或配置文件(Profiles)通信的接口,处理设备发现和连接相关服务。另外还处理安全特性的初始化

7 - ATT: 导出特定的数据(称为属性)到其他设备

8 - GATT: 定义了使用ATT的服务框架和配置文件(profiles)的结构。BLE中所有的数据通信都需要经过GATT

3. 链路层(LL)

3.1 链路状态机

链路层操作可以描述为链路状态机(The Link Layer State Machine)

链路状态机有如下五种状态

- Standby State:      准备,不传输或接受数据包
- Advertising State:  广播, advertiser,发送advertising channel packets,接受来自scanner的响应
- Scanning State:     监听/扫描, scanner,监听来自advertiser的advertising channel packets
- Initiating State:   初始化, initiator, 监听来自特殊设备的advertising channel packets,并进行初始化连接
- Connection State:   连接, 有两种角色: Master Role(从initiator进入)/Slave Role(从advertiser进入).csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }

链路状态机只允许处于五种状态之一

链路层可以有多个链路状态机,但至少有一个支持Advertising/Scanning State

处于Master Role的设备可以和多个Slave Role分时通信

处于Slave Role的设备只能和处于Master Role的设备通信

下图展示了允许和禁止的链路状态机和角色的组合

3.2 比特序(Bit Ordering)

在链路层规范中规定PDU比特序为Little Endian format

3.3 设备地址(Device Address)

设备地址可以是公共地址或者随机地址,长度为48 bits

- 公共地址: 采用IEEE 802-2001 standard的48-bit universal LAN MAC addresses

- 随机地址: 详细要求可参考规范

3.4 物理信道(Physical Channel)

BLE RF信道被定义为两种: advertising and data

- advertising信道: 使用3个RF信道用来发现设备,初始化连接和广播数据
- data信道:        则使用多达37个RF信道用于两个连接设备间通信

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

RF Channel和Advertising/Data channel Index对应关系如下图

时间: 2024-08-07 00:42:43

Bluetooth low energy介绍的相关文章

Bluetooth Low Energy 介绍

1.简介 BLE(Bluetooth Low Energy,低功耗蓝牙)是对传统蓝牙BR/EDR技术的补充.尽管BLE和传统蓝牙都称之为蓝牙标准,且共享射频,但是,BLE是一个完全不一样的技术.BLE不具备和传统蓝牙BR/EDR的兼容性.它是专为小数据率.离散传输的应用而设计的.通信距离上也有改变,传统蓝牙的传输距离几十米到几百米不等,BLE则规定为100米. 2.低功耗蓝牙(BLE) 低功耗蓝牙分为单模(Bluetooth Smart)和双模(Bluetooth Smart Ready)两种设

Bluetooth Low Energy(低功耗蓝牙)-For蓝牙4.x

此文翻译至Android API里的Bluetooth Low Energy,希望对大家有所帮助.谢谢. Android4.3(API版本18)介绍了内置平台支持BLE的中心角色,并且提供了相关API,高大尚的程序员们可以使用这些API来扫描设备.查询服务(指服务端进程).读写特性值(指特定的字符).与经典蓝牙不同的是,BLE的设计是为了提供显著的低功耗支持.这使得Android应用可以仅需很低的功耗与BLE设备进行通信,心跳频率(不是人的心跳,是指发送心跳包检测设备是否还在),监听适配设备等等

Android as Bluetooth Low Energy Peripherial (GATT server).

I demonstrate how to write a simple BLE peripheral application in Android here. I am bad in Android development, The UI would be very ugly, but the code work: Currently(5/25/2015), the code could be running in Nexus 6 or Nexus 9 only based on my test

Overview and Evaluation of Bluetooth Low Energy: An Emerging Low-Power Wireless Technology

转自:http://www.mdpi.com/1424-8220/12/9/11734/htm Sensors 2012, 12(9), 11734-11753; doi:10.3390/s120911734 Article Carles Gomez 1,*, Joaquim Oller 2 and Josep Paradells 2 1 Universitat Politècnica de Catalunya/Fundació i2Cat, C/Esteve Terradas, 7, Cast

Bluetooth Low Energy 嗅探

0x00 前言 如果你打开这篇文章时期望看到一些新的东西,那么很抱歉这篇文章不是你在找的那篇文章.因为严格的来说这只是一篇整理文.里面没有任何我的发现,也没有我的实际案例.因为我手头上暂时还没有一个有趣的蓝牙低功耗设备.整篇文章的基础都建立在mike ryan这几年公布的演讲内容之上. 0x01 BLE BLE是什么?BLE全称bluetooth low energy中文又称蓝牙低功耗.最早被人们所知道是在2010年的时候出现在了bluetooth4的spec当中.由于它比传统的蓝牙更能控制功耗

基于蓝牙4.0(Bluetooth Low Energy)胎压监测方案设计

基于一种新的蓝牙技术——蓝牙4.0(Bluetooth Low Energy)新型的胎压监测系统(TPMS)的设计方案.鉴于蓝牙4.0(Bluetooth Low Energy)的低成本.低功耗.高稳定性等特点,适用于胎压监测系统,目前业界还没有出现类似的设计方案.本设计为直接式胎压监测系统,即在车辆轮胎上安装压力和温度传感器,通过蓝牙传输方式将胎压的信息传送给搭载蓝牙4.0的iPod.iPhone以及iPad,并在所安装的APP软件上显示实时数据.由此可实时监测车辆的胎压情况,并在胎压异常情况

Android Bluetooth Low Energy官方文档翻译

Android Bluetooth Low Energy官方文档翻译 Android4.3(API18)为Bluetooth Low Energy(简称BLE)的核心功能提供了平台支撑,App能够通过它用来发现设备,查询服务,以及读写特性.与传统的蓝牙相比,BLE设计的最大特征就是低功耗.这使得Android的APP能够与具备低功耗的BLE设备进行通信,比如距离传感器,心跳检测,健身设备等等. 关键术语和概念 下面是一些关于BLE的核心术语和概念 Generic Attribute Profil

Android bluetooth low energy (ble) writeCharacteristic delay callback

I am implementing a application on Android using BLE Api (SDK 18), and I have a issue that the transfer data process is delay very slow. This is my log. 03-12 16:20:05.121: D/BluetoothGatt(13578): writeCharacteristic() - uuid: ... 03-12 16:20:06.272:

Android Bluetooth Low Energy(Android低功耗蓝牙)

Android 4.3(API Level 18)开始引入Bluetooth Low Energy(BLE,低功耗蓝牙)的核心功能并提供了相应的API,应用程序通过这些api可以扫描设备.查询services,读写设备的characteristics(属性特征).对比传统的蓝牙,BLE的设计能够显著减低功耗.这让Android应用程序与BLE设备之间的低功耗通讯成为可能,例如距离传感器.心率监视器.健身设备等等. 1.关键术语和概念 1.1 下面是一些BLE关键术语和概念的摘要: * Gener