MNfcTag Class Reference

#include <mw/nfctag.h>

Link against: nfcdiscoveryservice.lib

class MNfcTag
Public Member Functions
virtual ~MNfcTag()
pure virtual voidCloseConnection(MNfcConnection &)
pure virtual TInt GetConnectionModes(RArray< TNfcConnectionInfo::TNfcConnectionMode > &)
pure virtual TBool HasConnectionMode(const TNfcConnectionInfo::TNfcConnectionMode &)
pure virtual TBool IsInNearField()
pure virtual TInt OpenConnection(MNfcConnection &)
pure virtual const TDesC8 &Uid()

Detailed Description

This interface provides access to discovered contactless tag. Via this interface client can open different connection modes to the tag.

Constructor & Destructor Documentation

~MNfcTag ( )

~MNfcTag()[inline, virtual]

Empty destructor.

Member Function Documentation

CloseConnection ( MNfcConnection & )

voidCloseConnection(MNfcConnection &aNfcConnection)[pure virtual]

Closes given NFC connection object.

GetConnectionModes ( RArray< TNfcConnectionInfo::TNfcConnectionMode > & )

TInt GetConnectionModes(RArray< TNfcConnectionInfo::TNfcConnectionMode > &aArray)const [pure virtual]

Returns all supported connection modes.

ParameterDescription
aArrayArray for connection modes

Returns: System wide error code

HasConnectionMode ( const TNfcConnectionInfo::TNfcConnectionMode & )

TBool HasConnectionMode(const TNfcConnectionInfo::TNfcConnectionMode &aMode)const [pure virtual]

Checks whether detected tag has specified connection mode or not.

ParameterDescription
aModeConnection mode

Return Values

EFalse Discovered tag doesn't support specified connection mode
ETrue Discovered tag supports specified connection mode

IsInNearField ( )

TBool IsInNearField()const [pure virtual]

Checks whether discovered tag is in near field or not.

Return Values

EFalse Tag is not in the near field
ETrue Tag is in near field

OpenConnection ( MNfcConnection & )

TInt OpenConnection(MNfcConnection &aNfcConnection)[pure virtual]

Opens a new connection to target tag. Only one connection can be opened to target tag at a time.

ParameterDescription
aNfcConnectionConnection to be opened

Return Values

KErrInUse Connection mode to the tag is already open
KErrNone Connection mode is successfully opened
KErrNotSupported Connection to the tag is not supported

Uid ( )

const TDesC8 &Uid()const [pure virtual]

Gets UID of detected tag.

Note:

Zero length descriptor is returned when tag is not in the near field.

Returns: UID of detected tag