blog origine medium link https://medium.com/mindorks/bluetooth-low-energy-3656ac323c4e
Bluetooth low energy is one of many wireless technologies in our world it is used in almost every project in IoT and smart home we can find it anywhere (beacons, smart watch,heart rate sensor ..) but before talking about how we can use it in our projects with raspberry we need to know some theory about it so lets start.
ble started as part of bluetooth 4.0 core specification, it is originally designed by nokia as wibree before being adopted by Bluetooth Special Interes Group .
a complete single mode BLE device is divided into three parts Application Host and Controller
is the highest layer and it is responsible for containing the logic
includes the flowing layer :
Generic Access Profile (GAP)
Generic Attribute Profile (GATT)
Logic Link Control and Adaptation Protocol (L2CAP)
Attribute Protocol (ATT)
Security Manager (SM)
Hos Control Interface (HCI),host side
includes:
Hos Control Interface (HCI),controller side
Link Layer (LL)
Physical Layer(PHY)
the different roles that BLE device can take are :
a device sending advertising information (name , MAC address)
a device scanning for advertising information.
a device that initiates a connection and manges later.
a device that accept a connexion request and follows a master timing.
these roles can be grouped into tow pairs advertiser and scanner and central and peripheral
blue lamp is an application built to work on android >5.0 which allows us to control smart lamp over ble the service of the lamp has 0000f00d-1212-efde-1523-785feabcd123 as UUID and the control light characteristic has 0000beef-1212-efde-1523-785feabcd123 as UUID below you find a screenshot of the app