LED Button Service (LBS)

This module implements a custom LED Button Service with LED and Button Characteristics.

Overview

During initialization, the module adds the LED Button Service and Characteristics to the Bluetooth LE stack database.

The application must supply an event handler for receiving LED Button Service events. The service then uses this handler to notify the application when the LED value changes.

The service also provides a function for letting the application notify the state of the Button Characteristic to connected peers.

Configuration

Set the CONFIG_BLE_LBS Kconfig option to enable the service.

Initialization

The service instance is declared using the BLE_LBS_DEF macro, specifying the name of the instance. The service is initialized by calling the ble_lbs_init() function. See the ble_lbs_config struct for configuration details, in addition to the LBS specification.

Usage

Events from the service are forwarded through the event handler specified during initialization. For a full list of events, see the ble_lbs_evt_type enum.

The application can send a button change notification by calling the ble_lbs_on_button_change() function.

Dependencies

This service has the following Bare Metal dependencies:

API documentation

Header file: include/bm/bluetooth/services/ble_lbs.h
Source files: subsys/bluetooth/services/ble_lbs/

LED Button Service API reference