From e753547a7b104db0c96ca95cbd835e91e8199dac Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 17 Jan 2013 11:40:44 +0200 Subject: [PATCH] tools: Add basic add_uuid UUID-32 test case for mgmt-tester --- tools/mgmt-tester.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c index fa3de3589..bcaad03f5 100644 --- a/tools/mgmt-tester.c +++ b/tools/mgmt-tester.c @@ -826,6 +826,41 @@ static const char write_eir_uuid16_hci[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static const char add_uuid32_param[] = { + 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80, + 0x00, 0x10, 0x00, 0x00, 0x78, 0x56, 0x34, 0x12, + 0x00 }; +static const char write_eir_uuid32_hci[] = { 0x00, + 0x05, 0x05, 0x78, 0x56, 0x34, 0x12, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static const struct generic_data add_uuid16_param_test_1 = { .send_opcode = MGMT_OP_ADD_UUID, @@ -839,6 +874,18 @@ static const struct generic_data add_uuid16_param_test_1 = { .expect_hci_len = sizeof(write_eir_uuid16_hci), }; +static const struct generic_data add_uuid32_param_test_1 = { + .send_opcode = MGMT_OP_ADD_UUID, + .send_param = add_uuid32_param, + .send_len = sizeof(add_uuid32_param), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = set_dev_class_zero_rsp, + .expect_len = sizeof(set_dev_class_zero_rsp), + .expect_hci_command = BT_HCI_CMD_WRITE_EXT_INQUIRY_RESPONSE, + .expect_hci_param = write_eir_uuid32_hci, + .expect_hci_len = sizeof(write_eir_uuid32_hci), +}; + static void setup_powered_callback(uint8_t status, uint16_t length, const void *param, void *user_data) { @@ -1313,6 +1360,8 @@ int main(int argc, char *argv[]) test_bredr("Add UUID - UUID-16 1", &add_uuid16_param_test_1, setup_ssp, test_command_generic); + test_bredr_timeout("Add UUID - UUID-32 1", &add_uuid32_param_test_1, + setup_ssp, test_command_generic, 1); return tester_run(); } -- 2.11.0