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

How to use HTS to notify temperature instead of indicate ?

As per the example, HTS only the "indicate" property is mandatory. But, I want to use Notify and Read property. The example suggests using the intermediate temperature in order to use Notify property in the temperature measurement. Is there any alternative approach to it?

Thanks in advance!

Parents
  • Hi,

    I'm not sure if I understand your question, but to use notification you can change this line in the function hts_measurement_char_add() ble_hts.c

    char_md.char_props.indicate = 1;
    

    to

    char_md.char_props.notify = 1;
    

    and to enable reading change this:

    attr_md.read_perm  = p_hts_init->hts_meas_attr_md.read_perm;
    

    to e.g. this

    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&attr_md.read_perm);
    

    If you make these changes though, your device will no longer comply with the HTS profile.

  • Are you talking about the Temperature Measurement characteristic in the Health Thermometer service? That should be all you need to enable notification. You won't receive any notification though, before you have also changed the code in on_hts_evt() in main.c to use notification events.

Reply Children
No Data
Related