بلوتوث منخفض الطاقة: دليل شامل للمبتدئين

إن إنشاء خدمة مخصصة وأكثر من ذلك أن عميل Bluetooth منخفض الطاقة هو أمر معصوب العينين. كان هذا هو الحال بالنسبة لي على الأقل منذ 4 سنوات ، عندما بدأت للتو في العمل مع أجهزة BLE. الآن يوفر كل مشروع لي تقريبًا استخدام هذا البروتوكول ، لذلك كان علي أن أفهمه في وقت ما لفترة طويلة ومؤلمة. 





ساعد كتاب محمد عفان "مقدمة إلى Bluetooth Low Energy" وسلسلة من المنشورات على Novel Bits على وضع كل شيء على الرفوف . بالنسبة لي شخصيًا ، كان هذا الكتاب اكتشافًا حقيقيًا. في البداية ، قمت بترجمتها إلى اللغة الروسية لزملائي الذين ليس لديهم خبرة في BLE. بموافقة المؤلف (جزيل الشكر له) قررت أن أنشر عملي هنا. آمل أن تكون الترجمة مفيدة.





هذا هو الجزء الأول من الترجمة (سيكون هناك 5 منها) ، والذي يوضح ماهية BLE وإمكانياته واختلافه عن Bluetooth Classic ، ويصف أيضًا بنية البروتوكول.





عن المؤلف

2006 . , Allegion (Schlage locks), Motorola, Technicolor, Audiovox, Denon & Marantz Group. , : , , ..





2015 , Novel Bits, LLC, web-, , Bluetooth Low Energy.





: mohammad@novelbits.io LinkedIn.





Bluetooth Low Energy

1. Bluetooth Low Energy?

Bluetooth , , , . , Bluetooth . : , , ,   !





Ericsson 1994 . «», 10 . 





Bluetooth: 





  • Bluetooth Classic (BR/EDR), , - ;





  • Bluetooth Low Energy (BLE), .. Bluetooth , Bluetooth 4.0. , ( ) , (, , ).





, . Bluetooth Classic , BLE. , , , ( Dual mode Bluetooth devices), .





الشكل 1: أنواع أجهزة البلوتوث
.1: Bluetooth-

BLE:





  • Bluetooth Bluetooth (Classic BLE), , BLE;





  • BLE 4.0 Bluetooth, 2010 ;





  • BLE Bluetooth Smart, BTLE Bluetooth 4.0, , Bluetooth;





  • Bluetooth Classic BLE – 2.4 , ISM-.





(IoT) , BLE ( Bluetooth Classic) . 2016 Bluetooth Special Interest Group (SIG), , Bluetooth 5.0 ( , Bluetooth 5). , , BLE, Bluetooth Classic.





, Bluetooth − Bluetooth Mesh. Bluetooth Mesh 2017 BLE. BLE (, ), Bluetooth. .





, , BLE :





الشكل 2: تاريخ BLE
.2: BLE

BLE

BLE :





  • 2.400 - 2.4835 .





  • 40 2 .





  • ( Bluetooth 5) 2/.





  • , . , , , . : 10-30 .





  • . , . BLE- 15 .





  • BLE . , .





  • , , BLE AES-CCM 128 .





  • BLE . BLE BLE. , , .





  • Bluetooth ( BLE) . . , Bluetooth 5 LE Bluetooth 4.1 LE, , 4.2 , . , , , , Bluetooth.





Bluetooth Classic BLE

, Bluetooth Bluetooth , , . , .





:





1. Bluetooth Classic BLE





Bluetooth Classic





BLE





,





, ,





, ( 3 /, BLE 5 2 /)









79





40





32





3 , Bluetooth Classic





2010 BLE . 2016 Bluetooth 5, , BLE. , 4 8 .





BLE

, BLE . , BLE .





4.1. BLE

BLE , .. , . Bluetooth. Bluetooth 4.2 , 1 /. Bluetooth 5 PHY (Physical Layer, ). 1 / 2 / . 500 125 /. , Bluetooth 5.





