Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set extended default advertising to be 1285ms #32277

Merged
merged 2 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/app/tests/suites/certification/Test_TC_DD_2_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ tests:
Try NRF Connect app (https://www.nordicsemi.com/Products/Development-tools/nrf-connect-for-desktop)
OR
HCIDump (https://ubuntu.com/core/docs/bluez/reference/commands)
->For T0 and 30s we have to get advertisement range between 20ms to 60ms
->For 30s and 15mins we have to get advertisement range between 150ms to 1200ms
->Between [0 .. 30s[ expect advertisement range between 20ms to 60ms.
robszewczyk marked this conversation as resolved.
Show resolved Hide resolved
->Between [30s .. 900s[ expect advertisement range between 150ms to 1285ms. Allow +/- 10ms margin on the measured value.
->Starting at 900s expect advertisement range larger or equal to 1200ms.
disabled: true

- label: "Step 6: TH does not respond to DUT. User power cycles the DUT"
Expand Down
18 changes: 8 additions & 10 deletions src/include/platform/CHIPDeviceConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -647,28 +647,26 @@
* CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN
*
* The minimum interval (in units of 0.625ms) at which the device will send BLE advertisements while
* in the extended advertising mode. The minimum interval shall not be smaller than the default value
* and should not be equal to the CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX.
* in the extended advertising mode. The minimum interval shall not be smaller than the default value.
*
* Defaults to 1920 (1200 ms).
* Defaults to 2056 (1285 ms).
*/
#define CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN 1920
#define CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN 2056
robszewczyk marked this conversation as resolved.
Show resolved Hide resolved

/**
* CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX
*
* The maximum interval (in units of 0.625ms) at which the device will send BLE advertisements while
* in the extended advertising mode. The maximum interval should be greater and not equal to the
* CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN.
* in the extended advertising mode. The maximum interval should be greater.
*
* Defaults to 1936 (1210 ms).
* Defaults to 2056 (1285 ms).
*/
#ifndef CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX
#define CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX 1936
#define CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX 2056
#endif

static_assert(CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN < CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX,
"Max Extended Advertising Interval cannot be smaller or equal to the Min Extended Advertising Interval");
static_assert(CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN <= CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX,
"Max Extended Advertising Interval cannot be larger to the Min Extended Advertising Interval");

#endif

Expand Down
7 changes: 7 additions & 0 deletions src/platform/silabs/efr32/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,13 @@ CHIP_ERROR BLEManagerImpl::StartAdvertising(void)
#endif
}

// TODO(#32274): Explain why we cannot have interval_min == interval_max.
if (interval_min == interval_max)
{
++interval_max;
}
ChipLogProgress(DeviceLayer, "Starting advertising with interval_min=%u, intverval_max=%u (units of 625us)",
static_cast<unsigned>(interval_min), static_cast<unsigned>(interval_max));
ret = sl_bt_advertiser_set_timing(advertising_set_handle, interval_min, interval_max, 0, 0);
err = MapBLEError(ret);
SuccessOrExit(err);
Expand Down
Loading