nRF5 SDK v17.1.0
Modules | Data Structures | Macros | Typedefs | Enumerations | Functions
Immediate Alert Service

Immediate Alert Service module. More...

Modules

 Immediate Alert Service configuration
 

Data Structures

struct  ble_ias_client_context_t
 Immediate Alert Service client context structure. More...
 
struct  ble_ias_evt_t
 Immediate Alert Service event. More...
 
struct  ble_ias_init_t
 Immediate Alert Service init structure. This contains all options and data needed for initialization of the service. More...
 
struct  ble_ias_s
 Immediate Alert Service structure. This contains various status information for the service. More...
 

Macros

#define BLE_IAS_DEF(_name, _ias_max_clients)
 Macro for defining a ble_ias instance. More...
 

Typedefs

typedef struct ble_ias_s ble_ias_t
 
typedef void(* ble_ias_evt_handler_t )(ble_ias_t *p_ias, ble_ias_evt_t *p_evt)
 Immediate Alert Service event handler type.
 

Enumerations

enum  ble_ias_evt_type_t { BLE_IAS_EVT_ALERT_LEVEL_UPDATED }
 Immediate Alert Service event type. More...
 

Functions

uint32_t ble_ias_init (ble_ias_t *p_ias, const ble_ias_init_t *p_ias_init)
 Function for initializing the Immediate Alert Service. More...
 
void ble_ias_on_ble_evt (ble_evt_t const *p_ble_evt, void *p_context)
 Function for handling the Application's BLE Stack events. More...
 
uint32_t ble_ias_alert_level_get (ble_ias_t *p_ias, uint16_t conn_handle, uint8_t *p_alert_level)
 Function for getting value of the Alert Level characteristic. More...
 

Detailed Description

Immediate Alert Service module.

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

The application must supply an event handler for receiving Immediate Alert Service events. Using this handler, the service will notify the application when the Alert Level characteristic value changes.

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

Note
The application must register this module as BLE event observer using the NRF_SDH_BLE_OBSERVER macro. Example:
Attention! To maintain compliance with Nordic Semiconductor ASA Bluetooth profile qualification listings, this section of source code must not be modified.

Macro Definition Documentation

#define BLE_IAS_DEF (   _name,
  _ias_max_clients 
)

Macro for defining a ble_ias instance.

Parameters
_nameName of the instance.
[in]_ias_max_clientsMaximum number of IAS clients connected at a time.

Enumeration Type Documentation

Immediate Alert Service event type.

Enumerator
BLE_IAS_EVT_ALERT_LEVEL_UPDATED 

Alert Level Updated event.

Function Documentation

uint32_t ble_ias_alert_level_get ( ble_ias_t p_ias,
uint16_t  conn_handle,
uint8_t *  p_alert_level 
)

Function for getting value of the Alert Level characteristic.

Parameters
[in]p_iasImmediate Alert Service structure.
[in]conn_handleConnection handle of the destination client.
[out]p_alert_levelAlert Level value which has been set by the specific client.
uint32_t ble_ias_init ( ble_ias_t p_ias,
const ble_ias_init_t p_ias_init 
)

Function for initializing the Immediate Alert Service.

Parameters
[out]p_iasImmediate Alert 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_ias_initInformation needed to initialize the service.
Returns
NRF_SUCCESS on successful initialization of service, otherwise an error code.
void ble_ias_on_ble_evt ( ble_evt_t const *  p_ble_evt,
void *  p_context 
)

Function for handling the Application's BLE Stack events.

Handles all events from the BLE stack of interest to the Immediate Alert Service.

Parameters
[in]p_ble_evtEvent received from the BLE stack.
[in]p_contextImmediate Alert Service structure.

Documentation feedback | Developer Zone | Subscribe | Updated