/* Function for handling read response events. 
This function will validate the read response and raise the appropriate event to the application. */
static void on_read_rsp(ble_bas_c_t *p_bas_c, const ble_evt_t *p_ble_evt)
/* Function for handling read response events. 
This function will validate the read response and raise the appropriate event to the application. */
static void on_read_rsp(ble_bas_c_t *p_bas_c, const ble_evt_t *p_ble_evt)
{
    const ble_gattc_evt_read_rsp_t * p_response;
    if (p_bas_c->conn_handle != p_ble_evt->evt.gattc_evt.conn_handle)
    {
        return;
    }
    p_response = &p_ble_evt->evt.gattc_evt.params.read_rsp;
    if (p_response->handle == p_bas_c->peer_bas_db.bl_handle)
    {
        ble_bas_c_evt_t evt;
        evt.conn_handle = p_ble_evt->evt.gattc_evt.conn_handle;
        evt.evt_type = BLE_BAS_C_EVT_BATT_READ_RESP;
        evt.params.battery_level = p_response->data[0];
        p_bas_c->evt_handler(p_bas_c, &evt);
    }
    tx_buffer_process();
}