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

Determine characteristic handle that caused BLE_GATTS_EVT_HVN_TX_COMPLETE

Our nRF52832 BLE application needs to be able to send large bulk data to a phone app. We have patterned the transfers after the ble_app_att_mtu_throughput example, with data transfer notifications queued up and then the transfer continued in the BLE_GATTS_EVT_HVN_TX_COMPLETE event handler.

This is working well as it stands, however we would like to add an additional "bytes remaining" notification to be periodically sent to the phone app while the bulk data transfer is in progress. The problem we have run into is that there does not seem to be any method for determining the source (e.g., CCCD handle) that caused the HVN_TX_COMPLETE event.

Our BLE_GATTS_EVT_HVN_TX_COMPLETE handler is primarily keeping the bulk data transfer going, but occasionally must ignore the HVN_TX_COMPLETE events that come from "bytes remaining" notifies that are interspersed. Unfortunately, we haven't been able to identify a means for accomplishing this.

How can an app differentiate among multiple, different characteristics that can generate notifications, given that ble_event_t does not seem to contain such information for a BLE_GATTS_EVT_HVN_TX_COMPLETE event?

Related