Skip to content

Conversation

ivmarkov
Copy link
Contributor

@ivmarkov ivmarkov commented Oct 19, 2025

This PR contains the following commits:

1st commit

Simply enables the 7 tests below. Did not require any changes to rs-matter

  • Test_AddNewFabricFromExistingFabric
  • TestConfigVariables
  • TestDelayCommands
  • TestEqualities
  • TestFabricRemovalWhileSubscribed
  • TestSubscribe_AdministratorCommissioning
  • TestSubscribe_OnOff

2nd commit

Enables the TestDiscovery test.
For this test, it was necessary to implement all optional mDNS payload:

  • Device name
  • Device type
  • Device pairing hints (used to be hard-coded to "33")
  • Device pairing information (used to be hard-coded to the empty string)

While I could've just disabled the tests for the optional payload in the chip_tests.pics file, I thought it would be good to support this payload in general, for end users. The payload is now configurable through the BasicInfo structure.

3rd commit

This is a follow-up to the 2nd commit, which was not strictly necessary but I did it anyway. It documents as well as does a cleanup on the pairing module, which is all about computing the commissioning QR code.

Some of the problems addressed with this commit:

  • There were too many public freestanding functions that used to take a lot of parameters (i.e. they were difficult to use). They are now all moved into their appropriate structures (Qr or QrPayload)
  • QrTextPayload renamed to just QrPayload. The purpose in life of QrPayload is to compute the QR text
  • A new type, Qr which is the final outcome of the QR computation; it takes (a) text and encodes it into a QR; all utility functions to consume the QR code as ASCII-art are now moved into this type and this type is independent from QrPayload in that while it is expected that it will be used to render precisely the text produced by QrPayload, that might not be necessarily the case

4th commit

This commit introduces a real expiration of the Commissioning Window. Previously, the timeout parameter was not really used and therefore, the commissioning window stayed open until explicitly closed, or in case commissioning did fail - forever.

Furthermore, I've tried to document and tighten up a bit the code in the case and pake modules.
While I doubt this would be the latest cleanup in these modules (the contain one of the oldest piece of code in the codebase), it is now in a slightly better shape, in that a lot of freestanding functions are moved to their appropriate structures, and some structures like Spake2p and CaseSession are more private in that the SC layer doesn't need to know about those. It only needs to know about Pake and Case which handle the establishment of a PASE or CASE session, and Spake2p and CaseSession are actually their internal implementation detail.

But the most important renaming change is that what used to be called "PASE session" is now called "Commissioning Window" everywhere, because really that's what it is.

The notion of a PASE session is anyway overloaded with two additional meanings so also calling the Commissioning Window a "PASE session" was wrong IMO:

  • A PASE session might mean a Session which was created as a result of a PASE/PAKE session negotiation/establishment. (Ditto - a CASE session might mean a Session which was created as a result of a CASE session negotiation/establishment.)
  • A PASE session might also mean the process of establishment of a Session using the PAKE negotiation process. Though I've taken care to always talk there about a PASE session establishment, as in the Matter Core Spec

Copy link

PR #334: Size comparison from d8463db to c2cbbf8

Increases above 0.2%:

platform target config section d8463db c2cbbf8 change % change
dimmable-light infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 1942176 1963256 21080 1.1
onoff-light infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 1852688 1873816 21128 1.1
onoff-light-bt infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 3207768 3229720 21952 0.7
rs-matter-core infodefmt-optz-ltofat riscv32imac-unknown-none-elf FLASH 390438 392614 2176 0.6
thumbv6m-none-eabi FLASH 325992 333492 7500 2.3
thumbv7em-none-eabi FLASH 301396 306748 5352 1.8
infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 840647 862103 21456 2.6
speaker infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 1912880 1934256 21376 1.1
Full report (8 builds for dimmable-light, onoff-light, onoff-light-bt, rs-matter-core, speaker)
platform target config section d8463db c2cbbf8 change % change
dimmable-light infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 1942176 1963256 21080 1.1
RAM 42720 42720 0 0.0
onoff-light infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 1852688 1873816 21128 1.1
RAM 42704 42704 0 0.0
onoff-light-bt infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 3207768 3229720 21952 0.7
RAM 9308 9308 0 0.0
rs-matter-core infodefmt-optz-ltofat riscv32imac-unknown-none-elf FLASH 390438 392614 2176 0.6
RAM 68952 68960 8 0.0
thumbv6m-none-eabi FLASH 325992 333492 7500 2.3
RAM 65348 65348 0 0.0
thumbv7em-none-eabi FLASH 301396 306748 5352 1.8
RAM 64836 64840 4 0.0
infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 840647 862103 21456 2.6
RAM 73634 73634 0 0.0
speaker infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 1912880 1934256 21376 1.1
RAM 5480 5480 0 0.0

