diff --git a/doc/test-coverage.txt b/doc/test-coverage.txt
index 9c8b9bc..50e29b5 100644
--- a/doc/test-coverage.txt
+++ b/doc/test-coverage.txt
Application Count Description
-------------------------------------------
-mgmt-tester 298 Kernel management interface testing
+mgmt-tester 299 Kernel management interface testing
l2cap-tester 27 Kernel L2CAP implementation testing
rfcomm-tester 9 Kernel RFCOMM implementation testing
bnep-tester 1 Kernel BNEP implementation testing
hci-tester 14 Controller hardware testing
userchan-tester 3 Kernel HCI User Channel testting
-----
- 369
+ 370
Android end-to-end testing
diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index d019b17..55a5001 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
static const char set_adv_settings_param_1[] = { 0x80, 0x06, 0x00, 0x00 };
static const char set_adv_settings_param_2[] = { 0x81, 0x06, 0x00, 0x00 };
static const char set_adv_on_set_adv_enable_param[] = { 0x01 };
+static const char set_adv_on_set_adv_disable_param[] = { 0x00 };
static const struct generic_data set_adv_on_success_test_1 = {
.setup_settings = settings_le,
.expect_hci_len = sizeof(set_adv_data_uuid),
};
+static const struct generic_data add_advertising_timeout_expired = {
+ .send_opcode = TESTER_NOOP_OPCODE,
+ .expect_alt_ev = MGMT_EV_ADVERTISING_REMOVED,
+ .expect_alt_ev_param = advertising_instance1_param,
+ .expect_alt_ev_len = sizeof(advertising_instance1_param),
+ .expect_hci_command = BT_HCI_CMD_LE_SET_ADV_ENABLE,
+ .expect_hci_param = set_adv_on_set_adv_disable_param,
+ .expect_hci_len = sizeof(set_adv_on_set_adv_disable_param),
+};
+
static const uint8_t remove_advertising_param_1[] = {
0x01,
};
memset(cp, 0, sizeof(*cp));
cp->instance = 1;
- cp->timeout = 5;
+ cp->timeout = 1;
cp->adv_data_len = 6;
cp->data[0] = 0x05; /* AD len */
cp->data[1] = 0x08; /* AD type: shortened local name */
&add_advertising_success_18,
setup_add_advertising,
test_command_generic);
+ /* An instance should be removed when its timeout has been reached.
+ * Advertising will also be disabled if this was the last instance.
+ */
+ test_bredrle_full("Add Advertising - Success 21 (Timeout expires)",
+ &add_advertising_timeout_expired,
+ setup_add_advertising_timeout,
+ test_command_generic, 3);
test_bredrle("Remove Advertising - Invalid Params 1",
&remove_advertising_fail_1,