Skip to content

Add support for receiving basic fragmented messages #669

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

Merged
merged 10 commits into from
Apr 27, 2025
Merged

Conversation

ThomasKulin
Copy link
Contributor

I am not much of a developer but I have found your project to be very useful and would like to contribute a change that I made to implement fragmented message support. This likely needs to be expanded to respect the EzspConfigId.CONFIG_FRAGMENT_WINDOW_SIZE and EzspConfigId.CONFIG_FRAGMENT_DELAY_MS configuration parameters.

@puddly
Copy link
Contributor

puddly commented Feb 26, 2025

Interesting! Are fragmented frames something you're seeing with a consumer device, or is this a device that you're working on?

@ThomasKulin
Copy link
Contributor Author

I haven't seen them used in any consumer device so far. This is for something relating to solar inverters where Zigbee is used for data collection. Some of the data packets are large enough to necessitate fragmentation. This code works for my specific application where the device fragment window size is set to 1 (requiring an ack for each transmitted fragment). I have no way of testing with other window sizes. Feel free to recommend changes and I'll gladly make them!

Copy link
Contributor

@puddly puddly left a comment

Choose a reason for hiding this comment

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

I left a few comments regarding the cleanup code. Let me know if you have any questions.

Thanks again!

@puddly
Copy link
Contributor

puddly commented Feb 27, 2025

For the failing CI, you can set up pre-commit to auto-format your code and point out issues that CI would detect:

pip install pre-commit
pre-commit install
pre-commit run --all-files

This will also run every time you make a new Git commit, for future changes.

Copy link

codecov bot commented Mar 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.44%. Comparing base (bdb7374) to head (6f2fcc0).
Report is 4 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #669      +/-   ##
==========================================
+ Coverage   99.21%   99.44%   +0.22%     
==========================================
  Files          51       52       +1     
  Lines        3695     3761      +66     
==========================================
+ Hits         3666     3740      +74     
+ Misses         29       21       -8     

☔ 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.

@puddly puddly merged commit 857bfe5 into zigpy:dev Apr 27, 2025
14 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