Microchip® Advanced Software Framework

blp_sensor.h File Reference

Blood Pressure Sensor Profile declarations.

Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.

Macros

#define ADV_DATA_LEN   (18)
 ADV_DATA_LEN. More...
 
#define ADV_TYPE_LEN   (0x01)
 ADV_TYPE_LEN. More...
 
#define BLP_SENSOR_ADV_DATA_COMP_16_UUID_TYPE   (0x03)
 HR_SENSOR_ADV_DATA_UUID_TYPE is complete 16 bit uuid type. More...
 
#define BLP_SENSOR_ADV_DATA_NAME_DATA   ("ATMEL-BLP")
 
#define BLP_SENSOR_ADV_DATA_NAME_LEN   (9)
 BLP_SENSOR_ADV_DATA_NAME_LEN the length of the device name. More...
 
#define BLP_SENSOR_ADV_DATA_NAME_TYPE   (0x09)
 BLP_SENSOR_ADV_DATA_NAME_TYPE the gap ad data type. More...
 
#define BLP_SENSOR_ADV_DATA_UUID_LEN   (4)
 HR_SENSOR_ADV_DATA_UUID_LEN the total length for hr uuid and dis uuid. More...
 
#define BLP_SENSOR_ADV_TIMEOUT   (655)
 BLP_SENSOR_ADV_TIMEOUT Advertising time-out between 0x0001 and 0x028F in seconds, 0x0000 disables time-out. More...
 
#define BLP_SENSOR_FAST_ADV   (100)
 APP_BLP_SENSOR_FAST_ADV between 0x0020 and 0x4000 in 0.625 ms units (20ms to 10.24s). More...
 
#define DEVICE_INFORMATION_SERVICE_UUID   (0x180A)
 DEVICE_INFORMATION_SERVICE_UUID. More...
 
#define SCAN_RESP_LEN   (10)
 scan_resp_len is the length of the scan response data More...
 
#define UUID_16_BIT_LEN   (0x02)
 

Typedefs

typedef void(* blp_indication_callback_t )(bool)
 
typedef void(* blp_notification_callback_t )(bool)
 

Functions

void blp_disconnection (void)
 blp_disconnection called by the application to disconnect More...
 
at_ble_status_t blp_indication_confirmation_handler (void *params)
 blp_indication_confirmation_handler called by ble manager to give the status of notification sent More...
 
at_ble_status_t blp_notification_confirmation_handler (void *params)
 blp_notification_confirmation_handler called by ble manager to give the status of notification sent More...
 
void blp_sensor_adv (void)
 blp_sensor_adv adds the advertisement data of the profile and starts advertisement More...
 
at_ble_status_t blp_sensor_char_changed_handler (void *char_handle)
 blp_sensor_char_changed_handler called by the ble manager after a change in the characteristic More...
 
at_ble_status_t blp_sensor_connected_state_handler (void *conn_params)
 blp_sensor_connected_state_handler called by ble manager after a change in characteristic More...
 
at_ble_status_t blp_sensor_disconnect_event_handler (void *disconnect)
 blp_sensor_disconnect_event_handler called by ble manager after disconnection event received More...
 
void blp_sensor_init (void *param)
 blp_sensor_init initializes and defines the services of the blp profile More...
 
void blp_sensor_send_indication (uint8_t *blp_data, uint8_t length)
 blp_sensor_send_indication adds the new characteristic value and sends the indication More...
 
void blp_sensor_send_notification (uint8_t *hr_data, uint8_t length)
 blp_sensor_send_notification disconnects with the peer device called by the application More...
 
void blp_sensor_service_define (void)
 blp_sensor_service_define defines the services of the profile More...
 
void blp_sensor_service_init (void)
 blp_sensor_service_init initializes the services of the profile More...
 
void register_blp_indication_handler (blp_indication_callback_t blp_indication_handler)
 register_blp_indication_handler registers the indication handler passed by the application More...
 
void register_blp_notification_handler (blp_notification_callback_t blp_notificaton_handler)
 register_blp_notification_handler registers the notification handler passed by the application More...
 

#define ADV_DATA_LEN   (18)

ADV_DATA_LEN.

#define BLP_SENSOR_ADV_DATA_COMP_16_UUID_TYPE   (0x03)

HR_SENSOR_ADV_DATA_UUID_TYPE is complete 16 bit uuid type.

#define BLP_SENSOR_ADV_DATA_NAME_DATA   ("ATMEL-BLP")
#define BLP_SENSOR_ADV_DATA_NAME_LEN   (9)

BLP_SENSOR_ADV_DATA_NAME_LEN the length of the device name.

#define BLP_SENSOR_ADV_DATA_NAME_TYPE   (0x09)

BLP_SENSOR_ADV_DATA_NAME_TYPE the gap ad data type.

#define BLP_SENSOR_ADV_DATA_UUID_LEN   (4)

HR_SENSOR_ADV_DATA_UUID_LEN the total length for hr uuid and dis uuid.

#define BLP_SENSOR_ADV_TIMEOUT   (655)

BLP_SENSOR_ADV_TIMEOUT Advertising time-out between 0x0001 and 0x028F in seconds, 0x0000 disables time-out.

Referenced by blp_sensor_adv().

#define BLP_SENSOR_FAST_ADV   (100)

APP_BLP_SENSOR_FAST_ADV between 0x0020 and 0x4000 in 0.625 ms units (20ms to 10.24s).

Referenced by blp_sensor_adv().

#define DEVICE_INFORMATION_SERVICE_UUID   (0x180A)

