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

How do I set specific attribute format? I added ble_gatts_char_pf_t descriptor but nothing changed

Hi, I setup my attibute as 20B array. I'd like to change default data type in Presentation Format descriptor because the default value that is reported to me by BLE Scanner on Android is FLOAT32 that is ambiguos. I'd like rather set it to string data type.

so in my code calling sd_ble_gatts_characteristic_add() function I added structure: ble_gatts_char_pf_t char_pf; filled by memset(&char_pf, 0, sizeof(char_pf)); char_pf.format=BLE_GATT_CPF_FORMAT_UTF8S;

and then filled a pointer in ble_gatts_char_md_t char_md structure char_md.p_char_pf=&char_pf;

that is then passed to

sd_ble_gatts_characteristic_add(p_svcs->service_handle, &char_md, &attr_char_value, &p_svcs->app_char_handles));

But after that I cannot see any change in data type. Do I need fill other ble_gatts_char_pf_t members? int8_t exponent; uint16_t unit; uint8_t name_space; uint16_t desc;

Or do I need to create some another descriptor?

Parents
  • Have you tried using our Master Control Panel on Windows with your device? It's not certain that all applications or Centrals will use such presentation format descriptors, so even if the descriptor has been added correctly, it may not change anything.

    Using MCP you should however be able to see whether the descriptor is actually there, and also whether it contains a reasonable value. If a program you want to talk to doesn't honor the descriptor, there is unfortunately not much you can do about it.

Reply
  • Have you tried using our Master Control Panel on Windows with your device? It's not certain that all applications or Centrals will use such presentation format descriptors, so even if the descriptor has been added correctly, it may not change anything.

    Using MCP you should however be able to see whether the descriptor is actually there, and also whether it contains a reasonable value. If a program you want to talk to doesn't honor the descriptor, there is unfortunately not much you can do about it.

Children
No Data
Related