SlideShare a Scribd company logo
BLE Overview and 
Implementation 
Stanley Chang 
02, May. 2014
Agenda 
• BLE Protocol Stack 
• BLE Software Architecture and Structure 
• GATT Profiles and Services 
• Implementation
Protocol Stack 
• Protocol stack consists of two main 
sections: 
• Controller 
• Host 
• Solution: single-device, dual-device, 
network processor. 
• RF Specifications: 
• Operates in 2.4 GHz ISM band 
• 40 channels with 2 MHz spacing 
• 3 fixed advertisting channels for 
broadcasting, which avoid 802.11 
interferance 
• 37 adaptively frequency hopped 
dynamic data channel
Link Layer 
• 3 Advertising Channels and 37 Data Channels
States and Network Topology 
• Standby-device is not transmitting or 
receiving any data, and is not connected to 
any other device 
• Advertiser -periodically broadcasting 
advertisements 
• Scanner -actively looking for advertisers 
• Initiator -actively trying to initiate a 
connection with another device 
• Master -connected to another device as a 
master 
• Slave -connected to another device as a 
slave 
• BLE is a “star” topology network
Advertisement Events 
• A device in the advertising state transmits advertising packets 
• Advertising packets can contain a data payload 
• Advertising packets can be directed towards a specific scanner device, or 
undirected 
• Advertisements can be connectable or non-connectable (and therefore just 
used for broadcast of data) 
• During one “advertising event”, an advertisement packet is 
transmitted on each of the three advertising channels (37, 38, and 39)
Connection Parameters 
• Channel Map: 
indicates which data channels are used during the connection 
• Hop Increment: 
random value between 5 and 16 for channel selection algorithm 
• Connection Interval: 
multiple of 1.25ms in range of 7.5ms and 4.0s 
• Supervision Timeout: 
multiple of 10ms in the range of 100ms and 32.0s. Must be larger than: 
(1 + slaveLatency) * (ConnInterval) 
• Slave Latency: 
any value between 0 and 499, though it cannot exceed: 
((supervisionTimeout / connInterval) –1)
Connection Interval
Logical Link Control and 
Adaptation Protocol (L2CAP) 
• Permits upper level protocols and 
applications to transmit and receive 
upper layer data packets up to 23 bytes 
in length. 
• Provides channel management, 
allowing for logical channels between 
two endpoints, supported by the link 
layer 
• Connection Parameter Updates
Security Manager Protocol 
(SMP) 
• Performs authentication and key 
management 
• AES-128 encryption algorithm 
• Works with GAP to manage 
relationships between devices: 
• Pairing 
• Authentication 
• Bonding 
Bonding
Generic Access Profile 
(GAP) 
• Defines generic procedures for connection-related 
services: 
• Device Discovery 
• Link Establishment 
• Link Management 
• Link Termination 
• Initiation of security features 
• AES-128 encryption algorithm 
• Works with GAP to manage relationships 
between devices: 
• Pairing 
• Authentication 
• Bonding
GAP Profile Roles 
• Broadcaster: an advertiser that is non-connectable 
• Observer: scans for advertisements, but cannot initiate connections. 
• Peripheral: an advertiser that is connectable and can operate as a 
slave in a single link layer connection. 
• Central: scans for advertisements and initiates connections; operates 
as a master in a single or multiple link layer connections.
Advertisement and Scan Response Data 
• “AD” types: 
• Device Services (e.g. “I am a remote control”) 
• Service Solicitation (e.g. “I want a remote control to talk to me”) 
• Device Name 
• “Flags” -describes the discoverable mode and whether device supports 
standard Bluetooth or just Low Energy 
• Tx Power Level 
• Slave preferred connection interval range 
• Security support 
• Manufacturer-specific data
Attribute Protocol (ATT) 
• An attribute is a discrete value that has 
associated with it the following three 
properties: 
• A handle (address) 
• A type 
• A set of permissions 
• ATT defines the over-the-air protocol for 
reading, writing, and discovering attributes 
• Allows for different permissions to be 
assigned to attributes, including whether 
they are readable or writeable, and 
whether additional security is required for 
access
Generic Attribute Profile 
(GATT) 
• A profile is composed of one or more 
“services” necessary to fulfill a use-case 
• A service may contain certain attributes 
called “characteristic values”, which are 
values used by a service 
• A characteristic value must have a 
mandatory “characteristic declaration” 
attribute immediately before the value, 
containing the properties of the 
characteristic 
• Characteristics may also contain optional 
“descriptor” attributes, with fields such as 
a configuration or a description
Service Example
CC2541DK MINI Kit: SensorTag
BLE Implementation: UART port
BLE Implementation: Project option
BLE Implementation: Application Overview 
BLE_Bridge 
2B00: Control Service 
3B00: Voice Note Service 
4B00: Notification Service 
5B00: Motion Service 
HAL_UART_DMA 
HalUARTInit 
HalUARTOpen 
HalUARTRead 
HalUARTWrite 
Initialization 
Task event processor 
Process task message 
Service change Callback 
osal_start_system 
osal_run_system 
taskEvents table
Signed GATT Service Profiles UUID
BLE Implementation: Service UUIDs 
• Motion UX Service: 
• 00005B00-0000-1000-8000-00805f9b34fb --> Command Service UUID 
• 00005B01-0000-1000-8000-00805f9b34fb --> Motion DATA Characteristic (Notification) 
• 00005B02-0000-1000-8000-00805f9b34fb --> Motion Switcher Characteristic (Writable) 
• 00005B03-0000-1000-8000-00805f9b34fb --> Motion Pattern Characteristic (Notification) 
• 00005B04-0000-1000-8000-00805f9b34fb --> Information Request Characteristic (Notification) 
• 00005B05-0000-1000-8000-00805f9b34fb --> Silence Rington Chacteristic (Writable from ND)
BLE Implementation: Service UUIDs 
• Voice Service: 
• 00003B00-0000-1000-8000-00805f9b34fb --> Voice Service UUID 
• 00003B01-0000-1000-8000-00805f9b34fb --> Voice AVAILABLE 
Characteristic (Notification) 
• 00003B02-0000-1000-8000-00805f9b34fb --> Voice READ Characteristic 
(Readable from phone) 
• 00003B03-0000-1000-8000-00805f9b34fb --> Voice ACK Characteristic 
(Writable from phone)
BLE Implementation: Service UUIDs 
• Notification Service: 
• 00004B00-0000-1000-8000-00805f9b34fb --> Notification Service UUID 
• 00004B01-0000-1000-8000-00805f9b34fb --> SMS Characteristic (Writable from phone) 
• 00004B02-0000-1000-8000-00805f9b34fb --> Imcoming Call Characteristic (Writable from 
phone) 
• 00004B03-0000-1000-8000-00805f9b34fb --> Missed Call Chacteristic (Writable from phone) 
• 00004B04-0000-1000-8000-00805f9b34fb --> Time Sync Chacteristic (Writable from phone) 
• Control Service: 
• 00002B00-0000-1000-8000-00805f9b34fb --> MicroAppManager Service UUID 
• 00002B01-0000-1000-8000-00805f9b34fb --> MicroApp Installer Characteristic (Writable 
from phone) 
• 00002B02-0000-1000-8000-00805f9b34fb --> MicroApp Installer ACK Characteristic 
(Notification)
BLE Implementation: Application Startup 
Application (BLE_Bridge.c) 
--> BLE_Bridge_Init() 
HAL 
HalUARTInit() 
User Profile (MotionSensorService.c) 
- motionData 
- motionCfg
BLE Implementation: Notifications ON
BLE Implementation: Value Changes
BLE Implementation: Profile/Service 
1. include profile/service header file in the beginning. 
#include “TypicalService.h“ 
#define MOTIONSENSOR_SERV_UUID 0x5B00 
2. Define service UUID format in GLOBAL VARIABLES area 
static CONST uint8 motionServiceUUID[ATT_BT_UUID_SIZE] = 
{ 
LO_UINT16(MOTIONSENSOR_SERV_UUID), HI_UINT16(MOTIONSENSOR_SERV_UUID) 
}; 
3. Create Profile Attributes Table 
- Motion Service 
- Characteristic Declaration 
- Characteristic Value "Data" 
- Characteristic configuration 
- Characteristic User Description
BLE Implementation: Profile/Service 
4. LOCAL FUNCTIONS definition 
- motion_ReadAttrCB 
- motion_WriteAttrCB 
- motion_HandleConnStatusCB 
5. PROFILE CALLBACKS definition 
static CONST gattServiceCBs_t motionCBs = 
{ 
motion_ReadAttrCB, // Read callback function pointer 
motion_WriteAttrCB, // Write callback function pointer 
NULL // Authorization callback function pointer 
}; 
6. PUBLIC FUNCTIONS 
- MOT_AddService: Initializes motion service by registering GATT attributes with the GATT server. 
- MOT_SetParameter: Set motion service parameter. 
- MOT_GetParameter: Get motion service parameter.
BLE Implementation: Main function 
• Import related service file in project source, PROFILE. 
• Add services: 
• VDR_AddService(GATT_ALL_SERVICES); 
• NFY_AddService(GATT_ALL_SERVICES); 
• MOT_AddService(GATT_ALL_SERVICES); 
• CTL_AddService(GATT_ALL_SERVICES); 
• Register callbacks with profile: 
• VOID VDR_RegisterAppCBs(&iv01_vdrCBs); 
• VOID NFY_RegisterAppCBs(&iv01_nfyCBs); 
• VOID MOT_RegisterAppCBs(&iv01_motCBs); 
• VOID CTL_RegisterAppCBs(&iv01_ctlCBs);
BLE Implementation: Event Process 
if (events & MOTION_SENSOR_EVT) 
{ 
if (motionEnabled) 
{ 
if (MotionDateChanged) 
{ 
MotionDateChanged = 0; 
UARTSendCommand(_CMDID_MOTION); 
ReadMotionData(); 
} 
osal_start_timerEx(BLE_Bridge_TaskID, MOTION_SENSOR_EVT, syncPeriod); 
} 
return (events ^ MOTION_SENSOR_EVT); 
}
BLE Implementation: Callback 
Value was changed by connected device, 
then send OSAL event request to handle 
the related behavior.
Customized Name 
The User description will show up as one of the sub-fields when you expand the 
service and characteristic. The name is taken from an XML file in 
Program Files (x86)Texas InstrumentsBLE Device Monitorgatt_uuid.xml. 
The names are aquirred from the SIG profiles which associate a name with an 
UUID. This metadata is not available over the air, as it's assumed that a UUID is 
unique and known to both sides for correct operation.
Reference 
• BLE_CC2540_DeepDive_Training 
• TI_BLE_Sample_Applications_Guide 
• TI_BLE_Software_Developer's_Guide 
• HAL Driver API 
• BLE Bridge sample introduction 
Thank you!
Ad

