Skip to content

[DataModel] Initial proximity ranging cluster definition#43525

Open
s-mcclain wants to merge 2 commits intoproject-chip:masterfrom
s-mcclain:initial-proximity-ranging-cluster-definition
Open

[DataModel] Initial proximity ranging cluster definition#43525
s-mcclain wants to merge 2 commits intoproject-chip:masterfrom
s-mcclain:initial-proximity-ranging-cluster-definition

Conversation

@s-mcclain
Copy link
Contributor

Summary

Adds the Proximity Ranging cluster XML with Alchemy and regen ZAP files to include Proximity Ranging cluster.

Related issues

Relates to specification definition PR: https://github.com/CHIP-Specifications/connectedhomeip-spec/pull/12685

Testing

Manually tested building chip-tool on Linux and Darwin platforms. Verified 'proximityranging' is available and
includes all fields for the commands.

Usage:
  ./out/darwin-arm64-chip-tool/chip-tool proximityranging command_name [param1 param2 ...]

  +-------------------------------------------------------------------------------------+
  | Commands:                                                                           |
  +-------------------------------------------------------------------------------------+
  | * command-by-id                                                                     |
  | * start-ranging-request                                                             |
  | * stop-ranging-request                                                              |
  | * read-by-id                                                                        |
  |   - Read attributes from this cluster; allows wildcard endpoint and attribute.      |
  | * read                                                                              |
  | * write-by-id                                                                       |
  | * force-write                                                                       |
  | * subscribe-by-id                                                                   |
  |   - Subscribe to attributes from this cluster; allows wildcard endpoint and attri...|
  | * subscribe                                                                         |
  | * read-event-by-id                                                                  |
  |   - Read events from this cluster; allows wildcard endpoint and event.              |
  | * subscribe-event-by-id                                                             |
  |   - Subscribe to events from this cluster; allows wildcard endpoint and event.      |

Readability checklist

The checklist below will help the reviewer finish PR review in time and keep the
code readable:

  • PR title is
    descriptive
  • Apply the
    “When in Rome…”
    rule (coding style)
  • PR size is short
  • Try to avoid "squashing" and "force-update" in commit history
  • CI time didn't increase

See: Pull Request Guidelines

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the Proximity Ranging cluster, including its XML definition and all the corresponding generated code for various platforms and languages. The changes look good overall.

@s-mcclain s-mcclain marked this pull request as draft March 9, 2026 15:06
@s-mcclain s-mcclain force-pushed the initial-proximity-ranging-cluster-definition branch from d6a666d to 68e4369 Compare March 9, 2026 15:32
@s-mcclain s-mcclain marked this pull request as ready for review March 9, 2026 15:33
@mergify mergify bot removed the conflict label Mar 9, 2026
@github-actions
Copy link

github-actions bot commented Mar 9, 2026

PR #43525: Size comparison from a94849f to 68e4369

