Skip to content

Commit 6af0d14

Browse files
Set extended default advertising to be 1285ms (#32277)
* Set extended default advertising to be 1285ms - 1285ms is more reliable than 1200ms in general (CHIP-Specifications/connectedhomeip-spec#8965) - Update TC-DD-2.1 script to match (CHIP-Specifications/chip-test-plans#4020) - Update EFR32 platform to be tolerant of min==max for advertising rate Issue #32274 Fixes #32275 Testing done: - Linux builds, still discoverable, extended rate 1285ms - Tested with nRFConnect - EFR32 builds, still discoverable, extended rate 1285ms +/- 2ms - Tested with nRFConnect and xG24 Explorer kit * Restyled by clang-format --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 1cac173 commit 6af0d14

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

src/app/tests/suites/certification/Test_TC_DD_2_1.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,9 @@ tests:
123123
Try NRF Connect app (https://www.nordicsemi.com/Products/Development-tools/nrf-connect-for-desktop)
124124
OR
125125
HCIDump (https://ubuntu.com/core/docs/bluez/reference/commands)
126-
->For T0 and 30s we have to get advertisement range between 20ms to 60ms
127-
->For 30s and 15mins we have to get advertisement range between 150ms to 1200ms
126+
->Between [0 .. 30s[ expect advertisement range between 20ms to 60ms.
127+
->Between [30s .. 900s[ expect advertisement range between 150ms to 1285ms. Allow +/- 10ms margin on the measured value.
128+
->Starting at 900s expect advertisement range larger or equal to 1200ms.
128129
disabled: true
129130

130131
- label: "Step 6: TH does not respond to DUT. User power cycles the DUT"

src/include/platform/CHIPDeviceConfig.h

+8-10
Original file line numberDiff line numberDiff line change
@@ -647,28 +647,26 @@
647647
* CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN
648648
*
649649
* The minimum interval (in units of 0.625ms) at which the device will send BLE advertisements while
650-
* in the extended advertising mode. The minimum interval shall not be smaller than the default value
651-
* and should not be equal to the CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX.
650+
* in the extended advertising mode. The minimum interval shall not be smaller than the default value.
652651
*
653-
* Defaults to 1920 (1200 ms).
652+
* Defaults to 2056 (1285 ms).
654653
*/
655-
#define CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN 1920
654+
#define CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN 2056
656655

657656
/**
658657
* CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX
659658
*
660659
* The maximum interval (in units of 0.625ms) at which the device will send BLE advertisements while
661-
* in the extended advertising mode. The maximum interval should be greater and not equal to the
662-
* CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN.
660+
* in the extended advertising mode. The maximum interval should be greater.
663661
*
664-
* Defaults to 1936 (1210 ms).
662+
* Defaults to 2056 (1285 ms).
665663
*/
666664
#ifndef CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX
667-
#define CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX 1936
665+
#define CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX 2056
668666
#endif
669667

670-
static_assert(CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN < CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX,
671-
"Max Extended Advertising Interval cannot be smaller or equal to the Min Extended Advertising Interval");
668+
static_assert(CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN <= CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX,
669+
"Max Extended Advertising Interval cannot be larger to the Min Extended Advertising Interval");
672670

673671
#endif
674672

src/platform/silabs/efr32/BLEManagerImpl.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,13 @@ CHIP_ERROR BLEManagerImpl::StartAdvertising(void)
582582
#endif
583583
}
584584

585+
// TODO(#32274): Explain why we cannot have interval_min == interval_max.
586+
if (interval_min == interval_max)
587+
{
588+
++interval_max;
589+
}
590+
ChipLogProgress(DeviceLayer, "Starting advertising with interval_min=%u, intverval_max=%u (units of 625us)",
591+
static_cast<unsigned>(interval_min), static_cast<unsigned>(interval_max));
585592
ret = sl_bt_advertiser_set_timing(advertising_set_handle, interval_min, interval_max, 0, 0);
586593
err = MapBLEError(ret);
587594
SuccessOrExit(err);

0 commit comments

Comments
 (0)