2 years ago
Writes to long characteristic value
Posted byjarirenejensen0 points 1 replyReading the "Training_02_custom_profile_example_v1.1" it states that the long characteristic in user_custs1_def.h "Demonstrate writes to long characteristic value". It is defined as being 50 bytes long. But I do not see code handling the writes to this characteristic.
Form
https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-b…
It seems that the stack should be able to handle characteristic of up to 512 bytes in size.
I can of cause R/W 20 bytes but not more. I am using the user_catch_rest_hndl() function of the example and catching SVC1_IDX_CONTROL_POINT_VAL. In the example this calls an empty function. The signal contains only the first 20 bytes.
To test I have ben using Bluegiga GUI tool to send the data 50bytes, that seems happy writing 50 bytes but not 51 bytes which is OK as the size is 50. Reading using read or read long yields only 20 bytes.
Where do you hide the code "demonstrating writes to long characteristic value"?
Best Regards
2 years ago
嗨jarirenejensen,
The ble_app_peripheral example of the SDK implements the Write Long Characteristic Value. Please, take a look at this example of the SDK. If the length of the characteristic value to be written is greater than 20 bytes, then the user_svc1_long_val_att_info_req_handler() in the user_catch_rest_hndl() function will be triggered. If the length is less than 20 bytes the user_svc1_long_val_wr_ind_handler () will be executed. So, if you want to send more than 20 bytes without MTU exchange, you should do the same implementation as in the user_svc1_long_val_att_info_req_handler() function of the ble_app_peripheral example. Since you do that, the master will send a “Prepare Write Request” and the slave will response with a “Prepare Write Response”. Otherwise, if you want to do a simple write request and send more than 20 bytes, you should increase the MTU size.
Thanks, PM_Dialog