From 251eeba2f514b9b1f6a5eee84f64170a2f902ebf Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 29 May 2013 10:13:56 +0300 Subject: [PATCH] shared: Add API to get access to the hciemu bthost instance --- src/shared/hciemu.c | 8 ++++++++ src/shared/hciemu.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/shared/hciemu.c b/src/shared/hciemu.c index e36a8bef9..488108e84 100644 --- a/src/shared/hciemu.c +++ b/src/shared/hciemu.c @@ -242,6 +242,14 @@ static void client_cmd_complete(uint16_t opcode, uint8_t status, } } +struct bthost *hciemu_client_get_host(struct hciemu *hciemu) +{ + if (!hciemu) + return NULL; + + return hciemu->host_stack; +} + void hciemu_l2cap_cmd(struct hciemu *hciemu, uint16_t handle, uint8_t code, uint8_t ident, const void *data, uint16_t len) { diff --git a/src/shared/hciemu.h b/src/shared/hciemu.h index e475ec360..4bc9fb66b 100644 --- a/src/shared/hciemu.h +++ b/src/shared/hciemu.h @@ -37,6 +37,8 @@ struct hciemu *hciemu_new(enum hciemu_type type); struct hciemu *hciemu_ref(struct hciemu *hciemu); void hciemu_unref(struct hciemu *hciemu); +struct bthost *hciemu_client_get_host(struct hciemu *hciemu); + void hciemu_l2cap_cmd(struct hciemu *hciemu, uint16_t handle, uint8_t code, uint8_t ident, const void *data, uint16_t len); -- 2.47.3