-
Notifications
You must be signed in to change notification settings - Fork 7.7k
feat(zigbee): Add callback option for default response message #11613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Hello P-R-O-C-H-Y, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Test Results 76 files 76 suites 13m 13s ⏱️ Results for commit b749553. ♻️ This comment has been updated with latest results. |
@def1149 @michapr @mister-pjr If you have time, please test this PR if it helps to solve the linked issues. Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a default response callback mechanism for ZigbeeEP that enables notification when ZCL commands complete, specifically targeting improved power management for sleepy devices by eliminating blocking delays.
- Adds callback registration system for default response handling with typed command identifiers
- Implements foundation command enum (
zb_cmd_type_t
) for better type safety and error handling - Updates sleepy device example to demonstrate asynchronous command completion checking
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
libraries/Zigbee/src/ZigbeeHandlers.cpp | Adds endpoint iteration to call default response callbacks |
libraries/Zigbee/src/ZigbeeEP.h | Defines command type enum and adds callback registration method |
libraries/Zigbee/src/ZigbeeEP.cpp | Implements default response handler with callback invocation |
libraries/Zigbee/keywords.txt | Adds new type and method to Arduino IDE syntax highlighting |
libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy/Zigbee_Temp_Hum_Sensor_Sleepy.ino | Demonstrates callback usage replacing blocking delays |
libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy/Zigbee_Temp_Hum_Sensor_Sleepy.ino
Outdated
Show resolved
Hide resolved
libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy/Zigbee_Temp_Hum_Sensor_Sleepy.ino
Outdated
Show resolved
Hide resolved
libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy/Zigbee_Temp_Hum_Sensor_Sleepy.ino
Outdated
Show resolved
Hide resolved
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
A small test here, I have set Debug level to Error so only prints from sketch are in Serial Monitor.
From that you can see that device was alive only for 657 ms before going to sleep again. |
Description of Change
Added a default response callback mechanism to ZigbeeEP that allows users to receive notifications when ZCL commands complete, eliminating the need for delays in sleepy devices.
Main Feature: Default Response Callback
zb_cmd_type_t
) for better error handlingdelay()
calls with unknown timeAdditional Improvements
Usage Example
Benefits for Sleepy Devices
delay()
callsTests scenarios
Tested using updated Temp_Hum_Sleepy example and HA. No data were lost during an 1,5 hour test with reporting data approx. every minute:

Related links
Closes #11038
Closes #11597