fix network scanning report (TZ-2115)#737
Open
nraynaud wants to merge 2 commits intoespressif:mainfrom
Open
Conversation
there was a bug in the pointer arithmetics.
the notification frame also had an incorrect layout
lhespress
reviewed
Nov 21, 2025
|
|
||
| if (nwk_descriptor && count) { | ||
| memcpy(scan_data + sizeof(esp_ncp_zb_scan_parameters_t), nwk_descriptor, (count * sizeof(esp_zb_network_descriptor_t))); | ||
| memcpy(scan_data + 1, nwk_descriptor, (count * sizeof(esp_zb_network_descriptor_t))); |
Contributor
There was a problem hiding this comment.
memcpy((uint8_t *)scan_data + sizeof(esp_ncp_zb_scan_parameters_t), nwk_descriptor, (count * sizeof(esp_zb_network_descriptor_t))); is better.
Contributor
Author
There was a problem hiding this comment.
as long as you don't mess the base pointer, do what you want. I personally would never remember the precedence of the casting vs addition but I'm not an expert.
Contributor
|
@nraynaud You can git apply this host_scan.zip patch and run host example test the function. |
Contributor
Author
|
Sorry, I don't have a running test platform anymore, I moved to using Spinel. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
there was a bug in the pointer arithmetics.
Description
calling the scan function would crash
Testing
I'd be curioous to know how YOU tested the feature in the first place.
when I do a scan now it doesn't crash, doesn't reboot and send a notification on the link.
Checklist
Before submitting a Pull Request, please ensure the following: