Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(zigbeeEP): review of names and memory allocation#11199

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
me-no-dev merged 17 commits intomasterfromzigbee_memory_review
Apr 5, 2025

Conversation

@SuGlider
Copy link
Collaborator

Description of Change

Just a general review of memory allocation routines and changingstring variable name to avoid using reserved words.

Tests scenarios

CI only

Related links

#11196

@SuGliderSuGlider added Status: In Progress ⚠️Issue is in progress Area: ZigbeeIssues and Feature Request about Zigbee labelsMar 28, 2025
@SuGliderSuGlider added this to the3.2.0 milestoneMar 28, 2025
@SuGliderSuGlider self-assigned thisMar 28, 2025
@github-actions
Copy link
Contributor

github-actionsbot commentedMar 28, 2025
edited
Loading

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message"fix(zigbeeEP): destructor shall free any allocated memory":
    • scope/component should be lowercase without whitespace, allowed special characters are_/.,*-.
  • the commit message"fix(zigbeeEP): review of names and memory allocation":
    • scope/component should be lowercase without whitespace, allowed special characters are_/.,*-.

Please fix these commit messages - here are some basic tips:

  • followConventional Commits style
  • correct format of commit message should be:<type/action>(<scope/component>): <summary>, for examplefix(esp32): Fixed startup timeout issue
  • allowed types are:change,ci,docs,feat,fix,refactor,remove,revert,test
  • sufficiently descriptive message summary should be between 10 to 72 characters and start with upper case letter
  • avoid Jira references in commit messages (unavailable/irrelevant for our customers)

TIP: Install pre-commit hooks and run this check when committing (uses theConventional Precommit Linter).

👋Hello SuGlider, we appreciate your contribution to this project!


📘 Please review the project'sContributions Guide for key guidelines on code, documentation, testing, and more.

🖊️ Please also make sure you haveread and signed theContributor License Agreement for this project.

Click to see more instructions ...


This automated output is generated by thePR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with eachpush event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger isnot a substitute for human code reviews; it's still important to request a code review from your colleagues.
-Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- To manuallyretry these Danger checks, please navigate to theActions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫dangerJS against8e03dd0

@SuGliderSuGlider moved this fromTodo toIn Progress inArduino ESP32 Core Project RoadmapMar 28, 2025
@github-actions
Copy link
Contributor

github-actionsbot commentedMar 28, 2025
edited
Loading

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.

MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32S30⚠️ +400.00⚠️ +0.01000.000.00
ESP32S20⚠️ +480.00⚠️ +0.01000.000.00
ESP32C30⚠️ +160.000.00000.000.00
ESP32C60⚠️ +160.000.00000.000.00
ESP32H20⚠️ +160.000.00000.000.00
ESP320⚠️ +440.00⚠️ +0.01000.000.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32S3ESP32S2ESP32C3ESP32C6ESP32H2ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
libraries/Zigbee/examples/Zigbee_Color_Dimmer_Switch⚠️ +400⚠️ +440⚠️ +160⚠️ +140⚠️ +140⚠️ +440
libraries/Zigbee/examples/Zigbee_Gateway⚠️ +200⚠️ +240⚠️ +140----⚠️ +280
libraries/Zigbee/examples/Zigbee_On_Off_Switch⚠️ +400⚠️ +480⚠️ +160⚠️ +140⚠️ +140⚠️ +440
libraries/Zigbee/examples/Zigbee_Range_Extender⚠️ +400⚠️ +480⚠️ +160⚠️ +160⚠️ +120⚠️ +440
libraries/Zigbee/examples/Zigbee_Thermostat⚠️ +400⚠️ +440⚠️ +160⚠️ +140⚠️ +160⚠️ +400
libraries/Zigbee/examples/Zigbee_Analog_Input_Output------⚠️ +160⚠️ +160--
libraries/Zigbee/examples/Zigbee_CarbonDioxide_Sensor------⚠️ +140⚠️ +160--
libraries/Zigbee/examples/Zigbee_Color_Dimmable_Light------⚠️ +160⚠️ +140--
libraries/Zigbee/examples/Zigbee_Contact_Switch------⚠️ +160⚠️ +120--
libraries/Zigbee/examples/Zigbee_Dimmable_Light------⚠️ +160⚠️ +160--
libraries/Zigbee/examples/Zigbee_Illuminance_Sensor------⚠️ +140⚠️ +140--
libraries/Zigbee/examples/Zigbee_OTA_Client------⚠️ +160⚠️ +140--
libraries/Zigbee/examples/Zigbee_Occupancy_Sensor------⚠️ +140⚠️ +160--
libraries/Zigbee/examples/Zigbee_On_Off_Light------⚠️ +160⚠️ +120--
libraries/Zigbee/examples/Zigbee_Pressure_Flow_Sensor------⚠️ +160⚠️ +140--
libraries/Zigbee/examples/Zigbee_Scan_Networks------0000--
libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy------⚠️ +160⚠️ +160--
libraries/Zigbee/examples/Zigbee_Temperature_Sensor------⚠️ +160⚠️ +140--
libraries/Zigbee/examples/Zigbee_Vibration_Sensor------⚠️ +160⚠️ +160--
libraries/Zigbee/examples/Zigbee_Wind_Speed_Sensor------⚠️ +140⚠️ +160--
libraries/Zigbee/examples/Zigbee_Window_Covering------⚠️ +140⚠️ +140--

