From 0979b8d65ed6cdd09072ab26e855ba664ffe9efb Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 10 Mar 2015 22:15:32 +0200 Subject: [PATCH] tools/mgmt-tester: Add new Fast Connectable tests --- tools/mgmt-tester.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c index e5fb88942..e2549d4bc 100644 --- a/tools/mgmt-tester.c +++ b/tools/mgmt-tester.c @@ -835,6 +835,8 @@ static const struct generic_data set_connectable_off_le_test_4 = { static const char set_fast_conn_on_param[] = { 0x01 }; static const char set_fast_conn_on_settings_1[] = { 0x87, 0x00, 0x00, 0x00 }; +static const char set_fast_conn_on_settings_2[] = { 0x85, 0x00, 0x00, 0x00 }; +static const char set_fast_conn_on_settings_3[] = { 0x84, 0x00, 0x00, 0x00 }; static const struct generic_data set_fast_conn_on_success_test_1 = { .setup_settings = settings_powered_connectable, @@ -847,6 +849,27 @@ static const struct generic_data set_fast_conn_on_success_test_1 = { .expect_settings_set = MGMT_SETTING_FAST_CONNECTABLE, }; +static const struct generic_data set_fast_conn_on_success_test_2 = { + .setup_settings = settings_powered, + .send_opcode = MGMT_OP_SET_FAST_CONNECTABLE, + .send_param = set_fast_conn_on_param, + .send_len = sizeof(set_fast_conn_on_param), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = set_fast_conn_on_settings_2, + .expect_len = sizeof(set_fast_conn_on_settings_2), + .expect_settings_set = MGMT_SETTING_FAST_CONNECTABLE, +}; + +static const struct generic_data set_fast_conn_on_success_test_3 = { + .send_opcode = MGMT_OP_SET_FAST_CONNECTABLE, + .send_param = set_fast_conn_on_param, + .send_len = sizeof(set_fast_conn_on_param), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = set_fast_conn_on_settings_3, + .expect_len = sizeof(set_fast_conn_on_settings_3), + .expect_settings_set = MGMT_SETTING_FAST_CONNECTABLE, +}; + static const struct generic_data set_fast_conn_on_not_supported_test_1 = { .setup_settings = settings_powered_connectable, .send_opcode = MGMT_OP_SET_FAST_CONNECTABLE, @@ -855,6 +878,15 @@ static const struct generic_data set_fast_conn_on_not_supported_test_1 = { .expect_status = MGMT_STATUS_NOT_SUPPORTED, }; +static const char set_fast_conn_nval_param[] = { 0xff }; + +static const struct generic_data set_fast_conn_nval_param_test_1 = { + .send_opcode = MGMT_OP_SET_FAST_CONNECTABLE, + .send_param = set_fast_conn_nval_param, + .send_len = sizeof(set_fast_conn_nval_param), + .expect_status = MGMT_STATUS_INVALID_PARAMS, +}; + static const char set_bondable_on_param[] = { 0x01 }; static const char set_bondable_invalid_param[] = { 0x02 }; static const char set_bondable_garbage_param[] = { 0x01, 0x00 }; @@ -4770,6 +4802,15 @@ int main(int argc, char *argv[]) test_bredrle("Set fast connectable on - Success 1", &set_fast_conn_on_success_test_1, NULL, test_command_generic); + test_bredrle("Set fast connectable on - Success 2", + &set_fast_conn_on_success_test_2, + NULL, test_command_generic); + test_bredrle("Set fast connectable on - Success 3", + &set_fast_conn_on_success_test_3, + NULL, test_command_generic); + test_bredrle("Set fast connectable on - Invalid Params 1", + &set_fast_conn_nval_param_test_1, + NULL, test_command_generic); test_le("Set fast connectable on - Not Supported 1", &set_fast_conn_on_not_supported_test_1, NULL, test_command_generic); -- 2.47.3