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

esp_matter_controller pairing queries (CON-1420) #1158

Open
pavel808 opened this issue Nov 18, 2024 · 4 comments
Open

esp_matter_controller pairing queries (CON-1420) #1158

pavel808 opened this issue Nov 18, 2024 · 4 comments

Comments

@pavel808
Copy link

I am using the new pairing_code_thread() API which works well. I have two questions :

  1. How do I assign a callback to get the commissioning status (success or fail) when calling that particular pairing_code_thread() function? I see that there is a pairing_command class which can be used to assign callbacks when an object is created, but doesn't yet have parameters for working with pairing codes or QR codes.

My guess is that this is still under development?

  1. Is there a n API implemented for unpairing / de-commissioning a device yet?

Thank you in advance.

@github-actions github-actions bot changed the title esp_matter_controller pairing queries esp_matter_controller pairing queries (CON-1420) Nov 18, 2024
@wqx6
Copy link
Contributor

wqx6 commented Nov 19, 2024

Hi, there are some callbacks in the pairing_command class to notify whether the pairing and commissioning are successful/failed. When the PASE session is established or when there is an error during PASE session establishment the OnPairingComplete will be called. When the commissioning is completed, OnCommissioningComplete will be called. but currently there are still some callbacks not implemented and we still need some APIs for the users to set their custom callbacks. We will add them later

For the second question, you can use controller_instance.get_commissioner()->UnpairDevice(peerNodeId) to unpair a device. The commissioner will remove the fabric of the remote device in that function.

@pavel808
Copy link
Author

pavel808 commented Nov 20, 2024

Hi, there are some callbacks in the pairing_command class to notify whether the pairing and commissioning are successful/failed. When the PASE session is established or when there is an error during PASE session establishment the OnPairingComplete will be called. When the commissioning is completed, OnCommissioningComplete will be called. but currently there are still some callbacks not implemented and we still need some APIs for the users to set their custom callbacks. We will add them later

For the second question, you can use controller_instance.get_commissioner()->UnpairDevice(peerNodeId) to unpair a device. The commissioner will remove the fabric of the remote device in that function.

@wqx6 Thanks again. Currently I am not creating a pairing_command object and just calling the pairing_code_thread() function which is not part of the pairing_command class.

I guess the pairing_command class has yet to be updated to have a pairing code / QR code field ?

Alternatively, can I still create a pairing_command object anyways, but call the pairing_code_thread() function separately and still have the callbacks updated as expected?

@wqx6
Copy link
Contributor

wqx6 commented Dec 18, 2024

@pavel808 Hi, we have supported setting callbacks for pairing commands. You can call pairing_command::get_instance().set_callbacks() before using pairing_code_thread(). Note that the pairing_command is a singleton, so you cannot create another object for it. The pairing_command class only acts as the delegate for device discovery and device pairing, so it will not maintain fields for code / QR code.

@pavel808
Copy link
Author

@wqx6 Perfect. Great timing. Thanks.

What about for decommissioning / unpairing ? Currently I just call get_commissioner()->UnpairDevice() without any notifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants