Lines Matching refs:NFC

1 # @ohos.nfc.controller (Standard NFC)
3 …ule provides APIs for opening and closing Near-Field Communication (NFC) and reading the NFC state.
17 Enumerates the NFC states.
19 **System capability**: SystemCapability.Communication.NFC.Core
25 | STATE_OFF | 1 | NFC is closed (OFF).|
26 | STATE_TURNING_ON | 2 | NFC is turning on.|
27 | STATE_ON | 3 | NFC is open (ON).|
28 | STATE_TURNING_OFF | 4 | NFC is turning off.|
34 Checks whether the device supports NFC.
37 …precated since API version 9. Use [canIUse("SystemCapability.Communication.NFC.Core")](../common/i…
39 **System capability**: SystemCapability.Communication.NFC.Core
45 | boolean | Returns **true** if the device supports NFC; returns **false** otherwise.|
52 Opens NFC.
59 **System capability**: SystemCapability.Communication.NFC.Core
71 Enables NFC. This API can be called only by system applications.
75 **System capability**: SystemCapability.Communication.NFC.Core
79 For details about the error codes, see [NFC Error Codes](errorcode-nfc.md).
85 | 3100101 | NFC state is abnormal in service. |
91 Closes NFC.
98 **System capability**: SystemCapability.Communication.NFC.Core
110 Disables NFC. This API can be called only by system applications.
114 **System capability**: SystemCapability.Communication.NFC.Core
118 For details about the error codes, see [NFC Error Codes](errorcode-nfc.md).
124 | 3100101 | NFC state is abnormal in service. |
130 Checks whether NFC is open.
132 **System capability**: SystemCapability.Communication.NFC.Core
140 | boolean | Returns **true** if NFC is open; returns **false** otherwise.|
146 Obtains the NFC state.
148 **System capability**: SystemCapability.Communication.NFC.Core
156 | [NfcState](#nfcstate) | NFC state obtained. For details, see [NfcState](#nfcstate).|
162 Subscribes to NFC state changes. A callback will be invoked to return the NFC state when the NFC st…
164 **System capability**: SystemCapability.Communication.NFC.Core
173 | callback | Callback<[NfcState](#nfcstate)> | Yes| Callback used to return the NFC state.|
179 Unsubscribes from the NFC state changes. The subscriber will not receive NFC state change notificat…
181 **System capability**: SystemCapability.Communication.NFC.Core
190 | callback | Callback<[NfcState](#nfcstate)> | No| Callback for the NFC state changes. This p…
197 // Register a callback to receive the NFC state change notification.
202 // Open NFC. The caller must have the ohos.permission.MANAGE_SECURE_SETTINGS permission. This permi…
204 // Use 'enableNfc' to enable NFC since API version 9.
212 console.log("nfcController NFC has been opened");
215 // Close NFC. The caller must have the ohos.permission.MANAGE_SECURE_SETTINGS permission. This perm…
217 // Use 'disableNfc' to disable NFC since API version 9.
225 console.log("nfcController NFC has been closed");