언어 설정

Menu
Sites
Language
About Hrm
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

Responses

5 댓글
Cho

if i send 

in the log call app_dead_handler

Yasin Ali

Hi,

Check required privileges like as below:

<privileges>
        <privilege>http://tizen.org/privilege/healthinfo</privilege>
</privileges>

Hope it will help.

Cho

already contain it 

somtimes i can get sensor value but sometimes not

Yasin Ali

Hi,

In that case, I think you need to make a device reset.

GEUNSOO KIM

Do you mean 'cannot get any hrm value' or 'hrm value is just 0'?

If you are getting 0 value only, keep checking it during at least 15~20 seconds.

HRM means 'Heart Rate per Minute', so it takes quite time to get meaningful data.