:





  • : Bluetooth 150 . .





  • : , . , .





  • : , . , , .





  • : , .





BLE , , , . , BLE:





  • ISM- 2.4 , , , .





  • .





  • , , .





  • , , .





-

, BLE-, BLE, IP-. .





4.2 BLE

BLE IoT.





:





  • ;





, BLE . , .





  • ;





. ( 7500 35000 ). BLE, (4.0, 4.1, 4.2, 5) Bluetooth .





  • ;





  • , – . , BLE ZigBee, Z-Wave Thread.





4.3 BLE

, , , BLE :





  • ;





BLE , , , .





  • ;





, BLE , , .





, WiFi BLE WiFi Direct. , WiFi , . .





  • ;





,, . , , BLE , . .





  • ;





, ( WiFi ), BLE .





  • .





. – , . , . BLE , , BLE « ».





BLE. , , , , BLE , :





  • ;





  • (.: BLE 5.2);





  • , .





BLE

, BLE. – , .





الشكل 3: الهندسة المعمارية BLE
.3: BLE

, . – GAP (Generic Access Profile), GATT (Generic Attribute Profile) Security Manager – .





/ (GAP) (GATT) – , , , .





, , , BLE- , . , .





-

:





  • (GAP, Generic Access Profile);





  • (GATT, Generic Attribute Profile);





  • (ATT, Attribute Protocol);





  • (SM, Security Manager);





  • (L2CAP, Logical Link Control and Adaptation Protocol);





  • - (HCI, Host Controller Interface), .





:





  • (PHY, Physical Layer);





  • (Link Layer);





  • (DTM, Direct Test Mode);





  • - (HCI, Host Controller Interface), .





BLE

(PHY)

PHY , , , . BLE ISM- (2.4 ), 40 2 , :





الشكل 4: طيف التردد وقنوات الراديو في BLE
.4: BLE

, , 37 . “ ”, .





( ). . , . , , , . .





, BLE:





  • (FHSS, Frequency Hopping Spread Spectrum), . .





  • :





: 100 (+20 ) 5 , 10 (+10 ) 4.2 ;





: 0.01 (-20 ).





  • Bluetooth (4.0, 4.1 4.2) – 1 /. (PHY) 1M PHY , Bluetooth 5. Bluetooth 5 PHY:





    • 2 / PHY, Bluetooth.





    • PHY, .





PHY , Bluetooth 5.





( -, ). , BLE. - , , .





, BLE:





  • (Advertising);





  • (Scanning);





  • .





, . , , .





, :





الشكل 5: حالات طبقة الارتباط
.5:
  • Standby: , .





  • Advertising: , .





  • Scanning: , , .





  • Initiating: , , advertising.





  • Connected: , . , scanning , . , , .





  .





Bluetooth :





Bluetooth- 48- , MAC-. : .





:





, . IEEE (, MAC- WiFi Ethernet).





:





, ( ), , . . :









    • ;





    • ;





    • .





  • :





    – :





    • , ;





    • .





    – :





    • ;





    • (IRK, Identity Resolving Key) ;





    • ( );





    • ;





    • (, , ) , .





(DTM, Direct Test Mode) . , .





- (HCI)

- – , Bluetooth, . . , Bluetooth-, , 100% , .





, ,   : UART, USB SDIO (Secure Digital Input Output). , , - .





- . .





الشكل 6: مثال على حزم واجهة وحدة تحكم المضيف
.6: -

: , , , , , .





(L2CAP)

L2CAP , , , . Bluetooth Classic BLE :





  • BLE, .





  • . , BLE, . , .





BLE L2CAP : (ATT, , GATT) (SMP, , ).





(), (GATT), (SM) (GAP) .






بهذا يختتم الفصل الأول من الكتاب. شكرا جزيلا لمن قرأها. سيركز الجزء التالي على فئات الأجهزة والإعلان ، وهي الطريقة التي تنقل بها الأجهزة وجودها إلى العالم الخارجي.








All Articles