| 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 | Functions
TX Power Service
BLE Services

TX Power Service module. More...

## Modules
| TX Power Service configuration

## Data Structures
struct | ble_tps_init_t
| TX Power Service init structure. This contains all options and data needed for initialization of the service. More...
struct | ble_tps_t
| TX Power Service structure. This contains various status information for the service. More...

## Functions
uint32_t | ble_tps_init (ble_tps_t *p_hrs, const ble_tps_init_t *p_tps_init)
| Function for initializing the TX Power Service. More...
void | ble_tps_on_ble_evt (ble_tps_t *p_tps, ble_evt_t *p_ble_evt)
| Function for handling the Application's BLE Stack events. More...
uint32_t | ble_tps_tx_power_level_set (ble_tps_t *p_tps, int8_t tx_power_level)
| Function for setting the state of the Sensor Contact Detected bit. More...

## Detailed Description

TX Power Service module.

This module implements the TX Power Service with the TX Power Level characteristic. During initialization it adds the TX Power Service and TX Power Level characteristic with the specified initial value to the BLE stack database.

It provides a function for letting the application update the TX Power Level characteristic.

Note
  Attention! To maintain compliance with Nordic Semiconductor ASA Bluetooth profile qualification listings, this section of source code must not be modified.

## Function Documentation

uint32_t ble_tps_init | ( | ble_tps_t * | p_hrs,
|  | const ble_tps_init_t * | p_tps_init
| ) |  |

Function for initializing the TX Power Service.

Parameters

  [out] | p_hrs | TX Power 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_tps_init | Information needed to initialize the service.

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

void ble_tps_on_ble_evt | ( | ble_tps_t * | p_tps,
|  | 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 TX Power Service.

Parameters

  [in] | p_tps | TX Power Service structure.
  [in] | p_ble_evt | Event received from the BLE stack.

uint32_t ble_tps_tx_power_level_set | ( | ble_tps_t * | p_tps,
|  | int8_t | tx_power_level
| ) |  |

Function for setting the state of the Sensor Contact Detected bit.

Parameters

  [in] | p_tps | TX Power Service structure.
  [in] | tx_power_level | New TX Power Level (unit dBm, range -100 to 20).

Returns
  NRF_SUCCESS on success, otherwise an error code.