SLOA192B April   2014  – March 2019 TRF7970A , TRF7970A

 

  1.   NFC active and passive peer-to-peer communication using the TRF7970A
    1.     Trademarks
    2. 1  Introduction
    3. 2  Initial RF Collision
    4. 3  TRF7970A Register Settings
    5. 4  Peer-to-Peer at 106 kbps
      1. 4.1 Active Communication
        1. 4.1.1 Initiator
        2. 4.1.2 Target
      2. 4.2 Passive Communication
        1. 4.2.1 Initiator
        2. 4.2.2 Target
    6. 5  Peer-to-Peer at 212 kbps and 424 kbps
      1. 5.1 Active Communication
        1. 5.1.1 Initiator
        2. 5.1.2 Target
      2. 5.2 Passive Communication
        1. 5.2.1 Initiator
        2. 5.2.2 Target
    7. 6  Hardware Description
      1. 6.1 LaunchPad™ Development Kit and BoosterPack™ Plug-in Module Setup
        1. 6.1.1 BoosterPack Plug-in Module: DLP-7970ABP
        2. 6.1.2 LaunchPad Development Kit: MSP-EXP430F5529LP
        3. 6.1.3 LaunchPad Development Kit: MSP-EXP432P401R
      2. 6.2 Bundle Available for Purchase
    8. 7  Passive and Active Peer-to-Peer Firmware Example
      1. 7.1 Peer-to-Peer APIs
      2. 7.2 Implementing a Peer-to-Peer Sample Application
        1. 7.2.1 Low-Level Initialization
        2. 7.2.2 Peer-to-Peer NFC Stack Setup
        3. 7.2.3 Sending NDEF Packets
        4. 7.2.4 Receiving NDEF Packets
    9. 8  Quick Start Guide
    10. 9  Operational Overview
    11. 10 Peer-to-Peer Interoperability Results
    12. 11 Conclusion
    13. 12 References
  2.   Revision History

Receiving NDEF Packets

The NFC_run function switches between target and initiator until an NFC-enabled device is presented to the TRF7970A RF field. Once the peer-to-peer communication is established and eTempNFCState is NFC_DATA_EXCHANGE_PROTOCOL, the firmware checks the RX status with NFC_P2P_getReceiveState() . When a packet is received, the sP2PRxStatus.sDataReceivedStatus will be RECEIVED_FIRST_FRAGMENT, or RECEIVED_N_FRAGMENT, or RECEIVED_FRAGMENT_COMPLETED. When the first fragment is received from another NFC device if the packet is incomplete, the sP2PRxStatus.sDataReceivedStatus will be RECEIVED_FIRST_FRAGMENT. When the first fragment is received from another NFC device if the packet is complete, the sP2PRxStatus.sDataReceivedStatus will be RECEIVED_FRAGMENT_COMPLETED. When the packet is broken into multiple fragments due to the total size being larger than the SNEP queue the sP2PRxStatus.sDataReceivedStatus will be RECEIVED_N_FRAGMENT until the last fragment is received. When the last fragment is received, the sP2PRxStatus.sDataReceivedStatus will be RECEIVED_FRAGMENT_COMPLETED.

eTempNFCState = NFC_run(); if(eTempNFCState == NFC_DATA_EXCHANGE_PROTOCOL) { else if(NFC_P2P_getModeStatus(&sP2PMode,&sP2PBitrate)) { // // Read the receive status structure - check if there is a received packet from the Target // sP2PRxStatus = NFC_P2P_getReceiveState(); if(sP2PRxStatus.sDataReceivedStatus != RECEIVED_NO_FRAGMENT) { ui16BytesReceived = sP2PRxStatus.ui16DataReceivedLength + ui16BytesReceived; // Check if the last packet was received completely if((uint16_t) sP2PRxStatus.ui32PacketSize == ui16BytesReceived) { // Reset Bytes received ui16BytesReceived = 0; } } } }