@github-actions
Copy link
Contributor

github-actionsbot commentedMar 28, 2025
edited
Loading

Test Results

 76 files   76 suites   13m 45s ⏱️
 38 tests  38 ✅ 0 💤 0 ❌
241 runs  241 ✅ 0 💤 0 ❌

Results for commit8e03dd0.

♻️ This comment has been updated with latest results.

@SuGliderSuGlider moved this fromIn Progress toIn Review inArduino ESP32 Core Project RoadmapMar 28, 2025
@SuGliderSuGlider added Status: Review neededIssue or PR is awaiting review and removed Status: In Progress ⚠️Issue is in progress labelsMar 28, 2025
Copy link
Member

@P-R-O-C-H-YP-R-O-C-H-Y left a comment

Choose a reason for hiding this comment

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

Looking good at first sight, will test and approve if its working fine :)

SuGlider reacted with heart emoji
@SuGliderSuGlider added Status: In Progress ⚠️Issue is in progress and removed Status: Review neededIssue or PR is awaiting review labelsMar 30, 2025
@SuGliderSuGlider modified the milestones:3.2.0,3.2.1Mar 31, 2025
@SuGliderSuGlider removed the Status: In Progress ⚠️Issue is in progress labelMar 31, 2025
@SuGlider
Copy link
CollaboratorAuthor

@me-no-dev |@P-R-O-C-H-Y :: Changes done as discussed today. PTAL. Thanks!

@SuGliderSuGlider added the Status: Review neededIssue or PR is awaiting review labelMar 31, 2025
Copy link
Member

@P-R-O-C-H-YP-R-O-C-H-Y left a comment

Choose a reason for hiding this comment

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

LGTM! Tested with HomeAssistant + Light and switch examples. Both working

@me-no-devme-no-dev added Status: Pending MergePull Request is ready to be merged and removed Status: Review neededIssue or PR is awaiting review labelsApr 2, 2025
@me-no-devme-no-dev requested a review fromCopilotApril 3, 2025 12:02
Copy link
Contributor

CopilotAI left a 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 revisits memory allocation routines and renames a variable to avoid reserved words.

  • Introduces a constant for maximum name length.
  • Updates memory allocation in setManufacturerAndModel to use stack arrays.
  • Revises the handling of manufacturer and model string pointers in zbReadBasicCluster.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

FileDescription
libraries/Zigbee/src/ZigbeeEP.hAdded a constant ZB_MAX_NAME_LENGTH and updated comments.
libraries/Zigbee/src/ZigbeeEP.cppModified memory allocation for name/model handling and adjusted pointer logic.
Comments suppressed due to low confidence (1)

libraries/Zigbee/src/ZigbeeEP.cpp:39

  • Using stack-allocated arrays for zb_name and zb_model may lead to invalid memory references if esp_zb_basic_cluster_add_attr does not copy the data. Consider allocating memory on the heap or ensuring the data is copied safely.
char zb_name[ZB_MAX_NAME_LENGTH + 2];

SuGliderand others added2 commitsApril 3, 2025 09:09
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@SuGliderSuGlider requested a review fromCopilotApril 4, 2025 17:27
Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Files not reviewed (2)
  • libraries/Zigbee/src/ZigbeeEP.cpp: Language not supported
  • libraries/Zigbee/src/ZigbeeEP.h: Language not supported

@me-no-devme-no-dev requested a review fromCopilotApril 5, 2025 15:46
Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

libraries/Zigbee/src/ZigbeeEP.cpp:39

  • Using stack-allocated arrays for zb_name and zb_model could lead to undefined behavior if esp_zb_basic_cluster_add_attr does not internally copy the data. Please verify that the attribute addition function safely duplicates the input data or consider switching to dynamic allocation.
char zb_name[ZB_MAX_NAME_LENGTH + 2];

libraries/Zigbee/src/ZigbeeEP.cpp:171

  • [nitpick] For consistency with modern C++ conventions, consider using nullptr instead of NULL for pointer comparisons and assignments.
if (_read_manufacturer != NULL) {

@me-no-devme-no-dev merged commitb333bf2 intomasterApr 5, 2025
56 checks passed
@me-no-devme-no-dev deleted the zigbee_memory_review branchApril 5, 2025 15:47
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

@me-no-devme-no-devme-no-dev approved these changes

@lucasssvazlucasssvazlucasssvaz approved these changes

@P-R-O-C-H-YP-R-O-C-H-YP-R-O-C-H-Y approved these changes

Assignees

@SuGliderSuGlider

Labels

Area: ZigbeeIssues and Feature Request about ZigbeeStatus: Pending MergePull Request is ready to be merged

Projects

Milestone

3.2.1

Development

Successfully merging this pull request may close these issues.

5 participants

@SuGlider@me-no-dev@lucasssvaz@P-R-O-C-H-Y

[8]ページ先頭

©2009-2025 Movatter.jp