Skip to content

#27: Fix CDR_ZWPv2IndicatorCCRequirements_Rev01 - #47

Open
Aydogan Ersoz (silabs-aydogane) wants to merge 1 commit into
SiliconLabsSoftware:mainfrom
silabs-aydogane:GH-27-CDR_ZWPv2IndicatorCCRequirements_Rev01
Open

#27: Fix CDR_ZWPv2IndicatorCCRequirements_Rev01#47
Aydogan Ersoz (silabs-aydogane) wants to merge 1 commit into
SiliconLabsSoftware:mainfrom
silabs-aydogane:GH-27-CDR_ZWPv2IndicatorCCRequirements_Rev01

Conversation

@silabs-aydogane

@silabs-aydogane Aydogan Ersoz (silabs-aydogane) commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Issue

Closes: #27

Change

Must be merged after #56.

  • Publish an MQTT IndicatorSet message when ZPC receives an Indicator Set command.
  • Store Indicator Get/Set data on the ZPC endpoint node instead of the source endpoint. ZPC is the DUT so the data must live under ZPC's own node.
  • Ignore logs/, ci-logs/, and tmp/ in .gitignore.

MQTT handler wait is in #56.

Checklist

@silabs-aydogane Aydogan Ersoz (silabs-aydogane) added On roadmap On the official roadmap and will be implemented by Silicon Labs Bug Issue is a bug report Silicon Labs development PR contents developed by Silicon Labs CTT Requested (Full Set) CTT Testing with full scope is requested from CTT Automation labels Aug 31, 2026
@cursor

cursor Bot commented Aug 31, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Localized Indicator command-class and MQTT reporting changes with stricter endpoint validation; no auth or broad architectural impact.

Overview
When the ZPC handles an incoming Indicator Set (support path), it now emits an MQTT report so integrators can observe the command without polling the attribute store.

After persisting the set into the indicator report group, on_indicator_set_support_received calls new publish_indicator_set_received, which builds a JSON payload (indicator_0_value, properties1.indicator_object_count, and vg1 entries as hex strings) and publishes to {baseTopic}{commandClass}/Report/IndicatorSet.

Indicator get/set support handling also resolves the endpoint via get_zpc_endpoint_id_node from the local connection endpoint instead of command_class_utils::get_endpoint_node, and returns SL_STATUS_FAIL when that node is invalid.

Reviewed by Cursor Bugbot for commit d935458. Bugbot is set up for automated code reviews on this repo. Configure here.

@silabs-aydogane
Aydogan Ersoz (silabs-aydogane) force-pushed the GH-27-CDR_ZWPv2IndicatorCCRequirements_Rev01 branch from 751d4aa to 09e0cfd Compare August 31, 2026 09:37

@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

Reviewed by Cursor Bugbot for commit 09e0cfd. Configure here.

@silabs-aydogane
Aydogan Ersoz (silabs-aydogane) force-pushed the GH-27-CDR_ZWPv2IndicatorCCRequirements_Rev01 branch from 09e0cfd to 76fb590 Compare August 31, 2026 10:01
@cursor

cursor Bot commented Aug 31, 2026

Copy link
Copy Markdown

Current version of PR was reviewed by /review-bugbot on Aug 31, 11:59 GMT+2. It flagged 0 findings.

Bugbot on commit 76fb590 is skipped.

@siliconlabsdevops-svc-devops siliconlabsdevops-svc-devops Bot removed the CTT Requested (Full Set) CTT Testing with full scope is requested from CTT Automation label Aug 31, 2026
@siliconlabsdevops-svc-devops

Copy link
Copy Markdown

CTT Jenkins job: $zpc_ctt_jenkins_url/job/zw-ctt-automation-multibranch/job/main/3586/

@silabs-aydogane

Copy link
Copy Markdown
Collaborator Author

bugbot run

@cursor

cursor Bot commented Aug 31, 2026

Copy link
Copy Markdown

Current version of PR was reviewed by /review-bugbot on Aug 31, 11:59 GMT+2. It flagged 0 findings.

Bugbot on commit 76fb590 is skipped.

