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

Address testing feedback from opcert callbacks, and re-commissioning #22369

Merged
merged 9 commits into from
Sep 14, 2022

Conversation

chrisdecenzo
Copy link
Contributor

@chrisdecenzo chrisdecenzo commented Sep 2, 2022

Problem

Change overview

Testing

  • Tested on Android
  • Tested on linux tv-casting-app and tv-app

src/controller/AutoCommissioner.cpp Outdated Show resolved Hide resolved
src/controller/AutoCommissioner.h Outdated Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Outdated Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Outdated Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Outdated Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Outdated Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Outdated Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Outdated Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Outdated Show resolved Hide resolved
@bzbarsky-apple
Copy link
Contributor

@chrisdecenzo For what it's worth, I think the right approach here at this stage to reduce risk in terms of the DeviceCommissioner changes might be for whatever consumers want the Fabrics attribute info to:

  1. Use the EstablishPASEConnection API on ChipDeviceController to establish a PASE session, passing in a device id that will identify the commissioning process and the pairing code involved.
  2. In the OnPairingComplete callback, if it succeeds, FindCommissioneeDevice with the same device id, and use that to send a read for Fabrics.
  3. Do the sanity check for the fabric already existing. If it does, and the PASE session should just be closed, call StopPairing with the relevant device id.
  4. If the fabric does not already exist, call Commission on the DeviceCommissioner to commission the device.

While it might be good if the SDK provided more built-in support for doing this check, I think it's worth thinking a bit about how exactly that should work in a way that does not hurt the common commissioning case and does not change the default commissioning flow from the one that has been widely tested. (For example, maybe the Fabrics read should only happen in the actual error case when we get the FabricConflict status?)

@github-actions
Copy link

github-actions bot commented Sep 9, 2022

All PRs require an issue to be accepted, please link an issue or mention it in the body using #<issue_id>

@chrisdecenzo
Copy link
Contributor Author

I created #22525 to track work for making the already-on-fabric check happen by default (with a few suggestions for how best to do it).

@github-actions
Copy link

All PRs require an issue to be accepted, please link an issue or mention it in the body using #<issue_id>

@chrisdecenzo
Copy link
Contributor Author

Fixes #22419

@github-actions
Copy link

All PRs require an issue to be accepted, please link an issue or mention it in the body using #<issue_id>

@chrisdecenzo
Copy link
Contributor Author

Fixes #22419

@github-actions
Copy link

All PRs require an issue to be accepted, please link an issue or mention it in the body using #<issue_id>

src/controller/CHIPDeviceController.cpp Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Outdated Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Outdated Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Outdated Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Outdated Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Outdated Show resolved Hide resolved
src/controller/CommissioningDelegate.h Outdated Show resolved Hide resolved
@chrisdecenzo chrisdecenzo merged commit 88fa9ab into master Sep 14, 2022
@chrisdecenzo chrisdecenzo deleted the tvapps-android25 branch September 14, 2022 18:05
@@ -1997,7 +2055,8 @@ void DeviceCommissioner::PerformCommissioningStep(DeviceProxy * proxy, Commissio
app::InteractionModelEngine * engine = app::InteractionModelEngine::GetInstance();
app::ReadPrepareParams readParams(proxy->GetSecureSession().Value());

app::AttributePathParams readPaths[8];
// NOTE: this array cannot have more than 9 entries, since 9 is what the spec requires as a minimum on servers
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems off: this says the spec requires a minimum but we use 9 as the maximum.

This needs revision.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"client cannot send more than 9 since spec mandates 9 as minimum on the server side"

isiu-apple pushed a commit to isiu-apple/connectedhomeip that referenced this pull request Sep 16, 2022
…roject-chip#22369)

* Draft: address testing feedback from new opcert callbacks

* temporary workaround to isolate a memory corruption

* add check for existing fabric during commissioning, handle correctly on content app platform

* address comments

* address comments

* address comments

* Restyled by clang-format (project-chip#22524)

Co-authored-by: Restyled.io <[email protected]>

* address comments

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <[email protected]>
sharadb-amazon pushed a commit to sharadb-amazon/connectedhomeip that referenced this pull request Dec 21, 2022
…roject-chip#22369)

* Draft: address testing feedback from new opcert callbacks

* temporary workaround to isolate a memory corruption

* add check for existing fabric during commissioning, handle correctly on content app platform

* address comments

* address comments

* address comments

* Restyled by clang-format (project-chip#22524)

Co-authored-by: Restyled.io <[email protected]>

* address comments

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants