How can I implement a custom characteristic which displays the value in range of -100 ... 0 ... 100 %?


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:

0x27AD percentage org.bluetooth.unit.percentage

but without luck.


.exponent = 1; // ???

.unit = 0x27AD


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.

Regards Thomas