@silabs-aydogane
Aydogan Ersoz (silabs-aydogane) force-pushed the GH-27-CDR_ZWPv2IndicatorCCRequirements_Rev01 branch from 76fb590 to ebeff6d Compare August 31, 2026 12:06
@cursor

cursor Bot commented Aug 31, 2026

Copy link
Copy Markdown

Current version of PR was reviewed by /review-bugbot on Aug 31, 11:59 GMT+2. It flagged 0 findings.

Bugbot on commit ebeff6d is skipped.

@silabs-aydogane Aydogan Ersoz (silabs-aydogane) added CTT Requested (Full Set) CTT Testing with full scope is requested from CTT Automation and removed CTT Requested (Full Set) CTT Testing with full scope is requested from CTT Automation labels Aug 31, 2026
@silabs-aydogane
Aydogan Ersoz (silabs-aydogane) force-pushed the GH-27-CDR_ZWPv2IndicatorCCRequirements_Rev01 branch from ebeff6d to 7f1c1fc Compare August 31, 2026 13:25
@cursor

cursor Bot commented Aug 31, 2026

Copy link
Copy Markdown

Current version of PR was reviewed by /review-bugbot on Aug 31, 11:59 GMT+2. It flagged 0 findings.

Bugbot on commit 7f1c1fc is skipped.

@silabs-aydogane Aydogan Ersoz (silabs-aydogane) added the CTT Requested (Full Set) CTT Testing with full scope is requested from CTT Automation label Aug 31, 2026
@siliconlabsdevops-svc-devops siliconlabsdevops-svc-devops Bot removed the CTT Requested (Full Set) CTT Testing with full scope is requested from CTT Automation label Aug 31, 2026
@siliconlabsdevops-svc-devops

Copy link
Copy Markdown

CTT Jenkins job: $zpc_ctt_jenkins_url/job/zw-ctt-automation-multibranch/job/main/3589/

@silabs-aydogane
Aydogan Ersoz (silabs-aydogane) force-pushed the GH-27-CDR_ZWPv2IndicatorCCRequirements_Rev01 branch from 7f1c1fc to d935458 Compare September 1, 2026 09:12
@silabs-aydogane Aydogan Ersoz (silabs-aydogane) changed the title #27: Publish an MQTT message when ZPC receives an Indicator Set #27: Fix CDR_ZWPv2IndicatorCCRequirements_Rev01 Sep 1, 2026
@silabs-aydogane
Aydogan Ersoz (silabs-aydogane) marked this pull request as draft September 1, 2026 09:13
@silabs-aydogane

Copy link
Copy Markdown
Collaborator Author

Claude AI reasoning:

Old code:

while (auto msg = publish_queue.try_pop()) { ... }  // drain whatever is there RIGHT NOW
...
if (!processed_any) {
    sleep_for(100ms);  // blind sleep, no way to be woken early
}

try_pop() checks the queue once, takes everything that is already there, and returns immediately with nothing if the queue is empty. It never waits. So if the queue is empty at that moment, the thread falls through to sleep_for(100ms) which is a dumb timer with no connection to the queue.

When publish() is called on another thread during that sleep, the message sits in the queue. The handler thread has no idea. It wakes up only when the 100 ms timer expires, then calls try_pop() again and finally processes the message.

New code:

if (auto msg = publish_queue.pop(100)) { ... }  // blocks until something arrives OR 100ms pass

pop(timeout) goes to sleep on the queue's own condition variable. push() always calls notify_one() on that same condition variable. So the handler thread wakes up the moment publish() pushes a message and not after the timer.

The while loop in the old code looked like it was "waiting" but it was only draining what was already there. The actual wait was the sleep_for at the bottom, which was deaf to new arrivals.

@silabs-aydogane
Aydogan Ersoz (silabs-aydogane) marked this pull request as ready for review September 2, 2026 08:11
@siliconlabsdevops-svc-devops siliconlabsdevops-svc-devops Bot removed the CTT Requested (Full Set) CTT Testing with full scope is requested from CTT Automation label Sep 2, 2026
@siliconlabsdevops-svc-devops

Copy link
Copy Markdown

CTT Jenkins job: $zpc_ctt_jenkins_url/job/zw-ctt-automation-multibranch/job/main/3609/

Comment thread components/mqtt/src/mqtt_handler.cpp
Comment thread components/mqtt/src/mqtt_handler.cpp Outdated
@silabs-peterb

Copy link
Copy Markdown
Collaborator

After this MQTT component change a stress test would be nice. Even locally.

@silabs-aydogane
Aydogan Ersoz (silabs-aydogane) force-pushed the GH-27-CDR_ZWPv2IndicatorCCRequirements_Rev01 branch from 06e4abf to bfe2ffb Compare September 2, 2026 12:42
@silabs-aydogane
Aydogan Ersoz (silabs-aydogane) force-pushed the GH-27-CDR_ZWPv2IndicatorCCRequirements_Rev01 branch from 3420eeb to 09b74fc Compare September 2, 2026 13:51
@silabs-aydogane Aydogan Ersoz (silabs-aydogane) added the CTT Requested (Full Set) CTT Testing with full scope is requested from CTT Automation label Sep 2, 2026
@siliconlabsdevops-svc-devops siliconlabsdevops-svc-devops Bot removed the CTT Requested (Full Set) CTT Testing with full scope is requested from CTT Automation label Sep 2, 2026
@siliconlabsdevops-svc-devops

Copy link
Copy Markdown

CTT Jenkins job: $zpc_ctt_jenkins_url/job/zw-ctt-automation-multibranch/job/main/3613/

@silabs-aydogane Aydogan Ersoz (silabs-aydogane) added the CTT Requested (Full Set) CTT Testing with full scope is requested from CTT Automation label Sep 3, 2026
@siliconlabsdevops-svc-devops siliconlabsdevops-svc-devops Bot removed the CTT Requested (Full Set) CTT Testing with full scope is requested from CTT Automation label Sep 3, 2026
@siliconlabsdevops-svc-devops

Copy link
Copy Markdown

CTT Jenkins job: $zpc_ctt_jenkins_url/job/zw-ctt-automation-multibranch/job/main/3618/

@silabs-aydogane
Aydogan Ersoz (silabs-aydogane) force-pushed the GH-27-CDR_ZWPv2IndicatorCCRequirements_Rev01 branch from 09b74fc to e033a23 Compare September 3, 2026 13:06
@silabs-aydogane

Copy link
Copy Markdown
Collaborator Author

After this MQTT component change a stress test would be nice. Even locally.

I abandoned that change.

@silabs-aydogane
Aydogan Ersoz (silabs-aydogane) force-pushed the GH-27-CDR_ZWPv2IndicatorCCRequirements_Rev01 branch from e033a23 to 0656ae8 Compare September 3, 2026 13:21
@silabs-aydogane Aydogan Ersoz (silabs-aydogane) added the CTT Requested (Full Set) CTT Testing with full scope is requested from CTT Automation label Sep 3, 2026
@siliconlabsdevops-svc-devops siliconlabsdevops-svc-devops Bot removed the CTT Requested (Full Set) CTT Testing with full scope is requested from CTT Automation label Sep 3, 2026
@siliconlabsdevops-svc-devops

Copy link
Copy Markdown

CTT Jenkins job: $zpc_ctt_jenkins_url/job/zw-ctt-automation-multibranch/job/main/3625/

…Indicator Set

Signed-off-by: Aydogan Ersoz <aydogan.ersoz@silabs.com>
@silabs-aydogane
Aydogan Ersoz (silabs-aydogane) force-pushed the GH-27-CDR_ZWPv2IndicatorCCRequirements_Rev01 branch from 0656ae8 to 4342563 Compare September 4, 2026 06:23
@tamas-fraknoi

Copy link
Copy Markdown
Collaborator

CTT test CDR_ZWPv2IndicatorCCRequirements_Rev01 now passes.

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

Labels

Bug Issue is a bug report On roadmap On the official roadmap and will be implemented by Silicon Labs Silicon Labs development PR contents developed by Silicon Labs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix CDR_ZWPv2IndicatorCCRequirements_Rev01

4 participants