-
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
Add DeviceController::PairDevice(NodeId remoteId, const char * setupCode) API that looks for the device over supported networks resolves #9343 #9847
Conversation
General comment - in the python controller, this is handled for QR by having the python layer parse the code, discover, then connect. I'm not sure bunching all this together in the SetupParser is the correct place for this. To me, SetupParser seems like it should be exclusively for parsing the setup code - that way it's contained and testable. This all seems like it should be implemented a layer up in a convenience function layer where we put all the steps together for those that wish to do that. |
a158dd0
to
676adf0
Compare
I have renamed the class so (I hope) it is a bit clearer. The idea behind having a separate class is to be able to add more logic to it without having to pollute the I understand that the python controller parses the QR code manually before using those informations. The issue is that this is also done (before this PR) inside |
Fixes #9343 |
676adf0
to
857f421
Compare
857f421
to
e6186fe
Compare
Problem
As of today,
CHIPDeviceController::PairDevice
API requires the user to pass the ip, port and interfaceId of the device to connect to.This PR introduce an additional API, that takes a
const char * setupCode
and search over supported networks for a device (currently BLE/IP).The current
CHIPDeviceController
is already complex, and I would expect the new code to grow as more edge cases are coming in. As a result I have added a separate class for the mentioned work.As a separate issue I think it will be helpful to spend some times on how the mdns records are retrieved. Currently
AbstractMdnsDiscoveryController
is used to look over the network for commissionable nodes. It is not very practical because under the hood, there is a “Browse” operation which ends up beeing broken into multiples “Resolve”.AbstractMdnsDiscoveryController
does not have a way to know when the multiple resolves are done for a single browse, and so there is no easy way for the user of the API to know when it is time to retrieve commissionable nodes results.Change overview
src/platform/Darwin/MdnsImpl.cpp
to support browsing for subtypessrc/setup_payload/
headers to use#pragma once
since that’s missing and it was causing conflicts…chip::Controller::SetUpCodeParser
which parses a setup code and extract the relevantrendezvousInformation
in order to search for the target peripheralchip-tool
to have a few additional commands for browsing mdnschip-tool
pairing qrcode
andpairing manualcode
APIs to use the newSetupCodeParser::PairDevice
interfaceTesting
scripts/tests/test_suites.sh
has been changed so it uses the new API in order to find which device it needs to connect to. This should exercise the API, as well as theminimal
and Darwin mdns backends.