to top
Datalogic APIs
public class

NfcManager

extends Object
java.lang.Object
   ↳ com.datalogic.device.nfc.NfcManager

Class Overview

This class provides access to enable and disable the nfc adapter

Summary

Public Constructors
NfcManager()
This is the constructor of NfcManager.
Public Methods
int enableNfcAdapter(boolean enable)
This method was deprecated in revision 50. use setNfcAdapterEnabled(boolean) instead.
boolean getHostCardEmulationEnabled()
Get the current state of the Host Card Emulation (HCE) functionality of the NFC adapter.
int getHostListenerTechMask()
Get the NFC technology flags that the system should listen to.
boolean getNfcAdapterEnabled()
Get the current state of the NFC adapter.
int getTagDispatchBlockFlags()
Get the current NFC categories flags that the system is blocking.
int setHostCardEmulationEnabled(boolean enable)
Enable the Host Card Emulation (HCE) functionality of the NFC adapter.
int setHostListenerTechMask(int flags)
Set the NFC technology flags that the system should listen to.
int setNfcAdapterEnabled(boolean enable)
Enable the NFC adapter.
int setTagDispatchBlockFlags(int flags)
Set the NFC categories flags that the system should block.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public NfcManager ()

Added in revision 1

This is the constructor of NfcManager.

Throws
DeviceException in case of error.

Public Methods

public int enableNfcAdapter (boolean enable)

Added in revision 1

This method was deprecated in revision 50.
use setNfcAdapterEnabled(boolean) instead.

public boolean getHostCardEmulationEnabled ()

Added in revision 50

Get the current state of the Host Card Emulation (HCE) functionality of the NFC adapter.

Returns
  • boolean indicating whether the HCE functionality of the NFC adapter is enabled or not.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int getHostListenerTechMask ()

Added in revision 50

Get the NFC technology flags that the system should listen to.

Returns
  • int indicating the NFC categories that the system is listening to, matching one or more of the NfcHostListenerTechFlags constants. May return -1 in case of error.

public boolean getNfcAdapterEnabled ()

Added in revision 50

Get the current state of the NFC adapter.

Returns
  • boolean indicating whether the NFC adapter is enabled or not.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int getTagDispatchBlockFlags ()

Added in revision 50

Get the current NFC categories flags that the system is blocking.

Returns
  • int indicating the NFC categories that the system is blocking, matching one or more of the NfcTagDispatchBlockFlags constants. May return -1 in case of error.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int setHostCardEmulationEnabled (boolean enable)

Added in revision 50

Enable the Host Card Emulation (HCE) functionality of the NFC adapter.

Parameters
enable a boolean that indicates whether to enable or to disable the HCE functionality.
Returns
  • int SUCCESS in case of success, otherwise a possible error code, matching one of the DeviceException error constants.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int setHostListenerTechMask (int flags)

Added in revision 50

Set the NFC technology flags that the system should listen to.

Parameters
flags a int of flags representing the NFC protocol type to enable, matching one or more of the NfcHostListenerTechFlags constants.
Returns
  • int SUCCESS in case of success, otherwise a possible error code, matching one of the DeviceException error constants.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int setNfcAdapterEnabled (boolean enable)

Added in revision 50

Enable the NFC adapter.

Parameters
enable a boolean that indicates whether to enable or to disable the nfc adapter.
Returns
  • int SUCCESS in case of success, otherwise a possible error code, matching one of the DeviceException error constants.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int setTagDispatchBlockFlags (int flags)

Added in revision 50

Set the NFC categories flags that the system should block.

Parameters
flags a int of flags representing the NFC categories to block, matching one or more of the NfcTagDispatchBlockFlags constants.
Returns
  • int SUCCESS in case of success, otherwise a possible error code, matching one of the DeviceException error constants.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.