[PATCH 08/10] android/hal-bluetooth: Handle dut mode receive event

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 18e805b..b8ffce6 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,
-- 
1.8.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux