Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
HTPT APIs

This group includes all HTPT APIs; Database Creation, Send Temperature, ...

Functions

at_ble_status_t at_ble_htpt_create_db (at_ble_htpt_db_config_flag features, at_ble_htpt_temp_type temp_type, uint16_t valid_range_min, uint16_t valid_range_max, uint16_t meas_intv, at_ble_htpt_sec_level sec_lvl, at_ble_handle_t *start_handle)
 This API message shall be used to add an instance of the Health Thermometer service into the database. More...
 
at_ble_status_t at_ble_htpt_enable (at_ble_handle_t conn_handle, at_ble_htpt_ntf_ind_cfg ntf_ind_cfg)
 This API message can be used after the connection with a peer device has been established in order to restore known device bond data, in response a AT_BLE_HTPT_ENABLE_RSP event should be received. More...
 
at_ble_status_t at_ble_htpt_meas_intv_update (uint16_t meas_intv)
 This message is used by the application to order the HTPT profile to generate an indication (if enabled) of the Measurement Interval Char. More...
 
at_ble_status_t at_ble_htpt_temp_send (uint32_t temp, at_ble_prf_date_time_t *time_stamp, at_ble_htpt_temp_flags flags, at_ble_htpt_temp_type type, bool flag_stable_meas)
 This message is used by the application (which handles the temperature device driver and measurements) to send a temperature measurement through the Thermometer role. More...
 

at_ble_status_t at_ble_htpt_create_db ( at_ble_htpt_db_config_flag  features,
at_ble_htpt_temp_type  temp_type,
uint16_t  valid_range_min,
uint16_t  valid_range_max,
uint16_t  meas_intv,
at_ble_htpt_sec_level  sec_lvl,
at_ble_handle_t start_handle 
)

This API message shall be used to add an instance of the Health Thermometer service into the database.

This should be done during the initialization phase of the device , this is a blocking call and no events will be returned

Note : allocated profile will be freed if device is reset or configuration changed Device Configuration APIs

Parameters
[in]featuresIndicate if optional features are supported or not, see at_ble_htpt_db_config_flag
[in]temp_typetype of temperature as defined in org.bluetooth.characteristic.temperature_type
[in]valid_range_minMinimal measurement interval value
[in]valid_range_maxMaximal measurement interval value
[in]meas_intvLatest known value for measurement interval
[in]sec_lvlcan be : Disable(0) , Enable(1), Unauth(2), Auth(3) see at_ble_htpt_sec_level
[out]start_handle: handle of health thermometer service if creation succeeded
Returns
Upon successful completion the function shall return AT_BLE_SUCCESS, Otherwise the function shall return at_ble_status_t

Referenced by htp_init().

at_ble_status_t at_ble_htpt_enable ( at_ble_handle_t  conn_handle,
at_ble_htpt_ntf_ind_cfg  ntf_ind_cfg 
)

This API message can be used after the connection with a peer device has been established in order to restore known device bond data, in response a AT_BLE_HTPT_ENABLE_RSP event should be received.

Parameters
[in]conn_handlehandle of the connection
[in]ntf_ind_cfgEnable notifications or indications for profile characteristics see at_ble_htpt_ntf_ind_cfg
Returns
Upon successful completion the function shall return AT_BLE_SUCCESS, Otherwise the function shall return at_ble_status_t

Referenced by app_connected_event_handler(), app_encryption_status_changed_handler(), and app_pair_done_event_handler().

at_ble_status_t at_ble_htpt_meas_intv_update ( uint16_t  meas_intv)

This message is used by the application to order the HTPT profile to generate an indication (if enabled) of the Measurement Interval Char.

This can be done as the application desires, at each connection, or if the measurement interval value has been modified locally (interface for this is not provided since a normal thermometer would have very few configurable UI elements and configuration should be done through Collector) In response a AT_BLE_HTPT_MEAS_INTV_UPD_RSP event should be received

Parameters
[in]meas_intvMeasurement Interval value
Returns
Upon successful completion the function shall return AT_BLE_SUCCESS, Otherwise the function shall return at_ble_status_t
at_ble_status_t at_ble_htpt_temp_send ( uint32_t  temp,
at_ble_prf_date_time_t time_stamp,
at_ble_htpt_temp_flags  flags,
at_ble_htpt_temp_type  type,
bool  flag_stable_meas 
)

This message is used by the application (which handles the temperature device driver and measurements) to send a temperature measurement through the Thermometer role.

In response a AT_BLE_HTPT_TEMP_SEND_CFM event should be received

Parameters
[in]temptemperature value
[in]time_stampThe time of reading according to the format defined in at_ble_prf_date_time_t
[in]flagstemp flag see at_ble_htpt_temp_flags
[in]typetemp type see at_ble_htpt_temp_type
[in]flag_stable_measstable or intermediate type of temperature (True stable meas, else false), intermediate type is used for display purposes while the measurement is in progress
Returns
Upon successful completion the function shall return AT_BLE_SUCCESS, Otherwise the function shall return at_ble_status_t

Referenced by htp_temperature_send().