Recommended

Introduction to Bluetooth low energy
Introduction to Bluetooth low energy
NEEVEE Technologies
 
Bluetooth low energy
Bluetooth low energy
Saptadeep Pal
 
Bluetooth Low Energy - A Case Study
Bluetooth Low Energy - A Case Study
FReeze FRancis
 
Bluetooth Technology -- detailed explanation
Bluetooth Technology -- detailed explanation
Siva Pradeep Bolisetti
 
Bluetooth profile
Bluetooth profile
Then Murugeshwari
 
Cellular Narrow Band IoT- using LTE
Cellular Narrow Band IoT- using LTE
Sukhvinder Singh Malik
 
Bluetooth
Bluetooth
Sarah Saqib
 
LPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
LPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
Peter R. Egli
 
Introduction to Bluetooth Low Energy
Introduction to Bluetooth Low Energy
yeokm1
 
BLE Talk
BLE Talk
programmarchy
 
Bluetooth & Bluetooth Low Energy internals
Bluetooth & Bluetooth Low Energy internals
Davy Jacops
 
20 common port numbers and their purposes
20 common port numbers and their purposes
salamassh
 
Ethernet Computer network
Ethernet Computer network
miteshppt
 
Bluetooth low energy(ble) wireless technology
Bluetooth low energy(ble) wireless technology
Lin Steven
 
Ethernet protocol
Ethernet protocol
Tom Chou
 
Intermediate: Bandwidth Parts (BWP)
Intermediate: Bandwidth Parts (BWP)
3G4G
 
Ip addresses
Ip addresses
Asif
 
Bluetooth Presentation
Bluetooth Presentation
guest664c3f
 
Real time transport protocol
Real time transport protocol
SwaroopSorte
 
volte ims network architecture
volte ims network architecture
Vikas Shokeen
 
Cisco ospf
Cisco ospf
sarasanandam
 
Basics of data communication and computer networking (262 kb)
Basics of data communication and computer networking (262 kb)
IMRAN KHAN
 
Rtn
Rtn
Ahmed Hussien Ali Gomaa Bebars
 
LTE Architecture and LTE Attach
LTE Architecture and LTE Attach
aliirfan04
 
What is-twamp
What is-twamp
Nir Cohen
 
ETHERNET
ETHERNET
AKSHIT KOHLI
 
5G Integrated Access and Backhaul
5G Integrated Access and Backhaul
Sridhar Bhaskaran
 
Bluetooth presentation
Bluetooth presentation
DhairYash Kotwani
 
Introduction to Bluetooth Low Energy
Introduction to Bluetooth Low Energy
NEEVEE Technologies
 
A Brief Introduction to Bluetooth Low Energy (BLE) on iOS
A Brief Introduction to Bluetooth Low Energy (BLE) on iOS
Matt Whitlock
 

More Related Content

What's hot (20)

Introduction to Bluetooth Low Energy
Introduction to Bluetooth Low Energy
yeokm1
 
BLE Talk
BLE Talk
programmarchy
 
Bluetooth & Bluetooth Low Energy internals
Bluetooth & Bluetooth Low Energy internals
Davy Jacops
 
20 common port numbers and their purposes
20 common port numbers and their purposes
salamassh
 
Ethernet Computer network
Ethernet Computer network
miteshppt
 
Bluetooth low energy(ble) wireless technology
Bluetooth low energy(ble) wireless technology
Lin Steven
 
Ethernet protocol
Ethernet protocol
Tom Chou
 
Intermediate: Bandwidth Parts (BWP)
Intermediate: Bandwidth Parts (BWP)
3G4G
 
Ip addresses
Ip addresses
Asif
 
Bluetooth Presentation
Bluetooth Presentation
guest664c3f
 
Real time transport protocol
Real time transport protocol
SwaroopSorte
 
volte ims network architecture
volte ims network architecture
Vikas Shokeen
 
Cisco ospf
Cisco ospf
sarasanandam
 
Basics of data communication and computer networking (262 kb)
Basics of data communication and computer networking (262 kb)
IMRAN KHAN
 
Rtn
Rtn
Ahmed Hussien Ali Gomaa Bebars
 
LTE Architecture and LTE Attach
LTE Architecture and LTE Attach
aliirfan04
 
What is-twamp
What is-twamp
Nir Cohen
 
ETHERNET
ETHERNET
AKSHIT KOHLI
 
5G Integrated Access and Backhaul
5G Integrated Access and Backhaul
Sridhar Bhaskaran
 
Bluetooth presentation
Bluetooth presentation
DhairYash Kotwani
 
Introduction to Bluetooth Low Energy
Introduction to Bluetooth Low Energy
yeokm1
 
Bluetooth & Bluetooth Low Energy internals
Bluetooth & Bluetooth Low Energy internals
Davy Jacops
 
20 common port numbers and their purposes
20 common port numbers and their purposes
salamassh
 
Ethernet Computer network
Ethernet Computer network
miteshppt
 
Bluetooth low energy(ble) wireless technology
Bluetooth low energy(ble) wireless technology
Lin Steven
 
Ethernet protocol
Ethernet protocol
Tom Chou
 
Intermediate: Bandwidth Parts (BWP)
Intermediate: Bandwidth Parts (BWP)
3G4G
 
Ip addresses
Ip addresses
Asif
 
Bluetooth Presentation
Bluetooth Presentation
guest664c3f
 
Real time transport protocol
Real time transport protocol
SwaroopSorte
 
volte ims network architecture
volte ims network architecture
Vikas Shokeen
 
Basics of data communication and computer networking (262 kb)
Basics of data communication and computer networking (262 kb)
IMRAN KHAN
 
LTE Architecture and LTE Attach
LTE Architecture and LTE Attach
aliirfan04
 
What is-twamp
What is-twamp
Nir Cohen
 
5G Integrated Access and Backhaul
5G Integrated Access and Backhaul
Sridhar Bhaskaran
 

Similar to Ble overview and_implementation (20)

Introduction to Bluetooth Low Energy
Introduction to Bluetooth Low Energy
NEEVEE Technologies
 
A Brief Introduction to Bluetooth Low Energy (BLE) on iOS
A Brief Introduction to Bluetooth Low Energy (BLE) on iOS
Matt Whitlock
 
Bluetooth technology introduction and ecosystem
Bluetooth technology introduction and ecosystem
NiclasGranqvist
 
Bluetooth introduction
Bluetooth introduction
CHUNYING YEN
 
About BLE server profile
About BLE server profile
Lin Steven
 
Undestanding Bluetooth
Undestanding Bluetooth
Leopoldo Armesto
 
Iot ble and_beacons_2015_nov28
Iot ble and_beacons_2015_nov28
Ravikiran HV
 
iOT - Developing beacons
iOT - Developing beacons
sandeephegde
 
Practical Core Bluetooth in IoT & Wearable projects @ UIKonf 2016
Practical Core Bluetooth in IoT & Wearable projects @ UIKonf 2016
Shuichi Tsutsumi
 
Softimize - Connecting Devices to Gateways
Softimize - Connecting Devices to Gateways
Yael Malki
 
