CNfcType1Connection Class Reference

#include <mw/nfctype1connection.h>

Link against: nfctagextension.lib

class CNfcType1Connection : public CActive, public MNfcConnection

Inherits from

Public Member Functions
~CNfcType1Connection()
virtual IMPORT_C TIntActivate(TInt)
virtual IMPORT_C voidCancelRawModeAccess()
virtual IMPORT_C TNfcConnectionInfo::TNfcConnectionModeConnectionMode()
virtual IMPORT_C voidDeactivate()
IMPORT_C TIntGetHeader(TDes8 &)
virtual IMPORT_C TBoolIsActivated()
IMPORT_C TIntIsWritable(const TInt, TBool &)
IMPORT_C TIntLockBlock(const TInt)
IMPORT_C CNfcType1Connection *NewL(RNfcServer &)
IMPORT_C CNfcType1Connection *NewLC(RNfcServer &)
virtual IMPORT_C voidRawModeAccess(TRequestStatus &, const TDesC8 &, TDes8 &, TTimeIntervalMicroSeconds32 &)
IMPORT_C voidRead(TRequestStatus &, TDes8 &, TUint, const TNfcType1Address &)
IMPORT_C voidReadCancel()
IMPORT_C voidReadOTP(TRequestStatus &, TDes8 &)
IMPORT_C voidWrite(TRequestStatus &, const TDesC8 &, const TNfcType1Address &)
IMPORT_C voidWriteCancel()
IMPORT_C voidWriteOTP(TRequestStatus &, const TDesC8 &)
Inherited Attributes
CActive::iStatus
Inherited Enumerations
CActive:TPriority
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::RunError(TInt)
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
MNfcConnection::~MNfcConnection()

Detailed Description

This class provides access to a NFC Forum Type 1 tag.

{nfctagextension.lib}

Since
S60 ?S60_version

Constructor & Destructor Documentation

~CNfcType1Connection ( )

IMPORT_C~CNfcType1Connection()

Destructor.

Member Function Documentation

Activate ( TInt )

IMPORT_C TIntActivate(TIntaHandle)[virtual]

Reimplemented from MNfcConnection::Activate(TInt)

See also: MNfcConnection

CancelRawModeAccess ( )

IMPORT_C voidCancelRawModeAccess()[virtual]

See also: MNfcConnection

ConnectionMode ( )

IMPORT_C TNfcConnectionInfo::TNfcConnectionModeConnectionMode()[virtual]

See also: MNfcConnection

Deactivate ( )

IMPORT_C voidDeactivate()[virtual]

Reimplemented from MNfcConnection::Deactivate()

See also: MNfcConnection

GetHeader ( TDes8 & )

IMPORT_C TIntGetHeader(TDes8 &aHeader)

Gets the 2 header ROM bytes.

Parameters
aHeaderDescriptor, which contains bytes of HR0 and HR1. The first byte of argument will be reserved for HR0 and the last byte will be reserved for HR1.

Return Values

KErrArgument aHeader size was too small.
KErrDisconnected No tag in field.
KErrNone The operation is successfully completed.
KErrServerTerminated Server connection is terminated.

IsActivated ( )

IMPORT_C TBoolIsActivated()[virtual]

See also: MNfcConnection

IsWritable ( const TInt, TBool & )

IMPORT_C TIntIsWritable(const TIntaBlockNumber,
TBool &aWritable
)

Checks whether a given block is writable. Currently no support for dynamic memory area.

Parameters
aBlockNumberBlocknumber to block which writable status will be checked.
aWritableReturn value. ETrue when the block is writable. EFalse The block is not writable.

Return Values

KErrDisconnected No tag in field.
KErrNone The operation is successfully completed.
KErrNotSupported aBlock parameter is invalid
KErrServerTerminated Server connection is terminated.

LockBlock ( const TInt )

IMPORT_C TIntLockBlock(const TIntaBlockNumber)

Locks a block. Currently no support for dynamic memory area.

Parameters
aBlockNumberNumber of a block which will be locked.

Return Values

KErrArgument aBlockNumber parameter is invalid.
KErrDisconnected No tag in field.
KErrNone The operation is successfully completed.
KErrNotSupported aBlockNumber parameter is invalid.
KErrServerTerminated Server connection is terminated.

