diff --git a/emulator/bthost.c b/emulator/bthost.c
index d893c7e..45e490b 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
free(pkt_data);
}
-static void send_l2cap_sig(struct bthost *bthost, uint16_t handle, uint8_t code,
+void bthost_l2cap_cmd(struct bthost *bthost, uint16_t handle, uint8_t code,
uint8_t ident, const void *data, uint16_t len)
{
static uint8_t next_ident = 1;
else
rsp.result = cpu_to_le16(0x0002); /* PSM Not Supported */
- send_l2cap_sig(bthost, handle, BT_L2CAP_PDU_CONN_RSP, ident, &rsp,
+ bthost_l2cap_cmd(bthost, handle, BT_L2CAP_PDU_CONN_RSP, ident, &rsp,
sizeof(rsp));
return true;
rsp.scid = req->dcid;
rsp.flags = req->flags;
- send_l2cap_sig(bthost, handle, BT_L2CAP_PDU_CONFIG_RSP, ident, &rsp,
+ bthost_l2cap_cmd(bthost, handle, BT_L2CAP_PDU_CONFIG_RSP, ident, &rsp,
sizeof(rsp));
- send_l2cap_sig(bthost, handle, BT_L2CAP_PDU_CONFIG_REQ, 0, req,
+ bthost_l2cap_cmd(bthost, handle, BT_L2CAP_PDU_CONFIG_REQ, 0, req,
sizeof(*req));
return true;
rsp.dcid = req->dcid;
rsp.scid = req->scid;
- send_l2cap_sig(bthost, handle, BT_L2CAP_PDU_DISCONN_RSP, ident, &rsp,
+ bthost_l2cap_cmd(bthost, handle, BT_L2CAP_PDU_DISCONN_RSP, ident, &rsp,
sizeof(rsp));
return true;
rsp.type = req->type;
rsp.result = cpu_to_le16(0x0001); /* Not Supported */
- send_l2cap_sig(bthost, handle, BT_L2CAP_PDU_INFO_RSP, ident, &rsp,
+ bthost_l2cap_cmd(bthost, handle, BT_L2CAP_PDU_INFO_RSP, ident, &rsp,
sizeof(rsp));
return true;
reject:
memset(&rej, 0, sizeof(rej));
- send_l2cap_sig(bthost, handle, BT_L2CAP_PDU_CMD_REJECT, 0,
+ bthost_l2cap_cmd(bthost, handle, BT_L2CAP_PDU_CMD_REJECT, 0,
&rej, sizeof(rej));
}
diff --git a/emulator/bthost.h b/emulator/bthost.h
index c11f326..a907e2f 100644
--- a/emulator/bthost.h
+++ b/emulator/bthost.h
void bthost_set_connect_cb(struct bthost *bthost, bthost_new_conn_cb cb,
void *user_data);
+void bthost_l2cap_cmd(struct bthost *bthost, uint16_t handle, uint8_t code,
+ uint8_t ident, const void *data, uint16_t len);
+
void bthost_write_scan_enable(struct bthost *bthost, uint8_t scan);
void bthost_set_server_psm(struct bthost *bthost, uint16_t psm);