This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can I change the measurement unit on BLE Heart Rate example?

Hello,

I am using the BLE_app_hrs_pca example and I was wondering whether or not the unit in which my beat rate is encoded (bpm) can be changed. I mean, I would like to set it to beat per hour, for instance, does this value need to be specified on the cccd_md of the BLE service ? If so how can I do it?

I have been reading Nordic tutorial but it is still not completely clear for me.

Looking into ble_hrs.c I can see that the value is defined on BLE_UUID_BLE_ASSIGN() method, however I cannot find the unit that is sent out. Any hints?

memset(&char_md, 0, sizeof(char_md));

char_md.char_props.notify = 1;
char_md.p_char_user_desc  = NULL;
char_md.p_char_pf         = NULL;
char_md.p_user_desc_md    = NULL;
char_md.p_cccd_md         = &cccd_md;
char_md.p_sccd_md         = NULL;

BLE_UUID_BLE_ASSIGN(ble_uuid, BLE_UUID_HEART_RATE_MEASUREMENT_CHAR);

memset(&attr_md, 0, sizeof(attr_md));

attr_md.read_perm  = p_hrs_init->hrs_hrm_attr_md.read_perm;
attr_md.write_perm = p_hrs_init->hrs_hrm_attr_md.write_perm;
attr_md.vloc       = BLE_GATTS_VLOC_STACK;
attr_md.rd_auth    = 0;
attr_md.wr_auth    = 0;
attr_md.vlen       = 1;

thanks in advance

Related