DEVICE_INFORMATION_SERVICE_UUID.

#define SCAN_RESP_LEN   (10)

scan_resp_len is the length of the scan response data

#define UUID_16_BIT_LEN   (0x02)

typedef void(* blp_indication_callback_t)(bool)
typedef void(* blp_notification_callback_t)(bool)

void blp_disconnection ( void  )

blp_disconnection called by the application to disconnect

References at_ble_disconnect(), AT_BLE_SUCCESS, AT_BLE_TERMINATED_BY_USER, connection_handle, and DBG_LOG.

Referenced by update_blp_sensor_value().

at_ble_status_t blp_indication_confirmation_handler ( void *  params)

blp_indication_confirmation_handler called by ble manager to give the status of notification sent

Parameters
[in]at_ble_cmd_complete_event_taddress of the cmd completion
Returns
AT_BLE_SUCCESS on success

References AT_BLE_SUCCESS, DBG_LOG_DEV, and at_ble_cmd_complete_event_t::status.

at_ble_status_t blp_notification_confirmation_handler ( void *  params)

blp_notification_confirmation_handler called by ble manager to give the status of notification sent

Parameters
[in]at_ble_cmd_complete_event_taddress of the cmd completion
Returns
AT_BLE_SUCCESS on success

References AT_BLE_SUCCESS, DBG_LOG_DEV, and at_ble_cmd_complete_event_t::status.

void blp_sensor_adv ( void  )

blp_sensor_adv adds the advertisement data of the profile and starts advertisement

blp_sensor_adv adds the advertisement data of the profile and starts advertisement

References AT_BLE_ADV_FP_ANY, AT_BLE_ADV_GEN_DISCOVERABLE, at_ble_adv_start(), AT_BLE_ADV_TYPE_UNDIRECTED, AT_BLE_SUCCESS, BLP_SENSOR_ADV_TIMEOUT, BLP_SENSOR_FAST_ADV, DBG_LOG, and NULL.

Referenced by app_disconnected_state_handler(), and main().

at_ble_status_t blp_sensor_char_changed_handler ( void *  char_handle)

blp_sensor_char_changed_handler called by the ble manager after a change in the characteristic

Parameters
[in]at_ble_characteristic_changed_twhich contains handle of characteristic and new value
Returns
AT_BLE_SUCCESS

References AT_BLE_SUCCESS, blp_char_change_handler(), BLP_INDICATION_DISABLE, BLP_INDICATION_ENABLE, BLP_NOTIFICATION_DISABLE, BLP_NOTIFICATION_ENABLE, indication_cb, and notification_cb.

at_ble_status_t blp_sensor_connected_state_handler ( void *  conn_params)

blp_sensor_connected_state_handler called by ble manager after a change in characteristic

Parameters
[in]at_ble_connected_twhich has connection handle and the peer device address

References AT_BLE_SUCCESS, and connection_handle.

at_ble_status_t blp_sensor_disconnect_event_handler ( void *  disconnect)

blp_sensor_disconnect_event_handler called by ble manager after disconnection event received

@param[in] at_ble_disconnected_t    which has connection handle and

reason for disconnection

References ALL_UNUSED, and AT_BLE_SUCCESS.

void blp_sensor_send_indication ( uint8_t *  blp_data,
uint8_t  length 
)

blp_sensor_send_indication adds the new characteristic value and sends the indication

Parameters
[in]blpthe new blp characteristic value needs to be updated
[in]lengthlength of new characteristic value

Updating the new characteristic value

Sending the indication for the updated characteristic

References at_ble_characteristic_value_set(), at_ble_indication_send(), AT_BLE_SUCCESS, at_ble_characteristic_t::char_val_handle, connection_handle, DBG_LOG, and hr_gatt_service_handler::serv_chars.

Referenced by app_indication_handler(), and blp_char_indication().

void blp_sensor_send_notification ( uint8_t *  blp_data,
uint8_t  length 
)

blp_sensor_send_notification disconnects with the peer device called by the application

blp_sensor_send_notification disconnects with the peer device called by the application

Parameters
[in]blp_datathe new hr characteristic value needs to be updated
[in]lengthlength of new characteristic value

Updating the new characteristic value

Sending the notification for the updated characteristic

References at_ble_characteristic_value_set(), at_ble_notification_send(), AT_BLE_SUCCESS, at_ble_characteristic_t::char_val_handle, connection_handle, DBG_LOG, and hr_gatt_service_handler::serv_chars.

Referenced by blp_char_notification().

void blp_sensor_service_define ( void  )

blp_sensor_service_define defines the services of the profile

References AT_BLE_SUCCESS, blp_primary_service_define(), DBG_LOG, and dis_primary_service_define().

Referenced by blp_sensor_init().

void blp_sensor_service_init ( void  )

blp_sensor_service_init initializes the services of the profile

blp_sensor_service_init initializes the services of the profile

References blp_init_service(), and dis_init_service().

Referenced by blp_sensor_init().

void register_blp_indication_handler ( blp_indication_callback_t  blp_indication_handler)

register_blp_indication_handler registers the indication handler passed by the application

Parameters
[in]blp_indication_callback_taddress of the indication handler function to be called

References indication_cb.

Referenced by main().

void register_blp_notification_handler ( blp_notification_callback_t  blp_notificaton_handler)

register_blp_notification_handler registers the notification handler passed by the application

Parameters
[in]blp_notification_callback_taddress of the notification handler function to be called

References notification_cb.

Referenced by main().