Diff between ac2161c7a99f0176d2e37be64a1dec164cc8ba7a and d705186967566a6b49282be810c2f9ea7ea850d3

Changed Files

File Additions Deletions Status
emulator/bthost.c +26 -0 modified

Full Patch

diff --git a/emulator/bthost.c b/emulator/bthost.c
index fea02cb..da03559 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
@@ -426,6 +426,25 @@ static bool l2cap_conn_req(struct bthost *bthost, uint16_t handle,
 	return true;
 }
 
+static bool l2cap_config_req(struct bthost *bthost, uint16_t handle,
+				uint8_t ident, const void *data, uint16_t len)
+{
+	const struct bt_l2cap_pdu_config_req *req = data;
+	struct bt_l2cap_pdu_config_rsp rsp;
+
+	if (len < sizeof(*req))
+		return false;
+
+	memset(&rsp, 0, sizeof(rsp));
+	rsp.dcid  = req->dcid;
+	rsp.flags = req->flags;
+
+	send_l2cap_sig(bthost, handle, BT_L2CAP_PDU_CONFIG_RSP, ident, &rsp,
+								sizeof(rsp));
+
+	return true;
+}
+
 static bool l2cap_info_req(struct bthost *bthost, uint16_t handle,
 				uint8_t ident, const void *data, uint16_t len)
 {
@@ -466,6 +485,13 @@ static void l2cap_sig(struct bthost *bthost, uint16_t handle, const void *data,
 			goto reject;
 		break;
 
+	case BT_L2CAP_PDU_CONFIG_REQ:
+		if (!l2cap_config_req(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,
 						data + sizeof(*hdr), hdr_len))