蓝牙开发
相关资料:
蓝牙
通过网站下载蓝牙开发套件
Bluetooth 和BLE
<h1>蓝牙(Bluetooth)</h1>一种无线技术标准,用来让固定与移动设备,在短距离间交换数据,以形成个人局域网(PAN)。其使用短波特高频(UHF)无线电波,经由2.4至2.485 GHz的ISM频段来进行通信。1994年由电信商爱立信发展出这个技术。它最初的设计,是希望创建一个RS-232数据线的无线通讯替代版本。
技术历史
蓝牙1.1标准:为最早期版本,传输率约在748~810kb/s,因是早期设计,容易受到同频率之产品所干扰下影响通讯质量。
蓝牙1.2标准:同样是只有 748~810kb/s 的传输率,但在加上了(改善 Software)抗干扰跳频功能。
蓝牙2.0标准:1.2 的改良提升版,传输率约在 1.8M/s~2.1M/s,开始支持双工模式——即一面作语音通讯,同时亦可以传输档案/高质素图片。
蓝牙2.1标准:2007年8月2日,蓝牙技术联盟正式批准了蓝牙2.1版规范,即“蓝牙2.1+EDR”,可供未来的设备自由使用。相对2.0版本主要是提高了待机时间2倍以上,技术标准没有根本性变化。
蓝牙3.0标准:2009年4月21日,蓝牙技术联盟颁布的新一代标准规范"Bluetooth Core Specification Version 3.0 High Speed"(蓝牙核心规范3.0版 ),核心是"Generic Alternate MAC/PHY"(AMP)一种全新的交替射频技术,允许蓝牙协议栈针对任一任务动态地选择正确射频。3.0的数据传输率提高到了大约24Mbps(即可在需要的时候调用802.11 WI-FI用于实现高速数据传输)。3.0的传输速速率是2.0的八倍。
蓝牙4.0标准:于2010年7月7日正式发布,是蓝牙3.0+HS规范的补充,新版本的最大意义在于低功耗,同时加强不同OEM厂商之间的设备兼容性,并且降低延迟,理论最高传输速度依然为24Mbps(即3MB/s),有效覆盖范围扩大到100米(之前的版本为10米)。4.0是专门面向对成本和功耗都有较高要求的无线方案,可广泛用于卫生保健、体育健身、家庭娱乐、安全保障等诸多领域。
蓝牙5.0标准:蓝牙5.0是由蓝牙技术联盟在2016年提出的蓝牙技术标准,蓝牙5.0针对低功耗设备速度有相应提升和优化,蓝牙5.0结合wifi对室内位置进行辅助定位,提高传输速度,,增加有效工作距离。
频率和信道
蓝牙使用2.4GHZ ISM波段,Bluetooth有79个信道,按0-78排序:
channel 00:2.402000000 Ghz
channel 01 : 2.403000000 Ghz
...
channel 78 : 2.480000000 Ghz
BLE 有40个频道
蓝牙规格
规格名称 | 规格类型 | 分配编码 | 规格级别 |
---|---|---|---|
警报类别ID | org.bluetooth.characteristic.alert_category_id | 0x2A43 | 已采纳 |
警报类别ID位掩码 | org.bluetooth.characteristic.alert_category_id_bit_mask | 0x2A42 | 已采纳 |
警报级别 | org.bluetooth.characteristic.alert_level | 0x2A06 | 已采纳 |
警报通知控制点 | org.bluetooth.characteristic.alert_notification_control_point | 0x2A44 | 已采纳 |
警报状态 | org.bluetooth.characteristic.alert_status | 0x2A3F | 已采纳 |
Appearance | org.bluetooth.characteristic.gap.appearance | 0x2A01 | Adopted |
电池电量 | org.bluetooth.characteristic.battery_level | 0x2A19 | 已采纳 |
血压功能 | org.bluetooth.characteristic.blood_pressure_feature | 0x2A49 | 已采纳 |
血压测量 | org.bluetooth.characteristic.blood_pressure_measurement | 0x2A35 | 已采纳 |
人体传感器定位 | org.bluetooth.characteristic.body_sensor_location | 0x2A38 | 已采纳 |
引导键盘输入报告 | org.bluetooth.characteristic.boot_keyboard_input_report | 0x2A22 | 已采纳 |
引导键盘输出报告 | org.bluetooth.characteristic.boot_keyboard_output_report | 0x2A32 | 已采纳 |
引导鼠标输入报告 | org.bluetooth.characteristic.boot_mouse_input_report | 0x2A33 | 已采纳 |
CSC功能 | org.bluetooth.characteristic.csc_feature | 0x2A5C | 已采纳 |
CSC测量 | org.bluetooth.characteristic.csc_measurement | 0x2A5B | 已采纳 |
当前时间 | org.bluetooth.characteristic.current_time | 0x2A2B | 已采纳 |
自行车功率控制点 | bluetooth.characteristic.cycling_power_control_point | 0x2A66 | 已采纳 |
自行车功率特征 | org.bluteooth.characteristic.cycling_power_feature | 0x2A65 | 已采纳 |
自行车功率测量 | org.blueeooth.cycling_power_measurement | 0x2A63 | 已采纳 |
自行车功率矢量 | org.bluetooth.characteristic.cycling_power_vector | 0x2A64 | 已采纳 |
日期时间 | org.bluetooth.characteristic.date_time | 0x2A08 | 已采纳 |
星期日期时间 | org.bluetooth.characteristic.day_date_time | 0x2A0A | 已采纳 |
星期 | org.bluetooth.characteristic.day_of_week | 0x2A09 | 已采纳 |
Device Name | org.bluetooth.characteristic.gap.device_name | 0x2A00 | Adopted |
日光节约时间偏移 | org.bluetooth.characteristic.dst_offset | 0x2A0D | 已采纳 |
准确时间256 | org.bluetooth.characteristic.exact_time_256 | 0x2A0C | 已采纳 |
固件修订字符串 | org.bluetooth.characteristic.firmware_revision_string | 0x2A26 | 已采纳 |
血糖功能 | org.bluetooth.characteristic.glucose_feature | 0x2A51 | 已采纳 |
血糖测量 | org.bluetooth.characteristic.glucose_measurement | 0x2A18 | 已采纳 |
血糖测量环境 | org.bluetooth.characteristic.glucose_measurement_context | 0x2A34 | 已采纳 |
硬件修订字符串 | org.bluetooth.characteristic.hardware_revision_string | 0x2A27 | 已采纳 |
心率控制点 | org.bluetooth.characteristic.heart_rate_control_point | 0x2A39 | 已采纳 |
心率测量 | org.bluetooth.characteristic.heart_rate_measurement | 0x2A37 | 已采纳 |
HID控制点 | org.bluetooth.characteristic.hid_control_point | 0x2A4C | 已采纳 |
HID信息 | org.bluetooth.characteristic.hid_information | 0x2A4A | 已采纳 |
IEEE 11073-20601监管认证数据表 | org.bluetooth.characteristic.ieee_11073-20601_regulatory_certification_data_list | 0x2A2A | 已采纳 |
中间体套囊压力 | org.bluetooth.characteristic.intermediate_blood_pressure | 0x2A36 | 已采纳 |
中间体温度 | org.bluetooth.characteristic.intermediate_temperature | 0x2A1E | 已采纳 |
LN控制点 | org.bluetooth.ln_control_point | 0x2A6B | 已采纳 |
LN功能 | org.bluetooth.characteristic.ln_feature | 0x2A6A | 已采纳 |
当地时间信息 | org.bluetooth.characteristic.local_time_information | 0x2A0F | 已采纳 |
定位和速度 | org.bluetooth.location_and_speed | 0x2A67 | 已采纳 |
制造商名称字符串 | org.bluetooth.characteristic.manufacturer_name_string | 0x2A29 | 已采纳 |
测量间隔 | org.bluetooth.characteristic.measurement_interval | 0x2A21 | 已采纳 |
型号字符串 | org.bluetooth.characteristic.model_number_string | 0x2A24 | 已采纳 |
导航 | org.bluetooth.characteristic.navigation | 0x2A68 | 已采纳 |
新警报 | org.bluetooth.characteristic.new_alert | 0x2A46 | 已采纳 |
Peripheral Preferred Connection Parameters | org.bluetooth.characteristic.gap.peripheral_preferred_connection_parameters | 0x2A04 | Adopted |
Peripheral Privacy Flag | org.bluetooth.characteristic.gap.peripheral_privacy_flag | 0x2A02 | Adopted |
PnP ID | org.bluetooth.characteristic.pnp_id | 0x2A50 | 已采纳 |
定位质量 | org.bluetooth.position_quality 0x2A69 | 已采纳 | |
协议模式 | org.bluetooth.characteristic.protocol_mode | 0x2A4E | 已采纳 |
Reconnection Address | org.bluetooth.characteristic.gap.reconnection_address | 0x2A03 | Adopted |
记录存取控制点 | org.bluetooth.characteristic.record_access_control_point | 0x2A52 | 已采纳 |
参考时间信息 | org.bluetooth.characteristic.reference_time_information | 0x2A14 | 已采纳 |
报告 | org.bluetooth.characteristic.report | 0x2A4D | 已采纳 |
报告地图 | org.bluetooth.characteristic.report_map | 0x2A4B | 已采纳 |
振铃器控制点 | org.bluetooth.characteristic.ringer_control_point | 0x2A40 | 已采纳 |
振铃器设定 | org.bluetooth.characteristic.ringer_setting | 0x2A41 | 已采纳 |
RSC功能 | org.bluetooth.characteristic.rsc_feature | 0x2A54 | 已采纳 |
RSC测量 | org.bluetooth.characteristic.rsc_measurement | 0x2A53 | 已采纳 |
SC控制点 | org.bluetooth.characteristic.sc_control_point | 0x2A55 | 已采纳 |
扫描间隔窗口 | org.bluetooth.characteristic.scan_interval_window | 0x2A4F | 已采纳 |
扫描刷新 | org.bluetooth.characteristic.scan_refresh | 0x2A31 | 已采纳 |
传感器定位 | org.bluetooth.characteristic.sensor_location | 0x2A5D | 已采纳 |
序列号字符串 | org.bluetooth.characteristic.serial_number_string | 0x2A25 | 已采纳 |
Service Changed | org.bluetooth.characteristic.gatt.service_changed | 0x2A05 | Adopted |
软件修订字符串 | org.bluetooth.characteristic.software_revision_string | 0x2A28 | 已采纳 |
获支持的新警报类别 | org.bluetooth.characteristic.supported_new_alert_category | 0x2A47 | 已采纳 |
获支持的未读警报类别 | org.bluetooth.characteristic.supported_unread_alert_category | 0x2A48 | 已采纳 |
系统ID | org.bluetooth.characteristic.system_id | 0x2A23 | 已采纳 |
温度测量 | org.bluetooth.characteristic.temperature_measurement | 0x2A1C | 已采纳 |
温度类型 | org.bluetooth.characteristic.temperature_type | 0x2A1D | 已采纳 |
时间准确度 | org.bluetooth.characteristic.time_accuracy | 0x2A12 | 已采纳 |
时间源 | org.bluetooth.characteristic.time_source | 0x2A13 | 已采纳 |
时间更新控制点 | org.bluetooth.characteristic.time_update_control_point | 0x2A16 | 已采纳 |
时间更新状态 | org.bluetooth.characteristic.time_update_state | 0x2A17 | 已采纳 |
日光节约时间的时间 | org.bluetooth.characteristic.time_with_dst | 0x2A11 | 已采纳 |
时区 | org.bluetooth.characteristic.time_zone | 0x2A0E | 已采纳 |
射频功率 | org.bluetooth.characteristic.tx_power_level | 0x2A07 | 已采纳 |
未读警报状态 | org.bluetooth.characteristic.unread_alert_status | 0x2A45 | 已采纳 |
记忆码 | UUID规格 | UUID | 参考规格 |
---|---|---|---|
«设备名称» | uuid16 | 0x2A00 | 蓝牙核心规格第3卷C部分第12.1节 |
«外观» | uuid16 | 0x2A01 | 蓝牙核心规格第3卷C部分第12.2节 |
«外置设备隐私标志» | uuid16 | 0x2A02 | 蓝牙核心规格第3卷C部分第12.3节 |
«重新连接地址» | uuid16 | 0x2A03 | 蓝牙核心规格第3卷C部分第12.4节 |
«外置设备首选连接参数» | uuid16 | 0x2A04 | 蓝牙核心规格第3卷C部分第12.5节 |
«服务更改» | uuid16 | 0x2A05 | 蓝牙核心规格第3卷G部分第7.1节 |
蓝牙UUID
UUID是“Universally Unique Identifier”的简称,通用识别码的意思。对于服务,每个服务都有通用独立且唯一的UUID与之对应。
例:
蓝牙串口服务
SerialPortServiceClass_UUID = '{00001101-0000-1000-8000-00805F9B34FB}'
LANAccessUsingPPPServiceClass_UUID = '{00001102-0000-1000-8000-00805F9B34FB}'
拨号网络服务
DialupNetworkingServiceClass_UUID = '{00001103-0000-1000-8000-00805F9B34FB}'
信息同步服务
IrMCSyncServiceClass_UUID = '{00001104-0000-1000-8000-00805F9B34FB}'
SDP_OBEXObjectPushServiceClass_UUID = '{00001105-0000-1000-8000-00805F9B34FB}'
文件传输服务
OBEXFileTransferServiceClass_UUID = '{00001106-0000-1000-8000-00805F9B34FB}'
参考