Greetings,
I have two nRF52840's where one is modeled as a peripheral and the other as a central. I have created a custom service and characteristics on the peripheral and can connect and read and write. However, I can perform one write and not more. In the example beneath, I am trying to write to the same characteristic twice in consequtive order, as can be seen in the discover_all_completed function.
However, on the peripheral side, I just receive the write of characteristic to be 5:5:5:5, and not 0:1:2:3 afterwards, and I get one error message of "writing to characteristic failed: -120", which looking at errno.h is #define EALREADY 120 /**< Operation already in progress */. I tried putting a k_mutex_lock in bt_write_to_characteristic and k_mutex_unlock in on_sent, but that didn't help either.
This code is largely based on the nRF Uart Service sample / nus_client.c. Could you see what might be the problem?
Best regards,
Jonas