Bluetooth Low Energy: A Detailed Guide for Beginners. Part 2

This is the second part of the translation of Mohammad Afane's book "Intro to Bluetooth Low Energy". In the chapters presented, we will talk about device types and about advertising, the method by which peripherals communicate their presence. The first part is here.





I would like to note right away that advertising can be used not only to detect devices, but also to send custom data. For example, in the Atmotube portable air quality monitor , the advertise and scan response packages are used to communicate current sensor readings. This is useful for monitoring sensor readings during production and when collecting data from multiple devices.









2. BLE peripherals and central devices

There are several important definitions that you will constantly come across as you learn BLE. The two most important ones relate to device roles: BLE central and BLE peripheral. 





Let's consider them in more detail.





2.1 Peripherals

– , , .. , .





BLE-, , , : . , - , , .





, – (beacon). – , . : .





, , . , , , , .





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





, . . , , GAP.





2.2

– , . .





– , , .





2.3

: , , .

























,









,





















, BLE





BLE





, BLE





BLE





. 1:





2.4

BLE . , , , . , BLE , , .





BLE , . , , .





. – , , - .





2.5 BLE

BLE- . , ( ) , .









Figure:  1: Smartphone as a multi-role device
. 1:





2.6 BLE

BLE , ZigBee, Z-Wave, Thread .,) , . Bluetooth Classic , Bluetooth BLE, Bluetooth Classic. BLE.





BLE :





  • . BLE- .





  • , , . , , BLE-, .





, BLE

: Android iOS. Android BLE API Android 4.3 ( 2012 ), iOS – 2011 .





, . iOS, BLE , iPhone 4s. Android . , , BLE. Android , BLE, Android-.





3.

3.1 (GAP)

, BLE- . :





  • ;





  • : , , , ;





  • : , , ;









, , BLE .





BLE- , , . , , – ( 37, 38, 39) , .





, . : .





3.2

, , . , .





BLE 40 , 2 ( ), . ,  37 , .





Figure:  8: Radio channels in BLE
. 8: BLE

: , , , () , , . , , Wi-Fi .





. . , .





, , , . , .





: 31 . 254 .





, () , ( ) , .





, . , ( ).





Figure:  9: Devices with and without connectivity
. 9: ,

3.3

, , , . , , , . , , .





, , , , , , .





Figure:  10: Passive and active scanning
. 10:

3.4

, (37, 38 39). ( ):





  • .





, .





  • .





.





  • .









  • .





. .





  • .





.





  • .





.





  • .





.





3.5

:





  • .





. 20 10.24 , 625 . , . , .





  • .





. , .





Figure:  11: Format of the advertising package (from the Bluetooth standard specification 5)
. 11: ( Bluetooth 5)

  , TLV (Type-Length-Value, --), . , . (PDU, Protocol Data Unit) BLE- :





  • : , , .





  • : , TLV.





  • : .





Bluetooth ( ).





:





  • Local Name: , , . 





  • Tx Power Level: , .





  • Flags: (, , [1] [0], :





    • Limited Discoverable Mode ( );





    • General Discoverable Mode ( );





    • BR/EDR Not Supported ( Bluetooth);





    • Low Energy Bluetooth ;





    • Low Energy Bluetooth .





: BR (Basic Rate, ) EDR (Enhanced Data Rate, ) Bluetooth Classic.





  • Service Solicitation: UUID, , GATT- . .





  • Appearance: , . , , .





, , – .





3.6.

:





  • Scan Type ( ): .





  • Scan Window ( ): , .





  • Scan Interval ( ): .





, , . 





Figure:  12: Scan parameters
. 12:

__________________________________





?

In the next article, we will look at the issues related to connections, as well as understand the services, characteristics and ways of working with them.








All Articles