NFC

Introduction

Near-field communication (NFC) is a non-contact identification and interconnection technology for short-distance wireless communication between mobile devices, consumer electronic products, PCs, and smart devices.

NFC service provides NFC switch control, NFC tag discovery and dispatch, NFC tag reading and writing, NFC card emulation functions.

Architecture

Figure 1 NFC architecture

Directory Structure

/foundation/communication/nfc
├── interfaces                        # Interface
│   └── inner_api                     # System inner interface
├── frameworks                        # Framework interface
│   └── js                            # Implementation of JS API
│       └── napi                      # Napi implementation of JS API
├── services                          # Service implementation
├── test                              # Test code
├── BUILD.gn                          # Build entry
└── bundle.json                       # Component description

Constraints

  • The device must have an NFC controller chip to use NFC services.

Usage

  • NFC switch

Please reference: docs/zh-cn/application-dev/reference/apis/js-apis-nfcController.md。

  • NFC tag reading and writing

Please reference: docs/zh-cn/application-dev/reference/apis/js-apis-nfcTag.md。

  • NFC card emulation

Please reference: docs/zh-cn/application-dev/reference/apis/js-apis-cardEmulation.md。

Repositories Involved

hmf/communication/nfc