Beispiel #1
0
static void l2cap_chan_recv(struct bt_l2cap_chan *chan, struct net_buf *buf)
{
#if defined(CONFIG_BLUETOOTH_L2CAP_DYNAMIC_CHANNEL)
	struct bt_l2cap_le_chan *ch;

	switch (chan->conn->type) {
	case BT_CONN_TYPE_LE:
		ch = LE_CHAN(chan);
		break;
	default:
		ch = NULL;
		break;
	}

	if (ch && ch->rx.cid >= L2CAP_LE_DYN_CID_START &&
	    ch->rx.cid <= L2CAP_LE_DYN_CID_END) {
		l2cap_chan_le_recv(ch, buf);
		return;
	}
#endif /* CONFIG_BLUETOOTH_L2CAP_DYNAMIC_CHANNEL */

	BT_DBG("chan %p len %u", chan, buf->len);

	chan->ops->recv(chan, buf);
}
Beispiel #2
0
static void l2cap_chan_recv(struct bt_l2cap_chan *chan, struct net_buf *buf)
{
#if defined(CONFIG_BLUETOOTH_L2CAP_DYNAMIC_CHANNEL)
	struct bt_l2cap_le_chan *ch = BT_L2CAP_LE_CHAN(chan);

	if (L2CAP_LE_CID_IS_DYN(ch->rx.cid)) {
		l2cap_chan_le_recv(ch, buf);
		return;
	}
#endif /* CONFIG_BLUETOOTH_L2CAP_DYNAMIC_CHANNEL */

	BT_DBG("chan %p len %u", chan, buf->len);

	chan->ops->recv(chan, buf);
}