Microchip® Advanced Software Framework

hr_sensor_app.h File Reference

Heart Rate Sensor Application Declarations.

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

Macros

#define ACTIVITY_BRISK_WALKING   (2)
 
#define ACTIVITY_FAST_RUNNING   (4)
 
#define ACTIVITY_NORMAL   (0)
 Activities of user. More...
 
#define ACTIVITY_RUNNING   (3)
 
#define ACTIVITY_WALKING   (1)
 
#define DEFAULT_ACTIVITY   (0xFF)
 
#define END_OF_LAST_ACTIVITY   (200)
 
#define ENERGY_EXP_BRISK_WALKING   (20)
 
#define ENERGY_EXP_FAST_RUNNING   (60)
 
#define ENERGY_EXP_NORMAL   (3)
 energy expended for various activities More...
 
#define ENERGY_EXP_RUNNING   (40)
 
#define ENERGY_EXP_WALKING   (10)
 
#define ENERGY_EXPENDED_FIELD_PRESENT   (0x1 << 3)
 ENERGY_EXPENDED_FIELD_PRESENT represents energy expended inclusion. More...
 
#define ENERGY_RESET   (0)
 
#define HEART_RATE_MAX_BRISK_WALK   (110)
 
#define HEART_RATE_MAX_FAST_RUNNING   (151)
 
#define HEART_RATE_MAX_NORM   (70)
 
#define HEART_RATE_MAX_RUNNING   (130)
 
#define HEART_RATE_MAX_WALKING   (90)
 
#define HEART_RATE_MIN_BRISK_WALK   (91)
 
#define HEART_RATE_MIN_FAST_RUNNING   (130)
 
#define HEART_RATE_MIN_NORM   (50)
 Heart Rate maximum and minimum values for various activities. More...
 
#define HEART_RATE_MIN_RUNNING   (111)
 
#define HEART_RATE_MIN_WALKING   (71)
 
#define HR_CHAR_VALUE_LEN   (10)
 The maximum length of the hr measurement characteristic data. More...
 
#define HR_VALUE_FORMAT_UINT16   (0x1 << 0)
 HR_VALUE_FORMAT_UINT16 the bit to represent hr value sent is 16 bit. More...
 
#define NOTIFICATION_INTERVAL   (1)
 Notification interval to determine the frequency of notifications. More...
 
#define RR_INTERVAL_VALUE_PRESENT   (0x1 << 4)
 RR_INTERVAL_VALUE_PRESENT represents the rr value inclusion. More...
 
#define RR_VALUE_MAX   (1000)
 RR interval maximum and minimum values for simulation of rr values. More...
 
#define RR_VALUE_MIN   (100)
 
#define SENSOR_CONTACT_FTR_NOT_SPRTD_CONTACT_DTD   (0x3 << 1)
 SENSOR_CONTACT_FTR_NOT_SPRTD_NOT_CONTACT to represent the sensor contact info. More...
 
#define SENSOR_CONTACT_FTR_NOT_SPRTD_NOT_CONTACT   (0x1 << 2)
 SENSOR_CONTACT_FTR_NOT_SPRTD_NOT_CONTACT to represent the sensor contact info. More...
 
#define START_OF_FIRST_ACTIVITY   (0)
 time limit of last activity More...
 
#define TIME_BRISK_WALK_LIMIT   (120)
 
#define TIME_FAST_RUNNING_LIMIT   (200)
 
#define TIME_NORMAL_LIMIT   (40)
 Time counter for change of activities by user. More...
 
#define TIME_RUNNING_LIMIT   (160)
 
#define TIME_WALKING_LIMIT   (80)
 

Functions

static at_ble_status_t app_connected_event_handler (void *params)
 connected state handler More...
 
static at_ble_status_t app_disconnected_event_handler (void *params)
 disconnected state handler More...
 
at_ble_status_t app_notification_cfm_handler (void *params)
 app_notification_cfm_handler called by ble manager to give the status of notification sent More...
 

