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

Higher precision in BLE_UUID_HEALTH_THERMOMETER_SERVICE

Hi,

I am trying to include temperature (read from DS18B20) in advertisement data using BLE_UUID_HEALTH_THERMOMETER_SERVICE. So far it works fine, but my temperature is multiplied by 10 (234 instead of 23.4). I use following code (inspired by examples I found), on nrf51822:

  uint32_t temperature_data = measure_temp_ds18b20();

  service_data[1].service_uuid = BLE_UUID_HEALTH_THERMOMETER_SERVICE;
  service_data[1].data.size    = sizeof(temperature_data);
  service_data[1].data.p_data  = (uint8_t *) &temperature_data;

Temperature is shown correctly (e.g. in nRF Temp app on android) but of course as 234, instead of 23.4. Is it possible to send this value as fractional?

greetings, Bartek

Parents
  • All this stuff, thermometer profile, format stuff, ought to be on the BT SIG site, but they seem to have released a new one, broken all the links and removed all the useful information. There used to be great tables you could find which showed the mandated data format for all the characteristic types defined by the SIG, plus the description of al the format codes and everything else. Hopefully they'll fix this and put the information back because, surprisingly, the profile specs don't contain the information about data formats.

Reply
  • All this stuff, thermometer profile, format stuff, ought to be on the BT SIG site, but they seem to have released a new one, broken all the links and removed all the useful information. There used to be great tables you could find which showed the mandated data format for all the characteristic types defined by the SIG, plus the description of al the format codes and everything else. Hopefully they'll fix this and put the information back because, surprisingly, the profile specs don't contain the information about data formats.

Children
No Data
Related