From d090b7b8e539afa9c268a83259e7cfcb5b5b72a0 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Tue, 19 Nov 2013 16:51:52 +0100 Subject: [PATCH] android/hal-bluetooth: Handle dut mode receive event Pass received data to callback if it is present. --- android/hal-bluetooth.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/android/hal-bluetooth.c b/android/hal-bluetooth.c index 18e805b38..b8ffce6f4 100644 --- a/android/hal-bluetooth.c +++ b/android/hal-bluetooth.c @@ -300,9 +300,17 @@ static void handle_acl_state_changed(void *buf, uint16_t len) static void handle_dut_mode_receive(void *buf, uint16_t len) { + struct hal_ev_dut_mode_receive *ev = buf; + DBG(""); - /* TODO */ + if (len != sizeof(*ev) + ev->len) { + error("invalid dut mode receive event (%u), aborting", len); + exit(EXIT_FAILURE); + } + + if (bt_hal_cbacks->dut_mode_recv_cb) + bt_hal_cbacks->dut_mode_recv_cb(ev->opcode, ev->data, ev->len); } /* handlers will be called from notification thread context, -- 2.47.3