STM32CubeWB
STM32CubeWB copied to clipboard
Custom_STM_App_Update_Char() could include a size parameter for supporting characteristics with variable length
In CubeIDE we may define characteristics with variable length (Length characteristic as variable and value length with maximum size).
However, when the code is generated (Custom P2P Server disabled and Custom Template is enabled in BLE Applications and services) the generated code for updating characteristic values do not have any length parameter.
The default size is controlled by local variables inside custom_stm.c and we do have access to the CustomContext as well since it is static inside custom_stm.c. So, we can´t change the size from external code.
The default implementation for Custom_STM_App_Update_Char is below:
tBleStatus Custom_STM_App_Update_Char(Custom_STM_Char_Opcode_t CharOpcode, uint8_t *pPayload) { // ... }
This way, we need to reimplement Custom_STM_App_Update_Char inside custom_stm.c, probably using some protection area. How about to add a support for size in this function call ? Something like:
tBleStatus Custom_STM_App_Update_Char(Custom_STM_Char_Opcode_t CharOpcode, uint8_t *pPayload, uint16 size) { // ... }
Thanks a lot !
ST Internal Reference: 169675
Hello,
I hope you are fine. The issue you reported has been fixed in the frame of version v1.20.0 of the STM32CubeWB published recently on GitHub. Thank you again for having reported.