This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BLE v2.1: GATT Read: data not ready, how to delay ?

Hi friends,

I have a GATT server, which has a characteristic which is written by a client with some data, this is processed by the application, and then immediately the client reads back the result (the server does not use any methods to push data back to the client, it's the client who controls the transaction).

The client comes back to read the data too soon and the data is not ready. In the write callback of the profile I send a notification to the application, which starts the processing in its own thread. How can I delay the read callback until the data is available ? I am currently using a semaphore, but it seems the stack doesn't like that, as the data doesn't get sent (it's also a long data, that needs multiple reads).

Any ideas are more than welcome.

Best regards,

Lucian