I've a problem if I send CUSTS1_VAL_NTF_REQ messages too fast. If I send e.g. 3 different messages (e.g. "A", "B" and "C") the SDK is sending 3 to the central, but the central receives often the following messages "B", "B", "C" or "B", "C", "C". I verified this with a sniffer, but the problem also is visible if I use android as a central or a Rasperry Pi. There is no assert thrown in the SDK or an error thrown on any function.
for(int32_t i = 0; i < 3; i++) {
// setup buffer ...
struct custs1_val_ntf_req *req = KE_MSG_ALLOC_DYN(CUSTS1_VAL_NTF_REQ, TASK_CUSTS1, TASK_APP, custs1_val_ntf_req, length);
req->conhdl = app_env->conhdl;
req->handle = CUST1_IDX_SERIAL_RX_VAL;
req->length = length;
memcpy(req->value, buffer, length);
ke_msg_send(req);
}
Device:
Hi marss,
你将不得不等待for the CUSTS1_VAL_NTF_CFM to arrive before sending the next notification for the same characteristic, if not you will update the value's database with the latter value and when the kernel pushes the notification into the buffer it will push two notifications with the same value, since the values of the notifications are acquired from the database. I suggest you to have a look at the following past thread:
https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/bytes-transfered
Thanks, PM_Dialog
Ok, thanks. Quite sad to have messages and than still add another layer to handle this case.