Skip to content

[SL-UP] Add commissioning event handling in BaseApplication - #1246

Merged
Rohan Sahay (rosahay-silabs) merged 1 commit into
test/feature/add-matter-servicefrom
feature/add-system-event-commissioning
Oct 6, 2026
Merged

Rohan Sahay (rosahay-silabs) merged 1 commit into
test/feature/add-matter-servicefrom
feature/add-system-event-commissioning

Conversation

@rosahay-silabs

@rosahay-silabs Rohan Sahay (rosahay-silabs) commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds events for Commissioning started and errored events.

Related issues

N/A

Testing

Locally tested the following cases to verify the outcome.

  • failed commissioning
  • successful commissioning
  • commands
  • open-commissioning window and add a new commissioner
  • reboot and run commands

- Implemented OnCommissioningSessionEstablishmentStarted and logging for commissioning events in BaseApplication.
- Updated MQTT example to log commissioning start and failure events.
- Added new event types for commissioning to the DeviceEventType enum.
@rosahay-silabs

Copy link
Copy Markdown
Contributor Author

BugBot review

@cursor

cursor Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Small, additive notification path on commissioning callbacks; no changes to credential handling or core commissioning logic beyond posting events.

Overview
Silabs apps can now observe commissioning establishment lifecycle via new platform events, not only the existing session started/stopped hooks.

BaseApplicationDelegate implements OnCommissioningSessionEstablishmentStarted and posts kSLSystemEventCommissioningStarted. On OnCommissioningSessionEstablishmentError, it still clears commissioning state and ICD Wi‑Fi sleep handling, and additionally posts kSLSystemEventCommissioningFailed.

CHIPDevicePlatformEvent.h defines those two public Silabs DeviceEventType values so OnPlatformEvent handlers (e.g. MQTT or other examples) can react without duplicating AppDelegate wiring.

Reviewed by Cursor Bugbot for commit 755b174. Configure here.

@rosahay-silabs
Rohan Sahay (rosahay-silabs) added this pull request to stack #1247 October 6, 2026 10:33
@rosahay-silabs
Rohan Sahay (rosahay-silabs) marked this pull request as ready for review October 6, 2026 10:35
@rosahay-silabs
Rohan Sahay (rosahay-silabs) requested a review from a team as a code owner October 6, 2026 10:35

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 755b174. Configure here.

ChipDeviceEvent event{};
event.Type = DeviceEventType::kSLSystemEventCommissioningStarted;
LogErrorOnFailure(PlatformMgr().PostEvent(&event));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Commissioning events miss session lifecycle

Medium Severity

kSLSystemEventCommissioningStarted is posted from OnCommissioningSessionEstablishmentStarted, and kSLSystemEventCommissioningFailed is posted from every OnCommissioningSessionEstablishmentError. Those callbacks are per PASE attempt: failed still leaves the window open for retries, and closing the window or finishing successfully does not post a matching terminal event (OnCommissioningSessionStopped and OnCommissioningWindowClosed are silent). The names also disagree with isComissioningStarted, which flips only in OnCommissioningSessionStarted. Listeners that pause work on started and resume on failed will flap during retries or stay paused after a window close.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 755b174. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

for window close with a success we should be getting kCommissioningComplete event from the CHIPDeviceEvent.h for window close with error we are publishing the corresponding event.

@rosahay-silabs Rohan Sahay (rosahay-silabs) changed the title Add commissioning event handling in BaseApplication and MQTT example [SL-UP] Add commissioning event handling in BaseApplication and MQTT example Oct 6, 2026
@rosahay-silabs Rohan Sahay (rosahay-silabs) changed the title [SL-UP] Add commissioning event handling in BaseApplication and MQTT example [SL-UP] Add commissioning event handling in BaseApplication Oct 6, 2026
LEDWidget * BaseApplication::sAppActionLed = nullptr;
BaseApplicationDelegate BaseApplication::sAppDelegate = BaseApplicationDelegate();

void BaseApplicationDelegate::OnCommissioningSessionEstablishmentStarted()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems ok, but does it need to be a post event? This can already be treated as a event it is already on the same thread as what PlatformMgr().PostEvent will queue it too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes true but only if we use it here right? Since stelpro is looking for the event I am assuming they want to use it somewhere else on the AppTask on somewhere else. In that case we would need the post it to others to react to it?

@rosahay-silabs
Rohan Sahay (rosahay-silabs) merged commit 206f6d4 into test/feature/add-matter-service Oct 6, 2026
16 checks passed
@rosahay-silabs
Rohan Sahay (rosahay-silabs) deleted the feature/add-system-event-commissioning branch October 6, 2026 14:49
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