Handling BLE & Bluetooth in Mobile Apps development
Handling BLE & Bluetooth in Mobile Apps development
Satyanarayana SVV
 
Connect your Android to the real world with Bluetooth Low Energy
Connect your Android to the real world with Bluetooth Low Energy
Gabor Paller
 
Internet of Things Protocol - Session 2
Internet of Things Protocol - Session 2
NEEVEE Technologies
 
Bluetooth low energy- Kashyap Velpuru
Bluetooth low energy- Kashyap Velpuru
kashyap velpuru
 
Practical Core Bluetooth in IoT & Wearable projects @ AltConf 2016
Practical Core Bluetooth in IoT & Wearable projects @ AltConf 2016
Shuichi Tsutsumi
 
Ble boise codecamp
Ble boise codecamp
Chip Keyes
 
Desert Code Camp 2014.2 Intro to Bluetooth Low Energy
Desert Code Camp 2014.2 Intro to Bluetooth Low Energy
jjrosent
 
Bluetooth 5
Bluetooth 5
harsh parekh
 
Workshop-How_to_use_btlejack.pdfWorkshop-How_to_use_btlejack
Workshop-How_to_use_btlejack.pdfWorkshop-How_to_use_btlejack
GerdaStimmel
 
Bluetooth low energy final version
Bluetooth low energy final version
Frederick Bousson
 
Introduction to Bluetooth Low Energy
Introduction to Bluetooth Low Energy
NEEVEE Technologies
 
A Brief Introduction to Bluetooth Low Energy (BLE) on iOS
A Brief Introduction to Bluetooth Low Energy (BLE) on iOS
Matt Whitlock
 
Bluetooth technology introduction and ecosystem
Bluetooth technology introduction and ecosystem
NiclasGranqvist
 
Bluetooth introduction
Bluetooth introduction
CHUNYING YEN
 
About BLE server profile
About BLE server profile
Lin Steven
 
Iot ble and_beacons_2015_nov28
Iot ble and_beacons_2015_nov28
Ravikiran HV
 
iOT - Developing beacons
iOT - Developing beacons
sandeephegde
 
Practical Core Bluetooth in IoT & Wearable projects @ UIKonf 2016
Practical Core Bluetooth in IoT & Wearable projects @ UIKonf 2016
Shuichi Tsutsumi
 
Softimize - Connecting Devices to Gateways
Softimize - Connecting Devices to Gateways
Yael Malki
 
Handling BLE & Bluetooth in Mobile Apps development
Handling BLE & Bluetooth in Mobile Apps development
Satyanarayana SVV
 
Connect your Android to the real world with Bluetooth Low Energy
Connect your Android to the real world with Bluetooth Low Energy
Gabor Paller
 
Internet of Things Protocol - Session 2
Internet of Things Protocol - Session 2
NEEVEE Technologies
 
Bluetooth low energy- Kashyap Velpuru
Bluetooth low energy- Kashyap Velpuru
kashyap velpuru
 
Practical Core Bluetooth in IoT & Wearable projects @ AltConf 2016
Practical Core Bluetooth in IoT & Wearable projects @ AltConf 2016
Shuichi Tsutsumi
 
Ble boise codecamp
Ble boise codecamp
Chip Keyes
 
Desert Code Camp 2014.2 Intro to Bluetooth Low Energy
Desert Code Camp 2014.2 Intro to Bluetooth Low Energy
jjrosent
 
Workshop-How_to_use_btlejack.pdfWorkshop-How_to_use_btlejack
Workshop-How_to_use_btlejack.pdfWorkshop-How_to_use_btlejack
GerdaStimmel
 
Bluetooth low energy final version
Bluetooth low energy final version
Frederick Bousson
 
Ad

Recently uploaded (20)

HYBRIDIZATION OF ALKANES AND ALKENES ...
HYBRIDIZATION OF ALKANES AND ALKENES ...
karishmaduhijod1
 
IObit Driver Booster Pro 12 Crack Latest Version Download
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
 
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
Shane Coughlan
 
Automated Testing and Safety Analysis of Deep Neural Networks
Automated Testing and Safety Analysis of Deep Neural Networks
Lionel Briand
 
Sysinfo OST to PST Converter Infographic
Sysinfo OST to PST Converter Infographic
SysInfo Tools
 
Sap basis role in public cloud in s/4hana.pptx
Sap basis role in public cloud in s/4hana.pptx
htmlprogrammer987
 
Enable Your Cloud Journey With Microsoft Trusted Partner | IFI Tech
Enable Your Cloud Journey With Microsoft Trusted Partner | IFI Tech
IFI Techsolutions
 
Why Edge Computing Matters in Mobile Application Tech.pdf
Why Edge Computing Matters in Mobile Application Tech.pdf
IMG Global Infotech
 
Advance Doctor Appointment Booking App With Online Payment
Advance Doctor Appointment Booking App With Online Payment
AxisTechnolabs
 
Which Hiring Management Tools Offer the Best ROI?
Which Hiring Management Tools Offer the Best ROI?
HireME
 
Why Every Growing Business Needs a Staff Augmentation Company IN USA.pdf
Why Every Growing Business Needs a Staff Augmentation Company IN USA.pdf
mary rojas
 
AI for PV: Development and Governance for a Regulated Industry
AI for PV: Development and Governance for a Regulated Industry
Biologit
 
Complete Guideliness to Build an Effective Maintenance Plan.ppt
Complete Guideliness to Build an Effective Maintenance Plan.ppt
QualityzeInc1
 
Heat Treatment Process Automation in India
Heat Treatment Process Automation in India
Reckers Mechatronics
 
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
pcprocore
 
Best Software Development at Best Prices
Best Software Development at Best Prices
softechies7
 
Best Practice for LLM Serving in the Cloud
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
 
Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
University Campus Navigation for All - Peak of Data & AI
University Campus Navigation for All - Peak of Data & AI
Safe Software
 
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
HYBRIDIZATION OF ALKANES AND ALKENES ...
HYBRIDIZATION OF ALKANES AND ALKENES ...
karishmaduhijod1
 
IObit Driver Booster Pro 12 Crack Latest Version Download
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
 
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
Shane Coughlan
 
Automated Testing and Safety Analysis of Deep Neural Networks
Automated Testing and Safety Analysis of Deep Neural Networks
Lionel Briand
 
Sysinfo OST to PST Converter Infographic
Sysinfo OST to PST Converter Infographic
SysInfo Tools
 
Sap basis role in public cloud in s/4hana.pptx
Sap basis role in public cloud in s/4hana.pptx
htmlprogrammer987
 
Enable Your Cloud Journey With Microsoft Trusted Partner | IFI Tech
Enable Your Cloud Journey With Microsoft Trusted Partner | IFI Tech
IFI Techsolutions
 
Why Edge Computing Matters in Mobile Application Tech.pdf
Why Edge Computing Matters in Mobile Application Tech.pdf
IMG Global Infotech
 
Advance Doctor Appointment Booking App With Online Payment
Advance Doctor Appointment Booking App With Online Payment
AxisTechnolabs
 
Which Hiring Management Tools Offer the Best ROI?
Which Hiring Management Tools Offer the Best ROI?
HireME
 
Why Every Growing Business Needs a Staff Augmentation Company IN USA.pdf
Why Every Growing Business Needs a Staff Augmentation Company IN USA.pdf
mary rojas
 
AI for PV: Development and Governance for a Regulated Industry
AI for PV: Development and Governance for a Regulated Industry
Biologit
 
Complete Guideliness to Build an Effective Maintenance Plan.ppt
Complete Guideliness to Build an Effective Maintenance Plan.ppt
QualityzeInc1
 
Heat Treatment Process Automation in India
Heat Treatment Process Automation in India
Reckers Mechatronics
 
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
pcprocore
 
Best Software Development at Best Prices
Best Software Development at Best Prices
softechies7
 
Best Practice for LLM Serving in the Cloud
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
 
Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
University Campus Navigation for All - Peak of Data & AI
University Campus Navigation for All - Peak of Data & AI
Safe Software
 
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
Ad

