# Copyright (c) 2021 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default

name:
    3.1.10. [TC-DD-1.10] NFC Onboarding Payload Verification [DUT -
    Commissioner]

PICS:
    - MCORE.ROLE.COMMISSIONER
    - MCORE.DD.SCAN_NFC

config:
    nodeId: 0x12344321
    cluster: "Basic Information"
    endpoint: 0

tests:
    - label: "Note"
      verification: |
          Chip-tool command used below are an example to verify the DUT as commissioner test cases. For certification test, we expect DUT should have a capability or way to run the equivalent command.
      disabled: true

    - label: "Precondition"
      verification: |
          1 - 5.1.8 - NFC tag follows guidelines set in section 5.1.8 of spec.

          An example onboarding payload could be "MT:-24J029Q00KA0648G00" (following Table 34 "Packed Binary Data Structure for Onboarding Payload") which includes:

          - 3-bit Version String=000

          - 16-bit Vendor ID=0xFFF1 (as defined in section 2.5.2. "Vendor Identifier")

          - 16-bit Product ID=0x8001 (as defined in section 2.5.3. "Product Identifier")

          - 2-bit Custom Flow=10 (Custom Commissioning Flow = 2)

          - 8-bit Discovery Capabilities Bitmask=00000100 (OnNetwork)

          - 12-bit Discriminator=0xF00

          - 27-bit Passcode=20202021

          - 4-bit Padding=0000

          - no variable-length TLV Data included (as defined in section 5.1.3.1. "Payload", subsection "TLV Data")
      disabled: true

    - label:
          "Step 1: Power up the TH Device and put the TH Device in commissioning
          mode"
      verification: |
          1. Launch TH that has NFC tag
           ./chip-all-clusters-app
          ...
          [1646286638.375844][11651:11651] CHIP:DL: Device Configuration:
          [1646286638.375960][11651:11651] CHIP:DL:   Serial Number: TEST_SN
          [1646286638.376016][11651:11651] CHIP:DL:   Vendor Id: 65521 (0xFFF1)
          [1646286638.376066][11651:11651] CHIP:DL:   Product Id: 32769 (0x8001)
          [1646286638.376153][11651:11651] CHIP:DL:   Hardware Version: 0
          [1646286638.377458][11651:11651] CHIP:DL:   Setup Pin Code: 20202021
          [1646286638.377541][11651:11651] CHIP:DL:   Setup Discriminator: 3840 (0xF00)
          [1646286638.377611][11651:11651] CHIP:DL:   Manufacturing Date: (not set)
          [1646286638.377664][11651:11651] CHIP:DL:   Device Type: 65535 (0xFFFF)
          [1646286638.377771][11651:11651] CHIP:SVR: SetupQRCode: [MT:-24J042C00KA0648G00]
          [1646286638.377865][11651:11651] CHIP:SVR: Copy/paste the below URL in a browser to see the QR Code:
          [1646286638.377915][11651:11651] CHIP:SVR: https://dhrishi.github.io/connectedhomeip/qrcode.html?data=MT%3A-24J042C00KA0648G00
          [1646286638.377986][11651:11651] CHIP:SVR: Manual pairing code: [34970112332]
          [1646286638.378089][11651:11651] CHIP:SVR: Long manual pairing code: [749701123365521327694]
      disabled: true

    - label: "Step 2: Bring the DUT close to the NFC tag for the TH Device"
      verification: |
          Vendor specific field testcase as chip-all-clusters-app does not have an NFC tag to scan
      disabled: true
