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
  • Yes, I tried MCP and it reads PF descriptor - data type correct as UTF8S so it's a bug of BLE Scanner. Do you know some better Android app?

Reply
  • Yes, I tried MCP and it reads PF descriptor - data type correct as UTF8S so it's a bug of BLE Scanner. Do you know some better Android app?

Children
No Data