藍牙開發(fā)入門

藍牙開發(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}'

參考

低功耗藍牙(BLE)入門

HackRF

基于HackRF的低功耗藍牙(BTLE)Packet Sniffer / Scanner

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市笑诅,隨后出現(xiàn)的幾起案子调缨,更是在濱河造成了極大的恐慌,老刑警劉巖吆你,帶你破解...
    沈念sama閱讀 218,546評論 6 507
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件弦叶,死亡現(xiàn)場離奇詭異,居然都是意外死亡早处,警方通過查閱死者的電腦和手機湾蔓,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,224評論 3 395
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來砌梆,“玉大人默责,你說我怎么就攤上這事∠贪” “怎么了桃序?”我有些...
    開封第一講書人閱讀 164,911評論 0 354
  • 文/不壞的土叔 我叫張陵,是天一觀的道長烂瘫。 經(jīng)常有香客問我媒熊,道長,這世上最難降的妖魔是什么坟比? 我笑而不...
    開封第一講書人閱讀 58,737評論 1 294
  • 正文 為了忘掉前任芦鳍,我火速辦了婚禮,結(jié)果婚禮上葛账,老公的妹妹穿的比我還像新娘柠衅。我一直安慰自己,他們只是感情好籍琳,可當(dāng)我...
    茶點故事閱讀 67,753評論 6 392
  • 文/花漫 我一把揭開白布菲宴。 她就那樣靜靜地躺著,像睡著了一般趋急。 火紅的嫁衣襯著肌膚如雪喝峦。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,598評論 1 305
  • 那天呜达,我揣著相機與錄音谣蠢,去河邊找鬼。 笑死,一個胖子當(dāng)著我的面吹牛漩怎,可吹牛的內(nèi)容都是我干的勋颖。 我是一名探鬼主播,決...
    沈念sama閱讀 40,338評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼勋锤,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了侥祭?” 一聲冷哼從身側(cè)響起叁执,我...
    開封第一講書人閱讀 39,249評論 0 276
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎矮冬,沒想到半個月后谈宛,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,696評論 1 314
  • 正文 獨居荒郊野嶺守林人離奇死亡胎署,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,888評論 3 336
  • 正文 我和宋清朗相戀三年吆录,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片琼牧。...
    茶點故事閱讀 40,013評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡恢筝,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出巨坊,到底是詐尸還是另有隱情撬槽,我是刑警寧澤,帶...
    沈念sama閱讀 35,731評論 5 346
  • 正文 年R本政府宣布趾撵,位于F島的核電站侄柔,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏占调。R本人自食惡果不足惜暂题,卻給世界環(huán)境...
    茶點故事閱讀 41,348評論 3 330
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望究珊。 院中可真熱鬧薪者,春花似錦、人聲如沸苦银。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,929評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽幔虏。三九已至纺念,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間想括,已是汗流浹背陷谱。 一陣腳步聲響...
    開封第一講書人閱讀 33,048評論 1 270
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人烟逊。 一個月前我還...
    沈念sama閱讀 48,203評論 3 370
  • 正文 我出身青樓肮帐,卻偏偏與公主長得像,于是被迫代替她去往敵國和親纵朋。 傳聞我的和親對象是個殘疾皇子膳汪,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,960評論 2 355

推薦閱讀更多精彩內(nèi)容