藍牙開發(fā)
相關(guān)資料:
藍牙
通過網(wǎng)站下載藍牙開發(fā)套件
Bluetooth 和BLE
<h1>藍牙(Bluetooth)</h1>一種無線技術(shù)標(biāo)準(zhǔn),用來讓固定與移動設(shè)備撬统,在短距離間交換數(shù)據(jù)恋追,以形成個人局域網(wǎng)(PAN)苦囱。其使用短波特高頻(UHF)無線電波撕彤,經(jīng)由2.4至2.485 GHz的ISM頻段來進行通信羹铅。1994年由電信商愛立信發(fā)展出這個技術(shù)睦裳。它最初的設(shè)計,是希望創(chuàng)建一個RS-232數(shù)據(jù)線的無線通訊替代版本倒谷。
技術(shù)歷史
藍牙1.1標(biāo)準(zhǔn):為最早期版本渤愁,傳輸率約在748~810kb/s抖格,因是早期設(shè)計雹拄,容易受到同頻率之產(chǎn)品所干擾下影響通訊質(zhì)量滓玖。
藍牙1.2標(biāo)準(zhǔn):同樣是只有 748~810kb/s 的傳輸率势篡,但在加上了(改善 Software)抗干擾跳頻功能禁悠。
藍牙2.0標(biāo)準(zhǔn):1.2 的改良提升版粱坤,傳輸率約在 1.8M/s~2.1M/s比规,開始支持雙工模式——即一面作語音通訊蜒什,同時亦可以傳輸檔案/高質(zhì)素圖片灾常。
藍牙2.1標(biāo)準(zhǔn):2007年8月2日钞瀑,藍牙技術(shù)聯(lián)盟正式批準(zhǔn)了藍牙2.1版規(guī)范雕什,即“藍牙2.1+EDR”贷岸,可供未來的設(shè)備自由使用偿警。相對2.0版本主要是提高了待機時間2倍以上螟蒸,技術(shù)標(biāo)準(zhǔn)沒有根本性變化七嫌。
藍牙3.0標(biāo)準(zhǔn):2009年4月21日凡泣,藍牙技術(shù)聯(lián)盟頒布的新一代標(biāo)準(zhǔn)規(guī)范"Bluetooth Core Specification Version 3.0 High Speed"(藍牙核心規(guī)范3.0版 )鞋拟,核心是"Generic Alternate MAC/PHY"(AMP)一種全新的交替射頻技術(shù)贺纲,允許藍牙協(xié)議棧針對任一任務(wù)動態(tài)地選擇正確射頻猴誊。3.0的數(shù)據(jù)傳輸率提高到了大約24Mbps(即可在需要的時候調(diào)用802.11 WI-FI用于實現(xiàn)高速數(shù)據(jù)傳輸)。3.0的傳輸速速率是2.0的八倍澄成。
藍牙4.0標(biāo)準(zhǔn):于2010年7月7日正式發(fā)布墨状,是藍牙3.0+HS規(guī)范的補充肾砂,新版本的最大意義在于低功耗镐确,同時加強不同OEM廠商之間的設(shè)備兼容性辫塌,并且降低延遲掺喻,理論最高傳輸速度依然為24Mbps(即3MB/s),有效覆蓋范圍擴大到100米(之前的版本為10米)持隧。4.0是專門面向?qū)Τ杀竞凸亩加休^高要求的無線方案屡拨,可廣泛用于衛(wèi)生保健呀狼、體育健身哥艇、家庭娛樂貌踏、安全保障等諸多領(lǐng)域祖乳。
藍牙5.0標(biāo)準(zhǔn):藍牙5.0是由藍牙技術(shù)聯(lián)盟在2016年提出的藍牙技術(shù)標(biāo)準(zhǔn)眷昆,藍牙5.0針對低功耗設(shè)備速度有相應(yīng)提升和優(yōu)化,藍牙5.0結(jié)合wifi對室內(nèi)位置進行輔助定位伞访,提高傳輸速度厚掷,冒黑,增加有效工作距離抡爹。
頻率和信道
藍牙使用2.4GHZ ISM波段,Bluetooth有79個信道芒划,按0-78排序:
channel 00:2.402000000 Ghz
channel 01 : 2.403000000 Ghz
...
channel 78 : 2.480000000 Ghz
BLE 有40個頻道
藍牙規(guī)格
規(guī)格名稱 | 規(guī)格類型 | 分配編碼 | 規(guī)格級別 |
---|---|---|---|
警報類別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 | 已采納 |
警報狀態(tài) | 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 | 已采納 |
引導(dǎo)鍵盤輸入報告 | org.bluetooth.characteristic.boot_keyboard_input_report | 0x2A22 | 已采納 |
引導(dǎo)鍵盤輸出報告 | org.bluetooth.characteristic.boot_keyboard_output_report | 0x2A32 | 已采納 |
引導(dǎo)鼠標(biāo)輸入報告 | org.bluetooth.characteristic.boot_mouse_input_report | 0x2A33 | 已采納 |
CSC功能 | org.bluetooth.characteristic.csc_feature | 0x2A5C | 已采納 |
CSC測量 | org.bluetooth.characteristic.csc_measurement | 0x2A5B | 已采納 |
當(dāng)前時間 | 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 |
日光節(jié)約時間偏移 | org.bluetooth.characteristic.dst_offset | 0x2A0D | 已采納 |
準(zhǔn)確時間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 | 已采納 |
血糖測量環(huán)境 | 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監(jiān)管認(rèn)證數(shù)據(jù)表 | 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 | 已采納 |
當(dāng)?shù)貢r間信息 | 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 | 已采納 |
導(dǎo)航 | 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 | 已采納 |
定位質(zhì)量 | org.bluetooth.position_quality 0x2A69 | 已采納 | |
協(xié)議模式 | 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 | 已采納 |
振鈴器設(shè)定 | 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 | 已采納 |
系統(tǒng)ID | org.bluetooth.characteristic.system_id | 0x2A23 | 已采納 |
溫度測量 | org.bluetooth.characteristic.temperature_measurement | 0x2A1C | 已采納 |
溫度類型 | org.bluetooth.characteristic.temperature_type | 0x2A1D | 已采納 |
時間準(zhǔn)確度 | org.bluetooth.characteristic.time_accuracy | 0x2A12 | 已采納 |
時間源 | org.bluetooth.characteristic.time_source | 0x2A13 | 已采納 |
時間更新控制點 | org.bluetooth.characteristic.time_update_control_point | 0x2A16 | 已采納 |
時間更新狀態(tài) | org.bluetooth.characteristic.time_update_state | 0x2A17 | 已采納 |
日光節(jié)約時間的時間 | org.bluetooth.characteristic.time_with_dst | 0x2A11 | 已采納 |
時區(qū) | org.bluetooth.characteristic.time_zone | 0x2A0E | 已采納 |
射頻功率 | org.bluetooth.characteristic.tx_power_level | 0x2A07 | 已采納 |
未讀警報狀態(tài) | org.bluetooth.characteristic.unread_alert_status | 0x2A45 | 已采納 |
記憶碼 | UUID規(guī)格 | UUID | 參考規(guī)格 |
---|---|---|---|
?設(shè)備名稱? | uuid16 | 0x2A00 | 藍牙核心規(guī)格第3卷C部分第12.1節(jié) |
?外觀? | uuid16 | 0x2A01 | 藍牙核心規(guī)格第3卷C部分第12.2節(jié) |
?外置設(shè)備隱私標(biāo)志? | uuid16 | 0x2A02 | 藍牙核心規(guī)格第3卷C部分第12.3節(jié) |
?重新連接地址? | uuid16 | 0x2A03 | 藍牙核心規(guī)格第3卷C部分第12.4節(jié) |
?外置設(shè)備首選連接參數(shù)? | uuid16 | 0x2A04 | 藍牙核心規(guī)格第3卷C部分第12.5節(jié) |
?服務(wù)更改? | uuid16 | 0x2A05 | 藍牙核心規(guī)格第3卷G部分第7.1節(jié) |
藍牙UUID
UUID是“Universally Unique Identifier”的簡稱欧穴,通用識別碼的意思。對于服務(wù)泵殴,每個服務(wù)都有通用獨立且唯一的UUID與之對應(yīng)涮帘。
例:
藍牙串口服務(wù)
SerialPortServiceClass_UUID = '{00001101-0000-1000-8000-00805F9B34FB}'
LANAccessUsingPPPServiceClass_UUID = '{00001102-0000-1000-8000-00805F9B34FB}'
撥號網(wǎng)絡(luò)服務(wù)
DialupNetworkingServiceClass_UUID = '{00001103-0000-1000-8000-00805F9B34FB}'
信息同步服務(wù)
IrMCSyncServiceClass_UUID = '{00001104-0000-1000-8000-00805F9B34FB}'
SDP_OBEXObjectPushServiceClass_UUID = '{00001105-0000-1000-8000-00805F9B34FB}'
文件傳輸服務(wù)
OBEXFileTransferServiceClass_UUID = '{00001106-0000-1000-8000-00805F9B34FB}'
參考