nRF51 SDK - S130 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Health Thermometer Service

Health Thermometer Service module. More...

Data Structures

struct  ble_hts_evt_t
 Health Thermometer Service event. More...
 
struct  ieee_float32_t
 FLOAT format (IEEE-11073 32-bit FLOAT, defined as a 32-bit value with a 24-bit mantissa and an 8-bit exponent. More...
 
struct  ble_hts_init_t
 Health Thermometer Service init structure. This contains all options and data needed for initialization of the service. More...
 
struct  ble_hts_s
 Health Thermometer Service structure. This contains various status information for the service. More...
 
struct  ble_hts_meas_s
 Health Thermometer Service measurement structure. This contains a Health Thermometer measurement. More...
 

Macros

#define BLE_HTS_TEMP_TYPE_ARMPIT   1
 
#define BLE_HTS_TEMP_TYPE_BODY   2
 
#define BLE_HTS_TEMP_TYPE_EAR   3
 
#define BLE_HTS_TEMP_TYPE_FINGER   4
 
#define BLE_HTS_TEMP_TYPE_GI_TRACT   5
 
#define BLE_HTS_TEMP_TYPE_MOUTH   6
 
#define BLE_HTS_TEMP_TYPE_RECTUM   7
 
#define BLE_HTS_TEMP_TYPE_TOE   8
 
#define BLE_HTS_TEMP_TYPE_EAR_DRUM   9
 

Typedefs

typedef struct ble_hts_s ble_hts_t
 
typedef void(* ble_hts_evt_handler_t )(ble_hts_t *p_hts, ble_hts_evt_t *p_evt)
 Health Thermometer Service event handler type.
 
typedef struct ble_hts_meas_s ble_hts_meas_t
 Health Thermometer Service measurement structure. This contains a Health Thermometer measurement.
 

Enumerations

enum  ble_hts_evt_type_t {
  BLE_HTS_EVT_INDICATION_ENABLED,
  BLE_HTS_EVT_INDICATION_DISABLED,
  BLE_HTS_EVT_INDICATION_CONFIRMED
}
 Health Thermometer Service event type. More...
 

Functions

uint32_t ble_hts_init (ble_hts_t *p_hts, const ble_hts_init_t *p_hts_init)
 Function for initializing the Health Thermometer Service. More...
 
void ble_hts_on_ble_evt (ble_hts_t *p_hts, ble_evt_t *p_ble_evt)
 Function for handling the Application's BLE Stack events. More...
 
uint32_t ble_hts_measurement_send (ble_hts_t *p_hts, ble_hts_meas_t *p_hts_meas)
 Function for sending health thermometer measurement if indication has been enabled. More...
 
uint32_t ble_hts_is_indication_enabled (ble_hts_t *p_hts, bool *p_indication_enabled)
 Function for checking if indication of Temperature Measurement is currently enabled. More...
 

Detailed Description

Health Thermometer Service module.

This module implements the Health Thermometer Service.

     If an event handler is supplied by the application, the Health Thermometer 
     Service will generate Health Thermometer Service events to the application.
Note
The application must propagate BLE stack events to the Health Thermometer Service module by calling ble_hts_on_ble_evt() from the SoftDevice Event Handler function.
Attention! To maintain compliance with Nordic Semiconductor ASA Bluetooth profile qualification listings, this section of source code must not be modified.

Enumeration Type Documentation

Health Thermometer Service event type.

Enumerator
BLE_HTS_EVT_INDICATION_ENABLED 

Health Thermometer value indication enabled event.

BLE_HTS_EVT_INDICATION_DISABLED 

Health Thermometer value indication disabled event.

BLE_HTS_EVT_INDICATION_CONFIRMED 

Confirmation of a temperature measurement indication has been received.

Function Documentation

uint32_t ble_hts_init ( ble_hts_t p_hts,
const ble_hts_init_t p_hts_init 
)

Function for initializing the Health Thermometer Service.

Parameters
[out]p_htsHealth Thermometer 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_hts_initInformation needed to initialize the service.
Returns
NRF_SUCCESS on successful initialization of service, otherwise an error code.
uint32_t ble_hts_is_indication_enabled ( ble_hts_t p_hts,
bool *  p_indication_enabled 
)

Function for checking if indication of Temperature Measurement is currently enabled.

Parameters
[in]p_htsHealth Thermometer Service structure.
[out]p_indication_enabledTRUE if indication is enabled, FALSE otherwise.
Returns
NRF_SUCCESS on success, otherwise an error code.
uint32_t ble_hts_measurement_send ( ble_hts_t p_hts,
ble_hts_meas_t p_hts_meas 
)

Function for sending health thermometer measurement if indication has been enabled.

The application calls this function after having performed a Health Thermometer measurement. If indication has been enabled, the measurement data is encoded and sent to the client.

Parameters
[in]p_htsHealth Thermometer Service structure.
[in]p_hts_measPointer to new health thermometer measurement.
Returns
NRF_SUCCESS on success, otherwise an error code.
void ble_hts_on_ble_evt ( ble_hts_t p_hts,
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 Health Thermometer Service.

Parameters
[in]p_htsHealth Thermometer Service structure.
[in]p_ble_evtEvent received from the BLE stack.