1. Core Bluetooth 概述
- BLE -> Bluetooth Low Energy (特指蓝牙4.0开始)
- iOS6 开始支持蓝牙4.0
- Core Bluetooth框架用来支持BLE的开发
- 蓝牙4.0以下需要注册MFI,使用MFI协议进行开发
iOS 10.0 必须在 Info.plist加上[NSBluetoothPeripheralUsageDescription]
2.中心设备和外设交互

从上图可以看出,手机或者MAC可以做为中心设备,心率设备作为外设。
外设发起发起广播,中心设备收到广播会去扫描外设和监听收到的信息
中心设备类似开发中的App客户端 (向服务端索取数据)
外设类似服务端 (有数据)
3.外设的数据结构

一个外设有多个service,一个service对应多个Characteristic,一个characteristic对应多个Descriptors

网友评论