Full report (34 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section a94849f 68e4369 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1089430 1089430 0 0.0
RAM 144762 144762 0 0.0
bl616 lighting-app bl616+thread FLASH 1100108 1100108 0 0.0
RAM 104184 104184 0 0.0
bl616+wifi+shell FLASH 1586972 1586972 0 0.0
RAM 98080 98080 0 0.0
bl702 lighting-app bl702+eth FLASH 1052790 1052792 2 0.0
RAM 108357 108357 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 890814 890816 2 0.0
RAM 105748 105748 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 779236 779252 16 0.0
RAM 103324 103324 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 786576 786592 16 0.0
RAM 108508 108508 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 732812 732828 16 0.0
RAM 97316 97316 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 716248 716264 16 0.0
RAM 97476 97476 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 558130 558130 0 0.0
RAM 204504 204504 0 0.0
lock CC3235SF_LAUNCHXL FLASH 591262 591262 0 0.0
RAM 204744 204744 0 0.0
efr32 lock-app BRD4187C FLASH 971260 971292 32 0.0
RAM 125796 125796 0 0.0
BRD4338a FLASH 769684 769676 -8 -0.0
RAM 236552 236552 0 0.0
window-app BRD4187C FLASH 1074944 1074944 0 0.0
RAM 126440 126440 0 0.0
esp32 all-clusters-app c3devkit DRAM 98356 98356 0 0.0
FLASH 1596670 1596670 0 0.0
IRAM 93514 93514 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 857656 857656 0 0.0
RAM 161999 161999 0 0.0
nxp contact mcxw71+release FLASH 735904 735920 16 0.0
RAM 66936 66936 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1708852 1708852 0 0.0
RAM 213940 213940 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1607524 1607524 0 0.0
RAM 210812 210812 0 0.0
light cy8ckit_062s2_43012 FLASH 1470668 1470668 0 0.0
RAM 196988 196988 0 0.0
lock cy8ckit_062s2_43012 FLASH 1497364 1497364 0 0.0
RAM 224732 224732 0 0.0
qpg lighting-app qpg6200+debug FLASH 840748 840764 16 0.0
RAM 127780 127780 0 0.0
lock-app qpg6200+debug FLASH 779408 779424 16 0.0
RAM 118728 118728 0 0.0
realtek light-switch-app rtl8777g FLASH 720776 720776 0 0.0
RAM 113448 113448 0 0.0
lighting-app rtl8777g FLASH 767984 767984 0 0.0
RAM 114688 114688 0 0.0
stm32 light STM32WB5MM-DK FLASH 478904 478920 16 0.0
RAM 141324 141324 0 0.0
telink bridge-app tl7218x FLASH 728880 728882 2 0.0
RAM 95768 95768 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 853046 853050 4 0.0
RAM 44184 44184 0 0.0
tl7218x FLASH 844446 844450 4 0.0
RAM 99572 99572 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 725726 725730 4 0.0
RAM 55740 55740 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 788290 788294 4 0.0
RAM 74924 74924 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 725726 725730 4 0.0
RAM 33228 33228 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 615502 615502 0 0.0
RAM 118232 118232 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 843242 843250 8 0.0
RAM 97280 97280 0 0.0

@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.05%. Comparing base (a94849f) to head (68e4369).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #43525   +/-   ##
=======================================
  Coverage   54.05%   54.05%           
=======================================
  Files        1549     1549           
  Lines      106697   106697           
  Branches    13318    13318           
=======================================
  Hits        57675    57675           
  Misses      49022    49022           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

kWiFiUSDProximityDetection = 0x1 [spec_name = "Wi-Fi USD Proximity Detection"];
kBluetoothChannelSounding = 0x2;
kBLEBeaconRSSI = 0x4 [spec_name = "BLE Beacon RSSI"];
kUWBRanging = 0x8 [spec_name = "UWB Ranging"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int8u sessionID = 0;
}

response struct RangingResult = 3 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this vetted that this is implementable/works in the SDK? I wonder if there are any precedents of responses that are not sent as part of a request.

Otherwise was it considered to use something else like events for this kind of processing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a grep in the spec for all server to client responses and all seem to be a response to some form of request. So you may have extra hard time implementing this (it is not prevented by spec, however listening for unprompted command packets may not be exercised/tested currently).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I do remember at some point looking into that and finding out that it is much harder to support, although I can't remember exactly what would need to be done to support this. The team had indicated that they do not want to utilize Attributes/Events for triggering this reporting to ensure that the report only is sent to the Configurator.. Wonder if the effort for supporting this is worth it or not

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to try to look for alternatives if possible. I believe this will both be hard to implement in the SDK and will add extra work to all client APIs needing to support something new. Not impossible, but a solid slowdown.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As specific feedback, I also asked around on our integration side and was told that this will at worst not be supported and at best it would take a lot of effort (i.e. support of this design in controllers would be delayed). What is happening is that this would imply some sort of a "session" to know who should receive the ranging data, however from our implementation the controllers keep active sessions on behalf of clients/applications and adding extra session-like information that is cluster specific would be rough.

So: hard to make work in the SDK, hard to get support in ecosystem integrations (at least in one example, would not be surprised if this is the case in others as well)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks really appreciate the feedback.
We are discussing this within the proximity ranging team and think we've reached decision to move away from using this async command from server=>client into using an Event instead.

Wonder if this should have some kind of statement in the cluster writing documentation for future groups.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to figuring out a way to document that going this path is likely not recommended. That may need a broader spec discussion as well (maybe this should be in spec text too somehow).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants