static void
start_hrm_sensor_cb(appdata_s *ad)
{
dlog_print(DLOG_INFO, LOG_TAG, "listen to my heartbeat");
sensor_error_e err = SENSOR_ERROR_NONE;
sensor_get_default_sensor(SENSOR_HRM, &sensor_info.sensor);
err = sensor_create_listener(sensor_info.sensor, &sensor_info.sensor_listener);
sensor_listener_set_event_cb(sensor_info.sensor_listener, 100, _new_sensor_value, ad);
sensor_listener_start(sensor_info.sensor_listener);
}
static void _new_sensor_value(sensor_h sensor, sensor_event_s *sensor_data, void*user_data)
{
sensor_type_e type;
sensor_get_type(sensor, &type);
char buff[100];
switch (type) {
case SENSOR_HRM:
if(sensor_data->values[0]>0)
{
sprintf(buff,"heart beat = %f",sensor_data->values[0]);
dlog_print(DLOG_INFO, LOG_TAG2, buff);
}
break;
default:
dlog_print(DLOG_ERROR, LOG_TAG, "Not an HRM event");
}
}
using this code
but i can`t get hrm value
if i run other hrm app( for example basic hrm application when first installed)
i need help