Skip to content

Adding nfc-wifi to the backend rebased to V2.15-develop#294

Open
ArnoldBraine wants to merge 8 commits intoproject-chip:v2.15-developfrom
ArnoldBraine:nfc-wifi-work
Open

Adding nfc-wifi to the backend rebased to V2.15-develop#294
ArnoldBraine wants to merge 8 commits intoproject-chip:v2.15-developfrom
ArnoldBraine:nfc-wifi-work

Conversation

@ArnoldBraine
Copy link

Summary

Adding support for nfc-wifi rebased to V2.15-develop using the reference pull requests from @OlivierGre

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ArnoldBraine, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces comprehensive support for a new NFC-WIFI device pairing mode across the backend system. The changes involve updating core constants, modifying setup procedures to accommodate NFC-specific hardware interactions, and extending utility functions to handle WiFi network credentials for this new mode. Additionally, the YAML test runner has been enhanced with a dedicated method for NFC-WIFI pairing, accompanied by new test cases to ensure the functionality is correctly implemented and validated.

Highlights

  • New Pairing Mode: Introduced a new NFC_WIFI pairing mode to the DutPairingModeEnum in shared_constants.py, expanding the supported device commissioning methods.
  • PCSC Reader Handling: Updated the setup logic in test_suite.py and chip_suite.py to disable the pcscd daemon when NFC_WIFI pairing mode is active, similar to NFC_THREAD, indicating its reliance on PCSC readers.
  • WiFi Credential Integration: Extended the generate_command_arguments utility in utils.py to correctly pass WiFi SSID and passphrase arguments for NFC_WIFI pairing, ensuring proper network configuration.
  • YAML Runner Support: Added a new pairing_nfc_wifi method to the MatterYAMLRunner in matter_yaml_runner.py and integrated its call within chip_suite.py to orchestrate the NFC-WIFI pairing flow.
  • New Test Cases: Included a new test test_generate_command_arguments_nfc_wifi in test_utils.py to validate the correct generation of command-line arguments for the new NFC-WIFI pairing mode.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • app/constants/shared_constants.py
    • Added 'NFC_WIFI' as a new member to the DutPairingModeEnum.
  • test_collections/matter/sdk_tests/support/python_testing/models/test_suite.py
    • Modified the setup method to include DutPairingModeEnum.NFC_WIFI in the condition for disabling the pcscd daemon.
  • test_collections/matter/sdk_tests/support/python_testing/models/utils.py
    • Updated generate_command_arguments to append WiFi SSID and passphrase for NFC_WIFI pairing mode.
  • test_collections/matter/sdk_tests/support/tests/python_tests/test_utils.py
    • Added test_generate_command_arguments_nfc_wifi to verify command argument generation for NFC-WIFI pairing.
  • test_collections/matter/sdk_tests/support/yaml_tests/matter_yaml_runner.py
    • Defined PAIRING_MODE_NFC_WIFI constant.
    • Implemented the pairing_nfc_wifi asynchronous method to handle NFC-WIFI pairing commands.
  • test_collections/matter/sdk_tests/support/yaml_tests/models/chip_suite.py
    • Modified the setup method to disable pcscd for NFC_WIFI pairing mode.
    • Updated __pair_with_dut to include a branch for DutPairingModeEnum.NFC_WIFI.
    • Added __pair_with_dut_nfc_wifi method to encapsulate the specific logic for NFC-WIFI device pairing.
Activity
  • No specific activity (comments, reviews, etc.) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully adds support for the nfc-wifi pairing mode. The changes are consistent with the existing codebase, and it's great to see that new tests have been added to cover this new functionality. My review includes a few suggestions to improve code readability and reduce duplication. Specifically, I've recommended using the in operator for membership testing and pointed out opportunities to use pytest.mark.parametrize to consolidate similar test cases, which will enhance maintainability.

] == arguments

@pytest.mark.asyncio
async def test_generate_command_arguments_nfc_wifi() -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This new test, test_generate_command_arguments_nfc_wifi, is nearly identical to the existing test_generate_command_arguments_ble_wifi. To avoid code duplication and improve maintainability, I recommend using pytest.mark.parametrize to combine these into a single parameterized test. This would make it easier to add and test other Wi-Fi based pairing modes in the future.

chip_server._ChipServer__node_id = None

@pytest.mark.asyncio
async def test_pairing_nfc_wifi_command_params() -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The new test test_pairing_nfc_wifi_command_params is very similar to test_pairing_ble_wifi_command_params. To reduce code duplication and make the test suite more maintainable, consider using pytest.mark.parametrize to create a single, parameterized test function that can handle various Wi-Fi pairing modes.

discriminator=self.config_matter.dut_config.discriminator,
)

async def __pair_with_dut_nfc_wifi(self) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The new method __pair_with_dut_nfc_wifi is almost identical to __pair_with_dut_ble_wifi and __pair_with_dut_wifipaf_wifi. This introduces significant code duplication. To improve maintainability, consider refactoring these into a single private helper method that accepts the specific pairing function (e.g., self.runner.pairing_nfc_wifi) as an argument. This would centralize the logic for Wi-Fi pairing.

Copy link
Contributor

@OlivierGre OlivierGre left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@rquidute rquidute left a comment

Choose a reason for hiding this comment

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

Please address the code review comment and update the User Guide accordingly.

@ArnoldBraine
Copy link
Author

Please address the code review comment and update the User Guide accordingly.

I have updated the code according to the review, and with User Guide you are referring to the certfication-tool documentation right?

@ArnoldBraine ArnoldBraine requested a review from rquidute February 6, 2026 10:00
@rquidute
Copy link
Contributor

rquidute commented Feb 6, 2026

Please address the code review comment and update the User Guide accordingly.

I have updated the code according to the review, and with User Guide you are referring to the certfication-tool documentation right?

Exactly @ArnoldBraine

@rquidute
Copy link
Contributor

rquidute commented Feb 9, 2026

Hi @ArnoldBraine It seems there are some comments from gemini-code-assist still not addressed, also a rebase is required. Could you please take a look?

@ArnoldBraine
Copy link
Author

Hi @ArnoldBraine It seems there are some comments from gemini-code-assist still not addressed, also a rebase is required. Could you please take a look?

Hi @rquidute,

  1. I feel like the open comments from Gemini are more generic refactoring updates that needs to be taken into account for updating the whole test framework for extensibility, rather than being comments directed towards my pull request. I can do the updates for my PR but that means it is out of sync, with the older functions inside the file.

  2. To which branch does the rebase need to happen? or do I just pull in the changes from the v2.15-develop branch?

@rquidute
Copy link
Contributor

Hi @ArnoldBraine It seems there are some comments from gemini-code-assist still not addressed, also a rebase is required. Could you please take a look?

Hi @rquidute,

  1. I feel like the open comments from Gemini are more generic refactoring updates that needs to be taken into account for updating the whole test framework for extensibility, rather than being comments directed towards my pull request. I can do the updates for my PR but that means it is out of sync, with the older functions inside the file.
  2. To which branch does the rebase need to happen? or do I just pull in the changes from the v2.15-develop branch?

Hi @ArnoldBraine
please just resolve the conflicts and the PR will be ready for merging

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.

6 participants