/* Function for checking if the CCCD of DFU Control point is configured for Notification. 
This function checks if the CCCD of DFU Control Point characteristic is configured for Notification by the DFU Controller. */
static bool is_cccd_configured(ble_dfu_t *p_dfu)
/* Function for checking if the CCCD of DFU Control point is configured for Notification. 
This function checks if the CCCD of DFU Control Point characteristic is configured for Notification by the DFU Controller. */
static bool is_cccd_configured(ble_dfu_t *p_dfu)
{
    uint8_t  cccd_val_buf[BLE_CCCD_VALUE_LEN];
    ble_gatts_value_t gatts_value;
    memset(&gatts_value, 0, sizeof(gatts_value));
    gatts_value.len     = BLE_CCCD_VALUE_LEN;
    gatts_value.offset  = 0;
    gatts_value.p_value = cccd_val_buf;
    uint32_t err_code = sd_ble_gatts_value_get(p_dfu->conn_handle,
                                               p_dfu->dfu_ctrl_pt_handles.cccd_handle,
                                               &gatts_value);
    if (err_code != NRF_SUCCESS)
    {
        if (p_dfu->error_handler != NULL)
        {
            p_dfu->error_handler(err_code);
        }
        return false;
    }
    return ble_srv_is_notification_enabled(cccd_val_buf);
}