cancel
Showing results for 
Search instead for 
Did you mean: 

How to display characteristic value as a float in stm32 toolbox app?

Hichamm
Associate II

I have a program that updates a ble characteristic where it gets displayed on the stm32 toolbox app as however many bytes I set it to in Stm32CubeMX. This which makes sense in terms of default configurations, but if I wanted to display a float value instead how would I go about that?

For reference im using Custom_STM_App_Update_Char() to updating the value where If I pass in a float it gets converted to bytes automatically.

4 REPLIES 4
STTwo-32
ST Employee

Hello @Hichamm 

Could you please clarify your needs. 

Best Regards.

STTwo-32

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hichamm
Associate II

I have a custom BLE service with a characteristic being continuously updated by my program. This characteristic value is displayed on apps such as ST BLE Toolbox and Nrf Connect where I can see the value changing every time it gets updated, but it is displayed as bytes. This makes sense as Custom_STM_App_Update_Char() uses an array of bytes as a parameter rather than a float but I want to see the data displayed as a float value instead.


Hichamm
Associate II

@STTwo-32 any ideas on how to achieve this?

Hello @Hichamm 

I don't think it is as easy as you said. Maybe a good way is to prepare your data and decode it on an array of bytes, send this array and on the reception, re-built the float from the received data (using a secondary application or something else). 

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.