diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index decf472..a0e51cd 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
.expect_status = MGMT_STATUS_INVALID_INDEX,
};
+static const char set_discoverable_on_param[] = { 0x01, 0x00, 0x00 };
+static const char set_discoverable_timeout_param[] = { 0x01, 0x0a, 0x00 };
+static const char set_discoverable_invalid_param[] = { 0x02, 0x00, 0x00 };
+static const char set_discoverable_garbage_param[] = { 0x01, 0x00, 0x00, 0x00 };
+
+static const struct generic_data set_discoverable_on_rejected_test = {
+ .send_opcode = MGMT_OP_SET_DISCOVERABLE,
+ .send_param = set_discoverable_on_param,
+ .send_len = sizeof(set_discoverable_on_param),
+ .expect_status = MGMT_STATUS_REJECTED,
+};
+
+static const struct generic_data set_discoverable_on_not_powered_test = {
+ .send_opcode = MGMT_OP_SET_DISCOVERABLE,
+ .send_param = set_discoverable_timeout_param,
+ .send_len = sizeof(set_discoverable_timeout_param),
+ .expect_status = MGMT_STATUS_NOT_POWERED,
+};
+
+static const struct generic_data set_discoverable_on_invalid_param_test_1 = {
+ .send_opcode = MGMT_OP_SET_DISCOVERABLE,
+ .expect_status = MGMT_STATUS_INVALID_PARAMS,
+};
+
+static const struct generic_data set_discoverable_on_invalid_param_test_2 = {
+ .send_opcode = MGMT_OP_SET_DISCOVERABLE,
+ .send_param = set_discoverable_invalid_param,
+ .send_len = sizeof(set_discoverable_invalid_param),
+ .expect_status = MGMT_STATUS_INVALID_PARAMS,
+};
+
+static const struct generic_data set_discoverable_on_invalid_param_test_3 = {
+ .send_opcode = MGMT_OP_SET_DISCOVERABLE,
+ .send_param = set_discoverable_garbage_param,
+ .send_len = sizeof(set_discoverable_garbage_param),
+ .expect_status = MGMT_STATUS_INVALID_PARAMS,
+};
+
static void command_generic_new_settings(uint16_t index, uint16_t length,
const void *param, void *user_data)
{
&set_pairable_on_invalid_index_test,
NULL, test_command_generic);
+ test_bredr("Set discoverable on - Rejected",
+ &set_discoverable_on_rejected_test,
+ NULL, test_command_generic);
+ test_bredr("Set discoverable on - Not powered",
+ &set_discoverable_on_not_powered_test,
+ NULL, test_command_generic);
+ test_bredr("Set discoverable on - Invalid parameters 1",
+ &set_discoverable_on_invalid_param_test_1,
+ NULL, test_command_generic);
+ test_bredr("Set discoverable on - Invalid parameters 2",
+ &set_discoverable_on_invalid_param_test_2,
+ NULL, test_command_generic);
+ test_bredr("Set discoverable on - Invalid parameters 3",
+ &set_discoverable_on_invalid_param_test_3,
+ NULL, test_command_generic);
+
return tester_run();
}