#define ACTIVITY_BRISK_WALKING   (2)
#define ACTIVITY_FAST_RUNNING   (4)
#define DEFAULT_ACTIVITY   (0xFF)
#define END_OF_LAST_ACTIVITY   (200)
#define ENERGY_EXP_BRISK_WALKING   (20)
#define ENERGY_EXP_FAST_RUNNING   (60)
#define ENERGY_EXP_NORMAL   (3)
#define ENERGY_EXP_RUNNING   (40)
#define ENERGY_EXP_WALKING   (10)
#define ENERGY_EXPENDED_FIELD_PRESENT   (0x1 << 3)

ENERGY_EXPENDED_FIELD_PRESENT represents energy expended inclusion.

Referenced by ble_heart_rate_process(), and hr_measurment_send().

#define ENERGY_RESET   (0)
#define HEART_RATE_MAX_BRISK_WALK   (110)
#define HEART_RATE_MAX_FAST_RUNNING   (151)
#define HEART_RATE_MAX_NORM   (70)
#define HEART_RATE_MAX_RUNNING   (130)
#define HEART_RATE_MAX_WALKING   (90)
#define HEART_RATE_MIN_BRISK_WALK   (91)
#define HEART_RATE_MIN_FAST_RUNNING   (130)
#define HEART_RATE_MIN_NORM   (50)

Heart Rate maximum and minimum values for various activities.

Referenced by ble_heart_rate_value_init(), and heart_rate_value_init().

#define HEART_RATE_MIN_RUNNING   (111)
#define HEART_RATE_MIN_WALKING   (71)
#define HR_CHAR_VALUE_LEN   (10)

The maximum length of the hr measurement characteristic data.

Referenced by ble_heart_rate_process(), and hr_measurment_send().

#define HR_VALUE_FORMAT_UINT16   (0x1 << 0)

HR_VALUE_FORMAT_UINT16 the bit to represent hr value sent is 16 bit.

#define NOTIFICATION_INTERVAL   (1)

Notification interval to determine the frequency of notifications.

Referenced by app_notification_handler(), and ble_heart_rate_handle_paired_event().

#define RR_INTERVAL_VALUE_PRESENT   (0x1 << 4)

RR_INTERVAL_VALUE_PRESENT represents the rr value inclusion.

Referenced by ble_heart_rate_process(), and hr_measurment_send().

#define RR_VALUE_MAX   (1000)

RR interval maximum and minimum values for simulation of rr values.

Referenced by ble_heart_rate_process(), and hr_measurment_send().

#define RR_VALUE_MIN   (100)
#define SENSOR_CONTACT_FTR_NOT_SPRTD_CONTACT_DTD   (0x3 << 1)

SENSOR_CONTACT_FTR_NOT_SPRTD_NOT_CONTACT to represent the sensor contact info.

#define SENSOR_CONTACT_FTR_NOT_SPRTD_NOT_CONTACT   (0x1 << 2)

SENSOR_CONTACT_FTR_NOT_SPRTD_NOT_CONTACT to represent the sensor contact info.

#define START_OF_FIRST_ACTIVITY   (0)

time limit of last activity

Referenced by ble_heart_rate_handle_timer_event(), and timer_callback_handler().

#define TIME_BRISK_WALK_LIMIT   (120)
#define TIME_FAST_RUNNING_LIMIT   (200)
#define TIME_NORMAL_LIMIT   (40)

Time counter for change of activities by user.

#define TIME_RUNNING_LIMIT   (160)
#define TIME_WALKING_LIMIT   (80)

static at_ble_status_t app_connected_event_handler ( void *  params)
static

connected state handler

Parameters
[in]statusof the application
static at_ble_status_t app_disconnected_event_handler ( void *  params)
static

disconnected state handler

Parameters
[in]statusof the application
at_ble_status_t app_notification_cfm_handler ( void *  params)

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

Parameters
[in]at_ble_cmd_complete_event_taddress of the cmd completion

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

Parameters
[in]at_ble_cmd_complete_event_taddress of the cmd completion

References AT_BLE_SUCCESS, DBG_LOG_DEV, notification_sent, and at_ble_cmd_complete_event_t::status.