Diff between 9e6322ab7be475364ba1d181ba491e0ced98bcfb and b39f74c2d8ce0046df7a6c62fb7c866ff256b5a4

Changed Files

File Additions Deletions Status
doc/test-coverage.txt +2 -2 modified
tools/hci-tester.c +43 -1 modified

Full Patch

diff --git a/doc/test-coverage.txt b/doc/test-coverage.txt
index c979cad..3507520 100644
--- a/doc/test-coverage.txt
+++ b/doc/test-coverage.txt
@@ -35,9 +35,9 @@ l2cap-tester		  15	Kernel L2CAP implementation testing
 smp-tester		   4	Kernel SMP implementation testing
 sco-tester		   8	Kernel SCO implementation testing
 gap-tester		   1	Daemon D-Bus API testing
-hci-tester		   9	Controller hardware testing
+hci-tester		  10 	Controller hardware testing
 			-----
-			 191
+			 200
 
 
 Android end-to-end testing
diff --git a/tools/hci-tester.c b/tools/hci-tester.c
index b4275b7..8676995 100644
--- a/tools/hci-tester.c
+++ b/tools/hci-tester.c
@@ -97,7 +97,7 @@ static void test_data_free(void *test_data)
 		user->index = 0; \
 		tester_add_full(name, data, \
 				test_pre_setup, setup, func, NULL, \
-				test_post_teardown, 2, user, test_data_free); \
+				test_post_teardown, 30, user, test_data_free); \
 	} while (0)
 
 static void setup_features_complete(const void *data, uint8_t size,
@@ -224,6 +224,46 @@ static void test_read_local_supported_codecs(const void *test_data)
 	test_command(BT_HCI_CMD_READ_LOCAL_CODECS);
 }
 
+static void test_inquiry_complete(const void *data, uint8_t size,
+							void *user_data)
+{
+	tester_test_passed();
+}
+
+static void test_inquiry_status(const void *data, uint8_t size,
+							void *user_data)
+{
+	uint8_t status = *((uint8_t *) data);
+
+	if (status) {
+		tester_warn("HCI inquiry command failed (0x%02x)", status);
+		tester_test_failed();
+		return;
+	}
+}
+
+static void test_inquiry_liac(const void *test_data)
+{
+	struct test_data *data = tester_get_data();
+	struct bt_hci_cmd_inquiry cmd;
+
+	bt_hci_register(data->hci, BT_HCI_EVT_INQUIRY_COMPLETE,
+					test_inquiry_complete, NULL, NULL);
+
+	cmd.lap[0] = 0x00;
+	cmd.lap[1] = 0x8b;
+	cmd.lap[2] = 0x9e;
+	cmd.length = 0x08;
+	cmd.num_resp = 0x00;
+
+	if (!bt_hci_send(data->hci, BT_HCI_CMD_INQUIRY, &cmd, sizeof(cmd),
+					test_inquiry_status, NULL, NULL)) {
+		tester_warn("Failed to send HCI inquiry command");
+		tester_test_failed();
+		return;
+	}
+}
+
 int main(int argc, char *argv[])
 {
 	tester_init(&argc, &argv);
@@ -248,5 +288,7 @@ int main(int argc, char *argv[])
 	test_hci("Read Local Supported Codecs", NULL, NULL,
 				test_read_local_supported_codecs);
 
+	test_hci("Inquiry (LIAC)", NULL, NULL, test_inquiry_liac);
+
 	return tester_run();
 }