Ble overview and_implementation

  • 1. BLE Overview and Implementation Stanley Chang 02, May. 2014
  • 2. Agenda • BLE Protocol Stack • BLE Software Architecture and Structure • GATT Profiles and Services • Implementation
  • 3. Protocol Stack • Protocol stack consists of two main sections: • Controller • Host • Solution: single-device, dual-device, network processor. • RF Specifications: • Operates in 2.4 GHz ISM band • 40 channels with 2 MHz spacing • 3 fixed advertisting channels for broadcasting, which avoid 802.11 interferance • 37 adaptively frequency hopped dynamic data channel
  • 4. Link Layer • 3 Advertising Channels and 37 Data Channels
  • 5. States and Network Topology • Standby-device is not transmitting or receiving any data, and is not connected to any other device • Advertiser -periodically broadcasting advertisements • Scanner -actively looking for advertisers • Initiator -actively trying to initiate a connection with another device • Master -connected to another device as a master • Slave -connected to another device as a slave • BLE is a “star” topology network
  • 6. Advertisement Events • A device in the advertising state transmits advertising packets • Advertising packets can contain a data payload • Advertising packets can be directed towards a specific scanner device, or undirected • Advertisements can be connectable or non-connectable (and therefore just used for broadcast of data) • During one “advertising event”, an advertisement packet is transmitted on each of the three advertising channels (37, 38, and 39)
  • 7. Connection Parameters • Channel Map: indicates which data channels are used during the connection • Hop Increment: random value between 5 and 16 for channel selection algorithm • Connection Interval: multiple of 1.25ms in range of 7.5ms and 4.0s • Supervision Timeout: multiple of 10ms in the range of 100ms and 32.0s. Must be larger than: (1 + slaveLatency) * (ConnInterval) • Slave Latency: any value between 0 and 499, though it cannot exceed: ((supervisionTimeout / connInterval) –1)
  • 9. Logical Link Control and Adaptation Protocol (L2CAP) • Permits upper level protocols and applications to transmit and receive upper layer data packets up to 23 bytes in length. • Provides channel management, allowing for logical channels between two endpoints, supported by the link layer • Connection Parameter Updates
  • 10. Security Manager Protocol (SMP) • Performs authentication and key management • AES-128 encryption algorithm • Works with GAP to manage relationships between devices: • Pairing • Authentication • Bonding Bonding
  • 11. Generic Access Profile (GAP) • Defines generic procedures for connection-related services: • Device Discovery • Link Establishment • Link Management • Link Termination • Initiation of security features • AES-128 encryption algorithm • Works with GAP to manage relationships between devices: • Pairing • Authentication • Bonding
  • 12. GAP Profile Roles • Broadcaster: an advertiser that is non-connectable • Observer: scans for advertisements, but cannot initiate connections. • Peripheral: an advertiser that is connectable and can operate as a slave in a single link layer connection. • Central: scans for advertisements and initiates connections; operates as a master in a single or multiple link layer connections.
  • 13. Advertisement and Scan Response Data • “AD” types: • Device Services (e.g. “I am a remote control”) • Service Solicitation (e.g. “I want a remote control to talk to me”) • Device Name • “Flags” -describes the discoverable mode and whether device supports standard Bluetooth or just Low Energy • Tx Power Level • Slave preferred connection interval range • Security support • Manufacturer-specific data
  • 14. Attribute Protocol (ATT) • An attribute is a discrete value that has associated with it the following three properties: • A handle (address) • A type • A set of permissions • ATT defines the over-the-air protocol for reading, writing, and discovering attributes • Allows for different permissions to be assigned to attributes, including whether they are readable or writeable, and whether additional security is required for access
  • 15. Generic Attribute Profile (GATT) • A profile is composed of one or more “services” necessary to fulfill a use-case • A service may contain certain attributes called “characteristic values”, which are values used by a service • A characteristic value must have a mandatory “characteristic declaration” attribute immediately before the value, containing the properties of the characteristic • Characteristics may also contain optional “descriptor” attributes, with fields such as a configuration or a description
  • 17. CC2541DK MINI Kit: SensorTag
  • 20. BLE Implementation: Application Overview BLE_Bridge 2B00: Control Service 3B00: Voice Note Service 4B00: Notification Service 5B00: Motion Service HAL_UART_DMA HalUARTInit HalUARTOpen HalUARTRead HalUARTWrite Initialization Task event processor Process task message Service change Callback osal_start_system osal_run_system taskEvents table
  • 21. Signed GATT Service Profiles UUID
  • 22. BLE Implementation: Service UUIDs • Motion UX Service: • 00005B00-0000-1000-8000-00805f9b34fb --> Command Service UUID • 00005B01-0000-1000-8000-00805f9b34fb --> Motion DATA Characteristic (Notification) • 00005B02-0000-1000-8000-00805f9b34fb --> Motion Switcher Characteristic (Writable) • 00005B03-0000-1000-8000-00805f9b34fb --> Motion Pattern Characteristic (Notification) • 00005B04-0000-1000-8000-00805f9b34fb --> Information Request Characteristic (Notification) • 00005B05-0000-1000-8000-00805f9b34fb --> Silence Rington Chacteristic (Writable from ND)
  • 23. BLE Implementation: Service UUIDs • Voice Service: • 00003B00-0000-1000-8000-00805f9b34fb --> Voice Service UUID • 00003B01-0000-1000-8000-00805f9b34fb --> Voice AVAILABLE Characteristic (Notification) • 00003B02-0000-1000-8000-00805f9b34fb --> Voice READ Characteristic (Readable from phone) • 00003B03-0000-1000-8000-00805f9b34fb --> Voice ACK Characteristic (Writable from phone)
  • 24. BLE Implementation: Service UUIDs • Notification Service: • 00004B00-0000-1000-8000-00805f9b34fb --> Notification Service UUID • 00004B01-0000-1000-8000-00805f9b34fb --> SMS Characteristic (Writable from phone) • 00004B02-0000-1000-8000-00805f9b34fb --> Imcoming Call Characteristic (Writable from phone) • 00004B03-0000-1000-8000-00805f9b34fb --> Missed Call Chacteristic (Writable from phone) • 00004B04-0000-1000-8000-00805f9b34fb --> Time Sync Chacteristic (Writable from phone) • Control Service: • 00002B00-0000-1000-8000-00805f9b34fb --> MicroAppManager Service UUID • 00002B01-0000-1000-8000-00805f9b34fb --> MicroApp Installer Characteristic (Writable from phone) • 00002B02-0000-1000-8000-00805f9b34fb --> MicroApp Installer ACK Characteristic (Notification)
  • 25. BLE Implementation: Application Startup Application (BLE_Bridge.c) --> BLE_Bridge_Init() HAL HalUARTInit() User Profile (MotionSensorService.c) - motionData - motionCfg
  • 28. BLE Implementation: Profile/Service 1. include profile/service header file in the beginning. #include “TypicalService.h“ #define MOTIONSENSOR_SERV_UUID 0x5B00 2. Define service UUID format in GLOBAL VARIABLES area static CONST uint8 motionServiceUUID[ATT_BT_UUID_SIZE] = { LO_UINT16(MOTIONSENSOR_SERV_UUID), HI_UINT16(MOTIONSENSOR_SERV_UUID) }; 3. Create Profile Attributes Table - Motion Service - Characteristic Declaration - Characteristic Value "Data" - Characteristic configuration - Characteristic User Description
  • 29. BLE Implementation: Profile/Service 4. LOCAL FUNCTIONS definition - motion_ReadAttrCB - motion_WriteAttrCB - motion_HandleConnStatusCB 5. PROFILE CALLBACKS definition static CONST gattServiceCBs_t motionCBs = { motion_ReadAttrCB, // Read callback function pointer motion_WriteAttrCB, // Write callback function pointer NULL // Authorization callback function pointer }; 6. PUBLIC FUNCTIONS - MOT_AddService: Initializes motion service by registering GATT attributes with the GATT server. - MOT_SetParameter: Set motion service parameter. - MOT_GetParameter: Get motion service parameter.
  • 30. BLE Implementation: Main function • Import related service file in project source, PROFILE. • Add services: • VDR_AddService(GATT_ALL_SERVICES); • NFY_AddService(GATT_ALL_SERVICES); • MOT_AddService(GATT_ALL_SERVICES); • CTL_AddService(GATT_ALL_SERVICES); • Register callbacks with profile: • VOID VDR_RegisterAppCBs(&iv01_vdrCBs); • VOID NFY_RegisterAppCBs(&iv01_nfyCBs); • VOID MOT_RegisterAppCBs(&iv01_motCBs); • VOID CTL_RegisterAppCBs(&iv01_ctlCBs);
  • 31. BLE Implementation: Event Process if (events & MOTION_SENSOR_EVT) { if (motionEnabled) { if (MotionDateChanged) { MotionDateChanged = 0; UARTSendCommand(_CMDID_MOTION); ReadMotionData(); } osal_start_timerEx(BLE_Bridge_TaskID, MOTION_SENSOR_EVT, syncPeriod); } return (events ^ MOTION_SENSOR_EVT); }
  • 32. BLE Implementation: Callback Value was changed by connected device, then send OSAL event request to handle the related behavior.
  • 33. Customized Name The User description will show up as one of the sub-fields when you expand the service and characteristic. The name is taken from an XML file in Program Files (x86)Texas InstrumentsBLE Device Monitorgatt_uuid.xml. The names are aquirred from the SIG profiles which associate a name with an UUID. This metadata is not available over the air, as it's assumed that a UUID is unique and known to both sides for correct operation.
  • 34. Reference • BLE_CC2540_DeepDive_Training • TI_BLE_Sample_Applications_Guide • TI_BLE_Software_Developer's_Guide • HAL Driver API • BLE Bridge sample introduction Thank you!