diff --git a/emulator/bthost.c b/emulator/bthost.c
index 221ab8e..5e3592b 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
free(pkt_data);
}
-void bthost_l2cap_cmd(struct bthost *bthost, uint16_t handle, uint8_t code,
+uint8_t 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;
pkt_data = malloc(pkt_len);
if (!pkt_data)
- return;
+ return 0;
if (!ident) {
ident = next_ident++;
send_acl(bthost, handle, 0x0001, pkt_data, pkt_len);
free(pkt_data);
+
+ return ident;
}
static void send_command(struct bthost *bthost, uint16_t opcode,
diff --git a/emulator/bthost.h b/emulator/bthost.h
index 5a75d9e..777dfb4 100644
--- a/emulator/bthost.h
+++ b/emulator/bthost.h
void bthost_hci_connect(struct bthost *bthost, const uint8_t *bdaddr);
-void bthost_l2cap_cmd(struct bthost *bthost, uint16_t handle, uint8_t code,
+uint8_t 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);