2022-07-11 08:02 PM
I have set the data length as variable. The code generate in custom_stm.c also aci_gatt_add_char as CHAR_VALUE_LEN_VARIABLE. But in the Custom_STM_App_Update_char function, it always sent and static const charValueLen.
I fix it by cloning Custom_STM_App_Update_char and add length parameter. It works, The data I sent is not alway const length. But I don't know how to sent a variable data normally.
2022-07-13 02:31 AM
Hello,
Indeed, in the code generate, in the Custom_STM_App_Update_char function, it always sent and static const charValueLen. I think, in aci_gatt_update_char_value function you can use a sizeof(pPayload) for charValueLen in your variable length characteristic, depending how your payload is defined.
I will checked this point with the development team, to improve the feature for the next release.
Best Regards
2022-08-19 05:50 AM
Hi @Remy ISSALYS ,
Unfortunately, this won't work, since you just get the size of the pointer.
the payload variable is defined as uint_8 *pPayload.
Regards
2022-08-19 06:09 AM
Hello,
Yes, you have right, in this case the best way is to add length parameter in Custom_STM_App_Update_char function.
Best Regards