@ivmarkov ivmarkov requested a review from bjoernQ October 20, 2025 13:21
@ivmarkov ivmarkov marked this pull request as ready for review October 20, 2025 13:21
Copy link

PR #334: Size comparison from e14f27a to 383637b

Increases above 0.2%:

platform target config section e14f27a 383637b change % change
dimmable-light infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 1941304 1963912 22608 1.2
onoff-light infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 1851832 1874984 23152 1.3
onoff-light-bt infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 3207424 3231424 24000 0.7
rs-matter-core infodefmt-optz-ltofat riscv32imac-unknown-none-elf FLASH 390428 392902 2474 0.6
thumbv6m-none-eabi FLASH 325980 334292 8312 2.5
thumbv7em-none-eabi FLASH 301364 306972 5608 1.9
infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 840687 862759 22072 2.6
speaker infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 1912536 1936616 24080 1.3
Full report (8 builds for dimmable-light, onoff-light, onoff-light-bt, rs-matter-core, speaker)
platform target config section e14f27a 383637b change % change
dimmable-light infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 1941304 1963912 22608 1.2
RAM 42720 42736 16 0.0
onoff-light infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 1851832 1874984 23152 1.3
RAM 42704 42720 16 0.0
onoff-light-bt infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 3207424 3231424 24000 0.7
RAM 9308 9308 0 0.0
rs-matter-core infodefmt-optz-ltofat riscv32imac-unknown-none-elf FLASH 390428 392902 2474 0.6
RAM 68952 68976 24 0.0
thumbv6m-none-eabi FLASH 325980 334292 8312 2.5
RAM 65348 65364 16 0.0
thumbv7em-none-eabi FLASH 301364 306972 5608 1.9
RAM 64836 64856 20 0.0
infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 840687 862759 22072 2.6
RAM 73634 73650 16 0.0
speaker infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 1912536 1936616 24080 1.3
RAM 5480 5480 0 0.0

@ivmarkov
Copy link
Contributor Author

Also see #335

@ivmarkov
Copy link
Contributor Author

ivmarkov commented Oct 20, 2025

The code size is increased (by 2.5% in the worst case for thumbv6m) because the 3rd commit introduces new functionality (configuring extra mDNS parameters) and also the 4th commit introduces new functionality (option to timeout the Commissioning Window).

Copy link
Contributor

@bjoernQ bjoernQ left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

PR #334: Size comparison from e14f27a to bd9c3e2

Increases above 0.2%:

platform target config section e14f27a bd9c3e2 change % change
dimmable-light infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 1941304 1964272 22968 1.2
onoff-light infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 1851832 1875312 23480 1.3
onoff-light-bt infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 3207424 3231720 24296 0.8
rs-matter-core infodefmt-optz-ltofat riscv32imac-unknown-none-elf FLASH 390428 393022 2594 0.7
thumbv6m-none-eabi FLASH 325980 334368 8388 2.6
thumbv7em-none-eabi FLASH 301364 307068 5704 1.9
infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 840687 863071 22384 2.7
speaker infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 1912536 1937008 24472 1.3
Full report (8 builds for dimmable-light, onoff-light, onoff-light-bt, rs-matter-core, speaker)
platform target config section e14f27a bd9c3e2 change % change
dimmable-light infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 1941304 1964272 22968 1.2
RAM 42720 42736 16 0.0
onoff-light infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 1851832 1875312 23480 1.3
RAM 42704 42720 16 0.0
onoff-light-bt infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 3207424 3231720 24296 0.8
RAM 9308 9308 0 0.0
rs-matter-core infodefmt-optz-ltofat riscv32imac-unknown-none-elf FLASH 390428 393022 2594 0.7
RAM 68952 68976 24 0.0
thumbv6m-none-eabi FLASH 325980 334368 8388 2.6
RAM 65348 65364 16 0.0
thumbv7em-none-eabi FLASH 301364 307068 5704 1.9
RAM 64836 64856 20 0.0
infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 840687 863071 22384 2.7
RAM 73634 73650 16 0.0
speaker infologs-optz-ltofat x86_64-unknown-linux-gnu FLASH 1912536 1937008 24472 1.3
RAM 5480 5480 0 0.0

@ivmarkov ivmarkov enabled auto-merge (squash) October 20, 2025 17:41
@ivmarkov ivmarkov merged commit 7f5884f into project-chip:main Oct 20, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants