0x00, /* filter_policy */
};
+static int set_connectable_off_scan_adv_check_func(const void *param,
+ uint16_t length)
+{
+ const uint8_t *received = param;
+ uint8_t *expected = set_connectable_off_scan_adv_param;
+
+ /* Compare the received param with expected param, but ignore the
+ * min_internal and max_interval since these values are turned often
+ * in the kernel and we don't want to update the expected value every
+ * time.
+ */
+ return memcmp(&received[4], &expected[4], length - 4);
+}
+
static const struct generic_data set_connectable_off_le_test_2 = {
.setup_settings = settings_powered_le_connectable_advertising,
.send_opcode = MGMT_OP_SET_CONNECTABLE,
.expect_hci_command = BT_HCI_CMD_LE_SET_ADV_PARAMETERS,
.expect_hci_param = set_connectable_off_scan_adv_param,
.expect_hci_len = sizeof(set_connectable_off_scan_adv_param),
+ .expect_hci_param_check_func = set_connectable_off_scan_adv_check_func
};
static uint16_t settings_powered_le_discoverable[] = {
.expect_hci_command = BT_HCI_CMD_LE_SET_ADV_PARAMETERS,
.expect_hci_param = set_connectable_off_scan_adv_param,
.expect_hci_len = sizeof(set_connectable_off_scan_adv_param),
+ .expect_hci_param_check_func = set_connectable_off_scan_adv_check_func
};
static const struct generic_data set_connectable_off_le_test_4 = {
.expect_hci_command = BT_HCI_CMD_LE_SET_ADV_PARAMETERS,
.expect_hci_param = set_connectable_off_scan_adv_param,
.expect_hci_len = sizeof(set_connectable_off_scan_adv_param),
+ .expect_hci_param_check_func = set_connectable_off_scan_adv_check_func
};
static const char set_fast_conn_on_param[] = { 0x01 };
.expect_hci_command = BT_HCI_CMD_LE_SET_ADV_PARAMETERS,
.expect_hci_param = set_connectable_off_scan_adv_param,
.expect_hci_len = sizeof(set_connectable_off_scan_adv_param),
+ .expect_hci_param_check_func = set_connectable_off_scan_adv_check_func
};
static uint8_t set_connectable_off_adv_param[] = {
0x00, /* filter_policy */
};
+static int set_connectable_off_adv_check_func(const void *param,
+ uint16_t length)
+{
+ const uint8_t *received = param;
+ uint8_t *expected = set_connectable_off_adv_param;
+
+ /* Compare the received param with expected param, but ignore the
+ * min_internal and max_interval since these values are turned often
+ * in the kernel and we don't want to update the expected value every
+ * time.
+ */
+ return memcmp(&received[4], &expected[4], length - 4);
+}
+
static const struct generic_data add_advertising_success_14 = {
.setup_settings = settings_powered_le,
.send_opcode = MGMT_OP_ADD_ADVERTISING,
.expect_hci_command = BT_HCI_CMD_LE_SET_ADV_PARAMETERS,
.expect_hci_param = set_connectable_off_adv_param,
.expect_hci_len = sizeof(set_connectable_off_adv_param),
+ .expect_hci_param_check_func = set_connectable_off_adv_check_func
};
static const struct generic_data add_advertising_success_15 = {
.expect_hci_command = BT_HCI_CMD_LE_SET_ADV_PARAMETERS,
.expect_hci_param = set_connectable_off_adv_param,
.expect_hci_len = sizeof(set_connectable_off_adv_param),
+ .expect_hci_param_check_func = set_connectable_off_adv_check_func
};
static const char set_powered_off_le_settings_param[] = {