Skip to content
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

Fix implementation of OnChipScanComplete and OnScanComplete - second PR #24873

Merged
merged 9 commits into from
Feb 28, 2023

Conversation

jlatusek
Copy link
Contributor

@jlatusek jlatusek commented Feb 6, 2023

I recreated PR #23612. In the original one there was a problem with CI "pullapprove — Given usernames could not be requested."

Problem

When the chip-tool is shutting down because of timeout from StartWaiting then mBleLayer->mBleTransport is firstly set to nullptr and OnBleConnectionError is called on this pointer.

Fix

I've changed the implementation of OnScanComplete to do not call OnConnectionError it seems that this isn't the right place to do it. I've created OnScanError, which is called when the error occurs during scanning. Now it is called from TimerExpiredCallback which is the callback for a timeout for scan task. For kConnectTimeout OnConnectionError is called here if an error occurred.

Testing

Manually tested on the Linux platform on one device I've run:

 ./out/linux-x64-light/chip-lighting-app --discriminator 42 --passcode 1234 --wifi 

and on the other Linux device I've run:

./out/linux-x64-chip-tool/chip-tool pairing ble-wifi 0x01 <wifi_name> <wifi_pass> 1234 42

@andy31415 andy31415 merged commit d6a783e into project-chip:master Feb 28, 2023
shchen-Lab added a commit to bouffalolab/connectedhomeip-1 that referenced this pull request Mar 1, 2023
…p-1 into bl702l_matter

* 'bl702l_matter' of github.com:bouffalolab/connectedhomeip-1: (446 commits)
  [Python] Add Python commissioning flow (project-chip#25119)
  Add to flake8 in workflow and fix python files (project-chip#25280)
  Align Time Format Localization cluster XML to spec changes. (project-chip#25289)
  Use the PathsFinder module in scripts/tests/run_test_suite.py instead of having duplicated code (project-chip#25368)
  Add a continuous browse for Matter operational advertisements on Darwin. (project-chip#25317)
  Chef doorlock sample update (project-chip#24118)
  Fix implementation of OnChipScanComplete and OnScanComplete - second PR (project-chip#24873)
  Add to flake8 in workflow and fix python files (project-chip#25279)
  Make PASE setup a bit more robust if multiple clients race. (project-chip#25352)
  Add dependent lib kotlin-stdlib for kotlin version of java-matter-controller (project-chip#25358)
  [python tests] Add to flake8 in workflow and fix python files (part project-chip#25193) (project-chip#25312)
  Add to flake8 in workflow and fix python files (project-chip#25283)
  Add a way to read a concrete attribute path from AttributePathIB::Parser. (project-chip#25293)
  Make sure various tests in TestReadInteraction are not no-ops. (project-chip#25298)
  [Android] Add isUrgent option in Android (project-chip#25301)
  [NXP] Add to flake8 in workflow and fix python files (part project-chip#25193) (project-chip#25305)
  [placeholder] Allow applications can specify which additional sources to build (project-chip#25346)
  Set thread sleep and yield backends for rpc (project-chip#25350)
  [config-data] Remove some enums that just don't generate anything (project-chip#25370)
  [Tizen] CI workflow for running QEMU-based tests (project-chip#24871)
  ...
shchen-Lab added a commit to bouffalolab/connectedhomeip-1 that referenced this pull request Mar 1, 2023
* official/master: (449 commits)
  tv-casting-app: Updating the context we pass to FindOrEstablishSession
  Changing caching logic to match video players using hostname before other attributes
  Enable -Wconversion tree-wide on darwin. (project-chip#25376)
  [Python] Add Python commissioning flow (project-chip#25119)
  Add to flake8 in workflow and fix python files (project-chip#25280)
  Align Time Format Localization cluster XML to spec changes. (project-chip#25289)
  Use the PathsFinder module in scripts/tests/run_test_suite.py instead of having duplicated code (project-chip#25368)
  Add a continuous browse for Matter operational advertisements on Darwin. (project-chip#25317)
  Chef doorlock sample update (project-chip#24118)
  Fix implementation of OnChipScanComplete and OnScanComplete - second PR (project-chip#24873)
  Add to flake8 in workflow and fix python files (project-chip#25279)
  Make PASE setup a bit more robust if multiple clients race. (project-chip#25352)
  Add dependent lib kotlin-stdlib for kotlin version of java-matter-controller (project-chip#25358)
  [python tests] Add to flake8 in workflow and fix python files (part project-chip#25193) (project-chip#25312)
  Add to flake8 in workflow and fix python files (project-chip#25283)
  Add a way to read a concrete attribute path from AttributePathIB::Parser. (project-chip#25293)
  Make sure various tests in TestReadInteraction are not no-ops. (project-chip#25298)
  [Android] Add isUrgent option in Android (project-chip#25301)
  [NXP] Add to flake8 in workflow and fix python files (part project-chip#25193) (project-chip#25305)
  [placeholder] Allow applications can specify which additional sources to build (project-chip#25346)
  ...
lecndav pushed a commit to lecndav/connectedhomeip that referenced this pull request Mar 22, 2023
…PR (project-chip#24873)

* Remove on connection error from on scan complete

Create a separate error handler for scan errors

* Fix typo

* Remove redundant variable set

* Rewrite OnScanComplete to make it more readable.

Create a separate function to handle scan errors.

* Add missing override

* Style fix

* Change log level

* Call an error in darwin on StopTimeoutReached

* Error as int
@jlatusek jlatusek deleted the nullptr-ble-fix-2 branch January 15, 2024 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants