This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Write with Response request from multiple clients/mobile apps

Hi all!

Is that possible to identify witch client/mobile app is associated with the write request?

Lets assume that my device can handle multiple mobile applications (on same mobile phone) writing on the same characteristics and I need to provide the proper answer to each app. To avoid getting the wrong readout I would like to synchronize the read request event with the write request for each mobile app.

Example: If app "A" writes "123456" I need to read "654321" and if app "B" writes "ABCDEF" I need to read "FEDCBA"

I need to avoid the scenario that the app "A" and "B" send write requests almost at the same time reading the wrong data, like app "A" reading "FEDCBA" instead of "654321".

I hope to be clear on my problem!

Thanks in advanced!

Parents Reply
  • Thanks Kenneth!

    I got how to do in a different way but I still need more datils how to do that.

    I need to return a error code on WRITE RESPONSE if the received data is wrong. I can manage this on READ RESPONSE but I cant on WRITE.

    When I do a sd_ble_gatts_rw_authorize_reply command using status = BLE_GATT_STATUS_ATTERR_WRITE_NOT_PERMITTED; I got the error NRF_ERROR_INVALID_PARAM.

    Can you give a clue on how to do that?

    Thanks!

Children
Related