| nRF5 SDK v12.0.0 |

Choose documentation: | nRF5 SDK | S130 SoftDevice API | S132 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Modules | Data Structures | Typedefs | Enumerations | Functions
Link Loss Service
BLE Services

Link Loss Service module. More...

## Modules
| Link Loss Service configuration

## Data Structures
struct | ble_lls_evt_t
| Link Loss Service event. More...
struct | ble_lls_init_t
| Link Loss Service init structure. This contains all options and data needed for initialization of the service. More...
struct | ble_lls_s
| Link Loss Service structure. This contains various status information for the service. More...

## Typedefs
typedef struct ble_lls_s | ble_lls_t
typedef void(* | ble_lls_evt_handler_t )(ble_lls_t *p_lls, ble_lls_evt_t *p_evt)
| Link Loss Service event handler type.

## Enumerations
enum | ble_lls_evt_type_t { BLE_LLS_EVT_LINK_LOSS_ALERT }
| Link Loss Service event type. More...

## Functions
uint32_t | ble_lls_init (ble_lls_t *p_lls, const ble_lls_init_t *p_lls_init)
| Function for initializing the Link Loss Service. More...
void | ble_lls_on_ble_evt (ble_lls_t *p_lls, ble_evt_t *p_ble_evt)
| Function for handling the Application's BLE Stack events. More...
uint32_t | ble_lls_alert_level_get (ble_lls_t *p_lls, uint8_t *p_alert_level)
| Function for getting current value of the Alert Level characteristic. More...

## Detailed Description

Link Loss Service module.

This module implements the Link Loss Service with the Alert Level characteristic. During initialization it adds the Link Loss Service and Alert Level characteristic to the BLE stack database.

The application must supply an event handler for receiving Link Loss Service events. Using this handler, the service will notify the application when the link has been lost, and which Alert Level has been set.

The service also provides a function for letting the application poll the current value of the Alert Level characteristic.

Note
  The application must propagate BLE stack events to the Link Loss Service module by calling ble_lls_on_ble_evt() from the SoftDevice Event Handler callback.
  Attention! To maintain compliance with Nordic Semiconductor ASA Bluetooth profile qualification listings, this section of source code must not be modified.

## Enumeration Type Documentation

enum ble_lls_evt_type_t

Link Loss Service event type.

Enumerator
BLE_LLS_EVT_LINK_LOSS_ALERT | Alert Level Updated event.

## Function Documentation

uint32_t ble_lls_alert_level_get | ( | ble_lls_t * | p_lls,
|  | uint8_t * | p_alert_level
| ) |  |

Function for getting current value of the Alert Level characteristic.

Parameters

  [in] | p_lls | Link Loss Service structure.
  [out] | p_alert_level | Current Alert Level value.

uint32_t ble_lls_init | ( | ble_lls_t * | p_lls,
|  | const ble_lls_init_t * | p_lls_init
| ) |  |

Function for initializing the Link Loss Service.

Parameters

  [out] | p_lls | Link Loss Service structure. This structure will have to be supplied by the application. It will be initialized by this function, and will later be used to identify this particular service instance.
  [in] | p_lls_init | Information needed to initialize the service.

Returns
  NRF_SUCCESS on successful initialization of service, otherwise an error code.

void ble_lls_on_ble_evt | ( | ble_lls_t * | p_lls,
|  | ble_evt_t * | p_ble_evt
| ) |  |

Function for handling the Application's BLE Stack events.

Handles all events from the BLE stack of interest to the Link Loss Service.

Parameters

  [in] | p_lls | Link Loss Service structure.
  [in] | p_ble_evt | Event received from the BLE stack.