I've tried to implement a custom service with a custom chacteristic, that shows the values per notification in the MCP (Master Control Panel) in percentage.
I played around with the ble_gatts_char_pf_t structure, provide the unit with the value proposed here:
but without luck.
.format = BLE_GATT_CPF_FORMAT_SINT8;
.exponent = 1; // ???
.unit = 0x27AD
.name_space = BLE_GATT_CPF_NAMESPACE_DESCRIPTION_UNKNOWN; // tried also: BLE_GATT_CPF_NAMESPACE_BTSIG
Is there any example, which shows, how to setup this structure properly?
It should finally works like the battery level (which is handled in bas.c).
I can see the changeing values during received notifications in MCP, but only as hex value.
Where did I go wrong here?
Thnaks in advance.
Is this Master Control Panel for Windows? It has been a while since I used it, but as far as I remember it doesn't show anything other than hex values.
yes, the tool I used is the MCP for Windows.
But I also tried out another tool on the iPhone called "LightBlue", with the same results. Only hex values are shown.
I guess, that this "tools from the stock" doesn't take care about the format representation, is this right?
It is up to the application to read the presentation format and parse the data accordingly. I don't know about LightBlue, but at least MCP does not. Neither does nRF Connect for mobile.
thanks for your assistence.
So, it seems, I must live with this circumstance until a custom app can handle the format representation correct.