From 86beb4d9f00f70a58d04bace9c9a3ad671062b14 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 27 May 2013 11:47:40 +0300 Subject: [PATCH] emulator: Add basic L2CAP Config Response handling to bthost --- emulator/bthost.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/emulator/bthost.c b/emulator/bthost.c index da03559db..ecb9a5370 100644 --- a/emulator/bthost.c +++ b/emulator/bthost.c @@ -442,6 +442,20 @@ static bool l2cap_config_req(struct bthost *bthost, uint16_t handle, send_l2cap_sig(bthost, handle, BT_L2CAP_PDU_CONFIG_RSP, ident, &rsp, sizeof(rsp)); + send_l2cap_sig(bthost, handle, BT_L2CAP_PDU_CONFIG_REQ, 0, req, + sizeof(*req)); + + return true; +} + +static bool l2cap_config_rsp(struct bthost *bthost, uint16_t handle, + uint8_t ident, const void *data, uint16_t len) +{ + const struct bt_l2cap_pdu_config_rsp *rsp = data; + + if (len < sizeof(*rsp)) + return false; + return true; } @@ -491,6 +505,11 @@ static void l2cap_sig(struct bthost *bthost, uint16_t handle, const void *data, goto reject; break; + case BT_L2CAP_PDU_CONFIG_RSP: + if (!l2cap_config_rsp(bthost, handle, hdr->ident, + data + sizeof(*hdr), hdr_len)) + goto reject; + break; case BT_L2CAP_PDU_INFO_REQ: if (!l2cap_info_req(bthost, handle, hdr->ident, -- 2.47.3