connectivity-ble
Skill68 starsChanged 7 months agoApache-2.0View on GitHub
Bluetooth Low Energy (BLE) integration for Zephyr RTOS. Covers GATT Services/Characteristics, GAP advertising, connection parameters, power optimization strategies, and the professional Send-When-Idle design pattern. Trigger when adding BLE connectivity, optimizing battery life for wireless devices, or implementing custom GATT profiles.
In this repository21 other files it gives its agents.
- zephyr-agent-skillsSkill
- board-bringupSkill
- build-systemSkill
- connectivity-ipSkill
- connectivity-usb-canSkill
- devicetreeSkill
- hardware-ioSkill
- industrialSkill
- iot-protocolsSkill
- kernel-basicsSkill
- kernel-servicesSkill
- multicoreSkill
- native-simSkill
- power-performanceSkill
- security-updatesSkill
- specializedSkill
- storageSkill
- testing-debuggingSkill
- zephyr-foundationsSkill
- zephyr-indexSkill
- zephyr-moduleSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 43
Decoupled Messaging: Use Zbus to feed data into the BLE module, keeping the radio logic separate from the application logic.
- Distinctive: line 44
Idle Bundling: Use the "Send-When-Idle" pattern specifically to reduce the number of wake-ups for the radio controller.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Zephyr Connectivity: BLE
Implement robust, low-power Bluetooth Low Energy applications using Zephyr's industry-standard BLE stack.
Core Workflows
1. BLE Fundamentals
Set up advertising, define GATT services, and manage connections.
- Reference: ble_fundamentals.md
- Key Tools:
BT_GATT_SERVICE_DEFINE,bt_le_adv_start,BT_CONN_CB_DEFINE.
2. Send-When-Idle Pattern
Optimize radio usage by bundling data and transmitting only during idle periods.
- Reference: send_when_idle.md
- Key Tools:
k_work_delayable, Workqueues, SMF integration.
3. Power Optimization
Fine-tune intervals and connection parameters for maximum battery life.
- Reference: power_optimization.md
- Key Tools:
bt_le_conn_param, Advertising intervals, PHY selection.
Quick Start (Advertising)
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y#include <zephyr/bluetooth/bluetooth.h>
void start_simple_adv(void) {
bt_enable(NULL);
bt_le_adv_start(BT_LE_ADV_CONN_NAME, NULL, 0, NULL, 0);
}Professional Patterns (Wireless Design)
- Aggressive Latency: Increase peripheral latency to allow the radio to stay off longer during quiet periods.
- Decoupled Messaging: Use Zbus to feed data into the BLE module, keeping the radio logic separate from the application logic.
- Idle Bundling: Use the "Send-When-Idle" pattern specifically to reduce the number of wake-ups for the radio controller.
Automation Tools
- ble_timing_helper.py: Convert advertising/connection intervals from ms to BLE timing units.
Examples & Templates
- gatt_service_template.c: Starter custom GATT service definition.
Validation Checklist
- Device advertises with expected name/flags and is discoverable by a BLE scanner.
- Central can connect, exchange GATT data, and disconnect without stack errors.
- Configured connection parameters are reflected after negotiation.
- Send-When-Idle flow batches traffic instead of transmitting every sample immediately.
Resources
- References:
ble_fundamentals.md: GATT, GAP, and connection basics.send_when_idle.md: Implementing the idle-bundle pattern.power_optimization.md: Parameter tuning and power-saving Kconfigs.
- Scripts:
ble_timing_helper.py: BLE interval conversion helper.
- Assets:
gatt_service_template.c: Custom service template for GATT.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

