-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[BUG] ScanNetworksResponse returns duplicated networks and return list is limited #24136
Comments
Isn't your problem already fixed by https://github.com/project-chip/connectedhomeip/pull/23492/files? |
Hello @Damian-Nordic , thank you for the pointer. Yes, that code should fix the most critical issue. However I don't fully understand this section of the of code:
If the new entry is found to be a duplicate, the higher RSSI should be kept so this seems better: |
@AlanLCollins This code simply cancels/removes the existing entry (by replacing it with the last element and decrementing the array size) for a given PAN ID so that it can be re-added later. So it's equivalent to what you proposed, right? |
I will update the answer to this issue and request that this issue be closed. if (scanResponseArray[i].rssi < scanResponse.rssi)
{
scanResponseArray[i] = scanResponseArray[--scanResponseArrayLength];
} but it later adds and sorts the item. scanResponseArray[scanResponseArrayLength - 1] = scanResponse;
Sorting::InsertionSort(scanResponseArray.Get(), scanResponseArrayLength,
[](const ThreadScanResponse & a, const ThreadScanResponse & b) -> bool { return a.rssi > b.rssi; }); I added the code above for minor optimization, so it should work well. I already tested it in the environment below, and I confirmed that it works well through my Commissioner's log.
@AlanLCollins , as I said several times on Slack, I think you ...
then, you reported this issue. You should check the sorted scan list in your Commissioner's log or your Thread Commissionee Device's log after adding scan results logging function in the right place. The Thread Commissionee Device's OpenThread stack prints the scan results, this is the results before sorting and removing duplicates from the code in my PR. If you did the test, I think you would have seen this log. Please close this issue after fully understanding the code or testing properly. If you have additional questions, please leave a comment. |
Closing this ticket, as the PR shared addresses the most critical issue. The extra analysis/concern of the PR itself comes from doing code review of the change. I need to come back with actual tests to be certain if there is a real issue. |
Reproduction steps
Results:
Proposed solution:
Bug prevalence
always
GitHub hash of the SDK that was being used
SDK1.0
Platform
efr32, nrf
Platform Version(s)
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: