Skip to content

Conversation

@tomasmcguinness
Copy link
Contributor

@tomasmcguinness tomasmcguinness commented Dec 4, 2025

Description

Fixed #1605

This PR adds two new optional callbacks, which are invoked in response to the unpair_device function in the pairing_command

// Callback for the success of unpairing
void (*unpair_success_callback)(NodeId removed_node);
// Callback for the failure of unpairing
void (*unpair_failure_callback)(NodeId removed_node, CHIP_ERROR error);

Related

Testing

To test, I implemented the callback and performed an unpair_device operation. The logs show that the success case was handled.

image

When unpairing a node that doesn't exist, the on_unpair_failure_callback is also invoked successfully.

image

Checklist

Before submitting a Pull Request, please ensure the following:

  • [*] 🚨 This PR does not introduce breaking changes.
  • [*] All CI checks (GH Actions) pass.
  • [*] Documentation is updated as needed.
  • [*] Tests are updated or added as necessary.
  • [*] Code is well-commented, especially in complex areas.
  • [*] Git history is clean — commits are squashed to the minimum necessary.

@github-actions github-actions bot changed the title Add callback for unpair_device Add callback for unpair_device (CON-1879) Dec 4, 2025
@wqx6
Copy link
Contributor

wqx6 commented Dec 11, 2025

May we add the unpair callback to the pairing_command_callbacks_t struct so that we can set the callbacks uniformly?

@tomasmcguinness
Copy link
Contributor Author

tomasmcguinness commented Dec 11, 2025

May we add the unpair callback to the pairing_command_callbacks_t struct so that we can set the callbacks uniformly?

I took another look and found how to make it work with the existing callbacks.

I've updated the PR description.

This is a much neater solution. Thx.

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

Successfully merging this pull request may close these issues.

No callback available for the unpair_device command (CON-1878)

2 participants