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

We can't get the correct handle value when we receive a long characteristics more than 20 bytes

at nRF51 SDK v9.0.0, S130, PCA10040, at peripheral side

If we receive a characteristics less than 20 bytes, we can get the correct handle value(like 0x3B). And then everything is fine.

But when we receive a long characteristics more than 20 bytes, we can't get the correct handle value. I print the p_ble_evt->evt.gatts_evt.params.write.handle at ble_evt_dispatch(ble_evt_t * p_ble_evt), the handle value be set to 0.

I sniffer the send packet like below: image description

I have try to receive a 140 bytes characteristics , I can get the correct data by sd_ble_gatts_value_get() when the ble_evt_dispatch() trigger a handle value "0". I think the handle value should be "0x3B" at this event trigger, but it's not.

So the problem is why the p_ble_evt->evt.gatts_evt.params.write.handle be set to "0", when we receive a long characteristics more than 20 bytes.

Please help how to fix this issue. Thanks

Related