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

Is it possible to get characteristic handle from ble_db_discovery_evt_t ?

Hello, I'm working on S110 peripherial <-> S120 central project using GATT. I have succesfully implemented S110-based peripherial device with some custom characteristics, and i am able to talk to it (read/write/notify characteristics) from nRF Master Control Android App. Now i'm implementing S120-based multilink central device, and i wonder what would be the simplest way to get peripherial characteristic handles for later use in sd_ble_gattc_write/sd_ble_gattc_read executed from my central. I can succesfully use db_discovery_evt_handler from Multilink Central example to discover and enumerate characteristics on my peripherial, but i'm not sure if i can get proper characteristic handles this way. In ble_db_discovery_evt_t *p_evt passed to db_discovery_evt_handler, there is something like: p_evt->params.discovered_db.characteristics[i].characteristic.handle_value , but when i try to write characteristic on my peripherial using this variable as a characteristc handle in sd_ble_gattc_write, i get BLE_GATT_STATUS_ATTERR_INVALID_HANDLE error from my peripherial, so it's apparently not the right handle. So, is it possible at all to get proper characteristic handles from ble_db_discovery_evt_t *p_evt, or should i abandon db_discovery mechanism, and use sd_ble_gattc_characteristics_discover and friends to get these handles?

Parents Reply Children
No Data
Related