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

matching error when write in characteriqtic

Hi Nordic,

I have 2 charac i can write, let's name it A and B. 

When i write into A, it trig ble_A_on_ble_evt , BLE_GATTS_EVT_WRITE , no problem.

But when i write into B, it trig ble_A_on_ble_evt AND ble_B_on_ble_evt  ,BLE_GATTS_EVT_WRITE !

when writing in B and call ble_A_on_ble_evt , on_write function, the check of handles obviously fail, indicating that service A is not concern by this writting.

This two charac have no code in common, no UUID, service UUID etc in common... 

The order of calling the two handler depends on PRIO set in NRF_SDH_BLE_OBSERVER . I have swap it and we can see that handle with lowest prio is called first.

But i don't understand why the ble_A_on_ble_evt is called when i write into B. Do you have an idea where it could comes from?

 

Thanks a lot !

  • Hi,

    Are you sure you are not getting a write event in handler B, when you write to A? I think that when you add a observer you are essentially subscribing to BLE events from the SD, then it is up to the event handler to choose which events it wants to do something with and to make sure it is using the correct handles.

  • Hm.. you are right, in fact i just didn't print logs in this case , sorry for that.... It seems the issue comes from our mobil app, because with nrf Connect i can write the characteristic without issue. Ans i confirm that writing one characetistque trig all ble handle of characteristic writable. It looks soft davice just send the signal something has been written and fw need to filter by testing the value handle source.

    Thanks a lot run_ar , sorry to disturb you for this...

Related