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

feat(openthread): native API extension#11598

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

Conversation

@SuGlider
Copy link
Collaborator

Description of Change

This pull request introduces enhancements to the OpenThread library, focusing on improved network information retrieval, including caching mechanisms for unicast and multicast list of addresses.
It also adds new methods for accessing and managing Thread network data directly from node operational dataset.

Arduino Keywords are updated to cover all changes.
Current Native API examples were updated to demonstrate the new API application.

Tests scenarios

Using ESP32-C6 and ESP32-H2 with the provided examples.

Related links

None.

@SuGliderSuGlider added this to the3.2.1 milestoneJul 14, 2025
@SuGliderSuGlider self-assigned thisJul 14, 2025
@SuGliderSuGlider added the Area: OpenThreadIssues and Feature Request about OpenThread Protocol labelJul 14, 2025
@SuGliderSuGlider marked this pull request as draftJuly 14, 2025 17:52
@github-actions
Copy link
Contributor

github-actionsbot commentedJul 14, 2025
edited
Loading

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message"fix(openthread): CR/LF fix":
    • summary looks too short

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 againstcc145c7

@github-actions
Copy link
Contributor

github-actionsbot commentedJul 14, 2025
edited
Loading

Test Results

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

Results for commitcc145c7.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

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
ESP32C6000.000.00000.000.00
ESP32H2000.000.00000.000.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32C6ESP32H2
ExampleFLASHRAMFLASHRAM
libraries/OpenThread/examples/CLI/COAP/coap_lamp----
libraries/OpenThread/examples/CLI/COAP/coap_switch----
libraries/OpenThread/examples/CLI/SimpleCLI----
libraries/OpenThread/examples/CLI/SimpleNode----
libraries/OpenThread/examples/CLI/SimpleThreadNetwork/ExtendedRouterNode----
libraries/OpenThread/examples/CLI/SimpleThreadNetwork/LeaderNode----
libraries/OpenThread/examples/CLI/SimpleThreadNetwork/RouterNode----
libraries/OpenThread/examples/CLI/ThreadScan----
libraries/OpenThread/examples/CLI/onReceive----
libraries/OpenThread/examples/Native/SimpleThreadNetwork/LeaderNode----
libraries/OpenThread/examples/Native/SimpleThreadNetwork/RouterNode----

@SuGliderSuGlider requested a review fromCopilotJuly 14, 2025 19:17

This comment was marked as outdated.

@SuGliderSuGlider requested a review fromCopilotJuly 15, 2025 01:56
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 enhances the native OpenThread API by exposing operational dataset and network parameters to Arduino applications, adds caching for unicast and multicast IPv6 addresses, and updates examples and keyword lists to demonstrate the new functionality.

  • Added getters for network name, extended PAN ID, network key, channel, PAN ID, RLOCs, and the current dataset.
  • Introduced mutable caching for unicast and multicast addresses, with populate/clear APIs.
  • Updated Arduino keywords and example sketches (RouterNode and LeaderNode) to use and showcase the new methods.

Reviewed Changes

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

Show a summary per file
FileDescription
libraries/OpenThread/src/OThread.hDeclared new getters for network info and address-cache methods
libraries/OpenThread/src/OThread.cppImplemented dataset setters with null checks, getters, caching
libraries/OpenThread/keywords.txtAdded new API methods andOnReceiveCb_t to the keyword list
libraries/OpenThread/examples/.../RouterNode.inoUpdated example to display active dataset details
libraries/OpenThread/examples/.../LeaderNode.inoUpdated example to list unicast/multicast addresses and handle role changes
Comments suppressed due to low confidence (5)

libraries/OpenThread/src/OThread.h:153

  • [nitpick] The member namemCurrentDataset differs from the originalmCurrentDataSet naming. Align with the existing convention (e.g.,mCurrentDataSet) for consistency.
  static DataSet mCurrentDataset;  // Current dataset being used by the OpenThread instance.

libraries/OpenThread/src/OThread.cpp:621

  • The new address-caching APIs (getUnicastAddressCount,getUnicastAddress,getAllUnicastAddresses and multicast equivalents) currently lack unit tests. Add tests to verify cache population, clearing, and out-of-range behavior.
size_t OpenThread::getUnicastAddressCount() const {

libraries/OpenThread/src/OThread.cpp:142

  • Using OT_NETWORK_KEY_SIZE may not match the actual network name buffer length and doesn’t guarantee null-termination. Use sizeof(mDataset.mNetworkName.m8) (or the correct OT_NETWORK_NAME_SIZE) and explicitly set the final byte to '\0' to avoid overflow.
  strncpy(mDataset.mNetworkName.m8, name, OT_NETWORK_KEY_SIZE);

libraries/OpenThread/examples/Native/SimpleThreadNetwork/RouterNode/RouterNode.ino:26

  • The example callsotGetDeviceRole(), but this wrapper isn’t declared in the updatedOThread.h. Either expose this method in the header or use the correct existing API name to avoid a compile error.
  ot_device_role_t currentRole = threadChildNode.otGetDeviceRole();

libraries/OpenThread/keywords.txt:16

  • [nitpick]OnReceiveCb_t was added to the keyword list but isn’t introduced in these changes. If it’s not used in any new API, consider removing it to keep the keyword file focused.
OnReceiveCb_tKEYWORD1

@SuGliderSuGlider moved this fromTodo toIn Progress inArduino ESP32 Core Project RoadmapJul 15, 2025
@SuGliderSuGlider marked this pull request as ready for reviewJuly 15, 2025 02:46
@SuGliderSuGlider moved this fromIn Progress toIn Review inArduino ESP32 Core Project RoadmapJul 15, 2025
@SuGliderSuGlider added the Status: Review neededIssue or PR is awaiting review labelJul 15, 2025
@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 labelsJul 16, 2025
@me-no-devme-no-dev merged commit6015fd7 intoespressif:masterJul 16, 2025
51 of 52 checks passed
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: OpenThreadIssues and Feature Request about OpenThread ProtocolStatus: Pending MergePull Request is ready to be merged

Projects

Milestone

3.2.1

Development

Successfully merging this pull request may close these issues.

4 participants

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

[8]ページ先頭

©2009-2025 Movatter.jp