NewL ( RNfcServer & )

IMPORT_C CNfcType1Connection *NewL(RNfcServer &aNfcServer)[static]

Creates a new instance of this class. May leave with one of the system wide error codes.

Parameters
aNfcServerReference to NFC Server.
Return Value
Pointer to the newly created instance.

NewLC ( RNfcServer & )

IMPORT_C CNfcType1Connection *NewLC(RNfcServer &aNfcServer)[static]

Creates a new instance of this class. May leave with one of the system wide error codes.

Parameters
aNfcServerReference to NFC Server.
Return Value
Pointer to the newly created instance.

RawModeAccess ( TRequestStatus &, const TDesC8 &, TDes8 &, TTimeIntervalMicroSeconds32 & )

IMPORT_C voidRawModeAccess(TRequestStatus &aStatus,
const TDesC8 &aCommand,
TDes8 &aResponse,
TTimeIntervalMicroSeconds32 &aTimeout
)[virtual]

See also: MNfcConnection

Read ( TRequestStatus &, TDes8 &, TUint, const TNfcType1Address & )

IMPORT_C voidRead(TRequestStatus &aStatus,
TDes8 &aBuffer,
TUintaAmount,
const TNfcType1Address &aAddress
)

Reads data from the target NFC Forum Type 1 tag.

Only one write/read command can be requested at a time.

Parameters
aStatusThe client's request status.
aBufferDescriptor for data.
aAmountLength of data to be read.
aAddressAddress where the read operation will start.
Return Value
Return values for aStatus:

Return Values

KErrArgument aBuffer size was too small.
KErrDisconnected No tag in field.
KErrInUse The request is issued before the previous one is completed.
KErrNone The operation is successfully completed.
KErrServerTerminated Server connection is terminated.

ReadCancel ( )

IMPORT_C voidReadCancel()

Cancels any read request.

ReadOTP ( TRequestStatus &, TDes8 & )

IMPORT_C voidReadOTP(TRequestStatus &aStatus,
TDes8 &aBuffer
)

Reads the Type1's OTP bits and return them in a byte array containing the 6 OTP bytes in the following order: OTP0, OTP1, OTP2, OTP3, OTP4, OTP5.

Only one write/read command can be requested at a time.

Parameters
aStatusThe client's request status.
aBufferDescriptor where read data is written to.
Return Value
Return values for aStatus:

Return Values

KErrArgument aBuffer size was too small.
KErrDisconnected No tag in field.
KErrInUse The request is issued before the previous one is completed.
KErrNone The operation is successfully completed.
KErrServerTerminated Server connection is terminated.
KErrServerTerminated The server connection is terminated.

Write ( TRequestStatus &, const TDesC8 &, const TNfcType1Address & )

IMPORT_C voidWrite(TRequestStatus &aStatus,
const TDesC8 &aBuffer,
const TNfcType1Address &aAddress
)

Writes data to the target NFC Forum Type 1 tag. Only one write/read command can be requested at a time.

Parameters
aStatusThe client's request status.
aBufferDescriptor which contains data to be written.
aAddressThe address where the write operation will start. See NFC Forum Type 1 specification for restrictions.
Return Value
Return values for aStatus:

Return Values

KErrArgument Writing failed due to tag type specific restrictions
KErrDisconnected No tag in field. Or block is locked and cannot be written.
KErrInUse The request is issued before the previous one is completed.
KErrNone The operation is successfully completed.
KErrServerTerminated Server connection is terminated.

WriteCancel ( )

IMPORT_C voidWriteCancel()

Cancels any write request.

WriteOTP ( TRequestStatus &, const TDesC8 & )

IMPORT_C voidWriteOTP(TRequestStatus &aStatus,
const TDesC8 &aOtpArray
)

Writes the OTP bytes.

Only one write/read command can be requested at a time.

Parameters
aStatusThe client's request status.
aOtpArrayThe byte array containing OTP bits in 6 bytes in the following order: OTP0, OTP1, ... , OTP5
Return Value
Return values for aStatus:

Return Values

KErrArgument Writing failed due to tag type specific restrictions
KErrDisconnected No tag in field.
KErrInUse The request is issued before the previous one is completed.
KErrNone The operation is successfully completed.
KErrServerTerminated Server connection is terminated.