/* Given a handle, find an active connection matching the handle */
struct ble_ll_conn_sm* ble_ll_conn_find_active_conn(uint16_t handle)
/* Given a handle, find an active connection matching the handle */
struct ble_ll_conn_sm* ble_ll_conn_find_active_conn(uint16_t handle)
{
    struct ble_ll_conn_sm *connsm;
    connsm = NULL;
    if ((handle != 0) && (handle <= MYNEWT_VAL(BLE_MAX_CONNECTIONS))) {
        connsm = &g_ble_ll_conn_sm[handle - 1];
        if (connsm->conn_state == BLE_LL_CONN_STATE_IDLE) {
            connsm = NULL;
        }
    }
    return connsm;
}