The mesh snip applications shows how to implement mesh models defined by SIG in mesh-specifications.
The battery level value you have observed is the value set for battery_level in mesh_battery_t structure. It is upto the designer how to read the battery level of the associated hardware.
// test data
app_state.battery_level = 99;
app_state.time_to_discharge = 200;
app_state.time_to_charge = 300;
app_state.presence = WICED_BT_MESH_BATTERY_FLAG_PRESENT_REMOVABLE;
app_state.level_inidicator = WICED_BT_MESH_BATTERY_FLAG_LEVEL_GOOD;
app_state.charging = WICED_BT_MESH_BATTERY_FLAG_CHARGING;
app_state.servicability = WICED_BT_MESH_BATTERY_FLAG_SERVICE_NOT_REQUIRED;
Will it always stay at 99?
how can i get the battery voltage level of the hardware and print to waced ... UART?
I have seen that the temperature sensor example changes the temperature level, I also want the true battery voltage level to be printed in wace .... UART as in the code of the temperature sensor example
Do I have to connect the voltage of the battery to another pin like the one of the temperature sensor? and I do the conversion or what could I do?
What codes could I use?
in the end I want that in this code that you gave me(Re: we need help with BLE MESH ), that in the data variable sent by the p_scan_result-> remote_bd_addr, p_scan_result-> rssi, the data is also sent with the battery voltage level to another board through the mesh network
Please, can you help me?
In Modustoolbox, the code examples are grouped into fully functional demonstrations (MeshDemo group), and smaller code snippets demonstrate specific Mesh Models (Mesh-Snip group).
mesh_battery_server (or client), which is a snip app, is not coded to read the battery voltage. Instead the Generic battery model implementation is demonstrated in it. So that anyone can develop a logic to read the battery voltage (ADC read), convert it into percentage and update the app_state.battery_level variable.
I would suggest you to go through the lab manual and it's projects, to understand the scope and capability of Modustoolbox.