# Developing BLE Host Applications with Zephyr
> [! note]-
> The content of this page is generated by audio/video transcription and text transformation from the content and links of this source.
Source: [https://fosdem.org/2025/schedule/event/fosdem-2025-6262-developing-ble-host-applications-with-zephyr/](https://fosdem.org/2025/schedule/event/fosdem-2025-6262-developing-ble-host-applications-with-zephyr/)
<video src="https://video.fosdem.org/2025/h1302/fosdem-2025-6262-developing-ble-host-applications-with-zephyr.av1.webm" controls></video>
## Summary & Highlights:
This session, led by Florian Limberger, focuses on the development of Bluetooth Low Energy (BLE) host applications using the Zephyr Project. The talk covers the basics of BLE protocols, the Zephyr Bluetooth API, and the challenges encountered during development. Emphasis is placed on the portability of applications across different boards and utilizing emulators and simulators for efficient development and testing.
**Introduction to BLE and Zephyr**
The session begins with an introduction to Bluetooth Low Energy (BLE), a wireless communication technology designed for low-power applications. It distinguishes between peripheral devices, which are resource-constrained, and central devices, which are more powerful. The Zephyr Project, known for supporting BLE peripheral applications, also supports host applications, which are central devices in BLE terminology.
**Developing with Zephyr**
Florian Limberger explains how to develop BLE host applications using Zephyr, highlighting the Bluetooth API and discussing common pitfalls. The talk includes practical insights into how BLE applications can remain portable across different vendor boards and the use of BLE-enabled emulators and simulators provided by Zephyr for faster development and testing.
**Technical Challenges and Solutions**
The session covers the technical challenges faced, such as service discovery and the limitations of existing documentation and examples. Florian shares his experiences and solutions, including the use of the Zephyr GATT API and handling multiple services gracefully.
**Practical Demonstration and Tools**
A practical demonstration of BLE applications running on different boards without specific application code changes illustrates Zephyr's portability. Tools like emulators and simulators for BLE development are discussed, providing attendees with resources for further exploration and development.
## Importance for an eco-social transformation
The session is significant for eco-social transformation as it highlights the potential of open-source projects like Zephyr in developing energy-efficient applications. BLE technology, with its low-power consumption, aligns with sustainable development goals by reducing energy usage. For eco-social designers, Zephyr offers a platform to create efficient and scalable applications that can be used in various sustainable and social projects. Challenges include the complexity of the Bluetooth protocol stack and the need for better documentation and examples. Addressing these issues can facilitate broader adoption and innovation in developing eco-friendly technologies.
## Slides:
| | |
| --- | --- |
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_001.jpg\|300]] | The first slide introduces the topic of BLE Service Discovery with Zephyr, presented by Florian Limberger at FOSDEM 2025 in Brussels. The session aims to provide insights and discuss the pitfalls encountered in the process.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_002.jpg\|300]] | The second slide introduces Florian Limberger, a Senior Embedded Systems Engineer, highlighting his expertise in Embedded Linux, Real-time systems, and his status as a Zephyr Neophyte.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_003.jpg\|300]] | The third slide outlines the agenda, covering BLE Basics with a focus on the Protocol Stack and GATT Protocol, as well as BLE implementation in Zephyr, including API and Tools.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_004.jpg\|300]] | The fourth slide clarifies terminology, explaining that Bluetooth does not use 'Host' and 'Client' terminology. Instead, 'Host' refers to a Central Device, and 'Client' refers to a Peripheral Device.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_005.jpg\|300]] | The fifth slide describes general terminology for Bluetooth Low Energy, distinguishing between Central Devices, which control connections and are powerful, and Peripheral Devices, which are resource-constrained and potentially low-cost.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_006.jpg\|300]] | The sixth slide explains how BLE works, noting the complexity of the specification. It outlines the protocol stack, including L2CAP, HCI, GAP, ATT, and GATT, with a focus on the GATT protocol as the application layer for developers.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_007.jpg\|300]] | The seventh slide discusses the ubiquitous use of UUIDs in Bluetooth for type information and object identity, explaining how objects in the standard use smaller portions to represent full UUIDs to reduce data transmission.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_008.jpg\|300]] | The eighth slide covers the ATT (Attribute Protocol), a client-server protocol providing access to values via a 16-bit handle. It outlines basic operations such as Read, Write, Notify, and Indicate.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_009.jpg\|300]] | The ninth slide introduces the GATT (Generic Attribute Protocol), explaining services and characteristics identified by UUIDs, protected by permissions, and how they serve as containers for values.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_010.jpg\|300]] | The tenth slide details how GATT is built on ATT attributes, requiring a mapping between ATT handles and GATT UUIDs. It notes that mapping may differ between devices or sessions and can be cached for efficiency.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_011.jpg\|300]] | The eleventh slide provides a simple configuration for enabling BLE Central Devices with Zephyr, highlighting the necessary settings in the project configuration file.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_012.jpg\|300]] | The twelfth slide outlines the general structure for startup in a BLE application, providing a code example for initializing Bluetooth and starting a passive scan.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_013.jpg\|300]] | The thirteenth slide describes the general structure for callbacks, showing how to define connection callbacks for handling connected and disconnected events.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_014.jpg\|300]] | The fourteenth slide addresses service discovery in Zephyr, emphasizing the need to set up parameters and callbacks and noting the lack of comprehensive samples.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_015.jpg\|300]] | The fifteenth slide presents the Zephyr GATT API, detailing the bt_gatt_discover function and the structure for discovery parameters.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_016.jpg\|300]] | The sixteenth slide continues with the Zephyr GATT API, describing the discovery function type and the structure for GATT attributes.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_017.jpg\|300]] | The seventeenth slide illustrates functions for discovering primary services and characteristics, highlighting that seemingly linear code may be asynchronous in practice.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_018.jpg\|300]] | The eighteenth slide discusses pitfalls with BLE Central Devices in Zephyr, noting issues like limited documentation, simplistic examples, and the complexity of the Bluetooth subsystem.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_019.jpg\|300]] | The nineteenth slide offers hints for productivity, suggesting looking at the source code for clarity and using an event loop to simplify concurrency issues.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_020.jpg\|300]] | The twentieth slide showcases the portability of demo code, which works on different boards without board-specific code, though only simple applications were tested.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_021.jpg\|300]] | The twenty-first slide discusses tools for BLE development, including emulator support with QEMU and native simulators, providing links for more information.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_022.jpg\|300]] | The twenty-second slide suggests further resources, including a demo project, Nordic Semiconductor's introduction to BLE, and tools for tinkering with BLE devices.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_023.jpg\|300]] | The twenty-third slide concludes with a thank you note and information about Inovex, Florian Limberger's employer, encouraging attendees to visit the Zephyr table and join the community on Discord.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_024.jpg\|300]] | The twenty-fourth slide shares motivation from a recent project implementing the Proximity Profile on nRF52833/nRF52840, covering services like Link Loss, Immediate Alert, Tx Power, and Battery Service.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_025.jpg\|300]] | The twenty-fifth slide provides a code example for using the Zephyr GATT API, showing how to set up discovery parameters and initiate discovery.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_026.jpg\|300]] | The twenty-sixth slide continues with the Zephyr GATT API, illustrating a discovery function that processes attributes and handles characteristic discovery.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_027.jpg\|300]] | The twenty-seventh slide addresses handling multiple services gracefully, showing code for setting up discovery parameters and initiating discovery.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_028.jpg\|300]] | The twenty-eighth slide continues handling multiple services, detailing a discovery function that processes service and characteristic attributes.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_029.jpg\|300]] | The twenty-ninth slide continues handling multiple services, explaining how to iterate over characteristics and update discovery parameters.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_030.jpg\|300]] | The thirtieth slide recaps service discovery strategies, comparing known service discovery by UUID with iterating over all primary services.
| ![[FOSDEM 2025/assets/Developing-BLE-Host-Applications-with-Zephyr/preview_031.jpg\|300]] | The thirty-first slide reflects on solving issues, noting observations and concluding with a recommendation to simplify by implementing non-standard services.
## Links
[Zephyr Project Homepage](https://zephyrproject.org)
[Zephyr Repository](https://github.com/zephyrproject-rtos/zephyr)
[Bluetooth 6.0 Specification](https://www.bluetooth.com/specifications/specs/)
[Zephyr Bluetooth Documentation](https://docs.zephyrproject.org/latest/connectivity/bluetooth/index.html)
[Video recording (MP4)](https://video.fosdem.org/2025/h1302/fosdem-2025-6262-developing-ble-host-applications-with-zephyr.av1.mp4)
[Video recording subtitle file (VTT)](https://video.fosdem.org/2025/h1302/fosdem-2025-6262-developing-ble-host-applications-with-zephyr.vtt)
[Video recording (AV1/WebM)](https://video.fosdem.org/2025/h1302/fosdem-2025-6262-developing-ble-host-applications-with-zephyr.av1.webm)
[Chat room (web)](https://fosdem.org/2025/chat/h1302)
[Chat room (app)](https://fosdem.org/2025/chat/h1302/app)
[Submit Feedback](https://fosdem.org/2025/feedback/fosdem-2025-6262-developing-ble-host-applications-with-zephyr)