Xiaopei's DokuWiki

These are the good times in your life,
so put on a smile and it'll be alright

User Tools

Site Tools


it:ble

蓝牙 BLE, Bluetooth low energy, Bluetooth LE, Bluetooth Smart®

bluez

# 扫描设备
$ sudo hcitool lescan
 
# 交互式操作 ble 设备
$ sudo gatttool -b <bluetooth_addr> -I

Glossary

  • SIG, Bluetooth Special Interest Group, 蓝牙技术联盟
  • Peripheral 外围设备,如耳机
  • Central 主设备,如手机
  • GAP, Generic Access Profile, it controls connections and advertising in Bluetooth
    • Advertising data: mandatory, basic, intelval 由 peripheral 发送
    • Scan request/response: optional, central devices request, peripheral response
  • ATT (Attribute Protocol), wire protocol, 底层
    • The sole building block of ATT is the attribute. An attribute is composed by three elements:
      • a 16-bit handle;
      • an UUID which defines the attribute type;
      • a value of a certaing length.
  • GATT (Generic Attribute Profile) 上层,定义了 Services and Characteristics 这种组织结构
    • GATT 使用 ATT 来 store Services, Characteristics and related data
    • GATT is exclusive,a BLE peripheral can only be connected to one central device at a time
    • 双向

refs

BLE一开始就是为了省电及传资料为最主要目的,与传统BT包山包海大不同,传统BT不仅支援资料传输、语音通话、立体声、HID,以及各式各样的控制。但BLE所制定的profile只是要改善BT其中一部份而已,但这部份却足以应用更加多元,让这些新的profile更加省电。比如HDP及HID,明显看得出来这些profile都是偏向小资料传输的,所以BLE并不支援声音的传送唷。

传统的BT为了要支援许许多多的profile,制定了好几种的protocol,所以所传送的packet也有好几种,就连我现在也仍未搞懂所有的规范啦;BLE的设计就简单多了,只有一种,ATT,只有一种packet structure,一个packet formats,当中参数不同来决定是Advertising还是Data packets,一切的一切都是为了简单再简单,省电再省电啦,封包小了,步骤简化了,当然就省电啦。

node.js

it/ble.txt · Last modified: 2014/10/28 10:24 by admin