CMifareClassicConnection Class Reference

#include <mw/mifareclassicconnection.h>

class CMifareClassicConnection : public CActive, public MNfcConnection

Inherits from

Public Member Functions
~CMifareClassicConnection()
virtual IMPORT_C TIntActivate(TInt)
virtual IMPORT_C voidCancelRawModeAccess()
virtual IMPORT_C TNfcConnectionInfo::TNfcConnectionModeConnectionMode()
virtual IMPORT_C voidDeactivate()
IMPORT_C TIntDecrement(TUint8, TUint8, TUint32, const TDesC8 &, const TDesC8 &)
IMPORT_C TIntIncrement(TUint8, TUint8, TUint32, const TDesC8 &, const TDesC8 &)
virtual IMPORT_C TBoolIsActivated()
IMPORT_C CMifareClassicConnection *NewL(RNfcServer &)
IMPORT_C CMifareClassicConnection *NewLC(RNfcServer &)
virtual IMPORT_C voidRawModeAccess(TRequestStatus &, const TDesC8 &, TDes8 &, TTimeIntervalMicroSeconds32 &)
IMPORT_C voidReadCancel()
IMPORT_C voidReadDataBlock(TRequestStatus &, MMifareClassicBlock &, TUint8, TUint8, const TDesC8 &, const TDesC8 &)
IMPORT_C voidReadSector(TRequestStatus &, CMifareClassicSector &, TUint8, const TDesC8 &, const TDesC8 &)
IMPORT_C TIntRestore(TUint8, TUint8, const TDesC8 &, const TDesC8 &)
IMPORT_C TIntTransfer(TUint8, TUint8, const TDesC8 &, const TDesC8 &)
IMPORT_C voidWriteCancel()
IMPORT_C voidWriteDataBlock(TRequestStatus &, const MMifareClassicBlock &, TUint8, TUint8, const TDesC8 &, const TDesC8 &)
IMPORT_C voidWriteSector(TRequestStatus &, const CMifareClassicSector &, TUint8, const TDesC8 &, 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 Mifare classic tag.

{nfctagextension.lib}

Constructor & Destructor Documentation

~CMifareClassicConnection ( )

IMPORT_C~CMifareClassicConnection()

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

Decrement ( TUint8, TUint8, TUint32, const TDesC8 &, const TDesC8 & )

IMPORT_C TIntDecrement(TUint8aSector,
TUint8aBlock,
TUint32aValue,
const TDesC8 &aKeyA = KNullDesC8,
const TDesC8 &aKeyB = KNullDesC8
)

Decrements the contents of a block and stores the result in a temprary internal data register.

Parameters
aSectorSector address. Starts from sector 0.
aBlockBlock address. Starts from block 0.
aValueValue to decrement.
aKeyAAuthentication key A, use KNullDesC8 for factory keys
aKeyBAuthentication key B, use KNullDesC8 for factory keys

Return Values

KErrArgument Reading failed due to tag type specific restrictions
KErrDisconnected No tag in field.
KErrNone The operation is successfully completed.

Increment ( TUint8, TUint8, TUint32, const TDesC8 &, const TDesC8 & )

IMPORT_C TIntIncrement(TUint8aSector,
TUint8aBlock,
TUint32aValue,
const TDesC8 &aKeyA = KNullDesC8,
const TDesC8 &aKeyB = KNullDesC8
)

Increments the content of a block and stores the result in a temporary internal data register.

Parameters
aSectorSector address. Starts from sector 0.
aBlockBlock address. Starts from block 0.
aValueValue to increment.
aKeyAAuthentication key A, use KNullDesC8 for factory keys
aKeyBAuthentication key B, use KNullDesC8 for factory keys

Return Values

KErrArgument Reading failed due to tag type specific restrictions
KErrDisconnected No tag in field.
KErrNone The operation is successfully completed.

IsActivated ( )

IMPORT_C TBoolIsActivated()[virtual]

See also: MNfcConnection, not CActive

NewL ( RNfcServer & )

IMPORT_C CMifareClassicConnection *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 CMifareClassicConnection *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

ReadCancel ( )

IMPORT_C voidReadCancel()

Cancels any read request.

ReadDataBlock ( TRequestStatus &, MMifareClassicBlock &, TUint8, TUint8, const TDesC8 &, const TDesC8 & )

IMPORT_C voidReadDataBlock(TRequestStatus &aStatus,
MMifareClassicBlock &aMifareClassicBlock,
TUint8aSector,
TUint8aBlock,
const TDesC8 &aKeyA = KNullDesC8,
const TDesC8 &aKeyB = KNullDesC8
)

Reads datablock from the target Mifare Classic tag.

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

Parameters
aStatusThe client's request status.
aMifareClassicBlockBlock where read data is written to.
aSectorSector address starts from sector 0.
aBlockBlock address starts from block 0.
aKeyAAuthentication key A, use KNullDesC8 for factory keys
aKeyBAuthentication key B, use KNullDesC8 for factory keys
Return Value
Return values for aStatus:

Return Values

KErrArgument Reading 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.

ReadSector ( TRequestStatus &, CMifareClassicSector &, TUint8, const TDesC8 &, const TDesC8 & )

IMPORT_C voidReadSector(TRequestStatus &aStatus,
CMifareClassicSector &aMifareClassicSector,
TUint8aSector,
const TDesC8 &aKeyA = KNullDesC8,
const TDesC8 &aKeyB = KNullDesC8
)

Reads one sector from the target Mifare Classic tag.

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

Parameters
aStatusThe client's request status.
aMifareClassicSectorSector where read data is written to.
aSectorSector offset from sector 0.
aKeyAAuthentication key A, use KNullDesC8 for factory keys
aKeyBAuthentication key B, use KNullDesC8 for factory keys
Return Value
Return values for aStatus:

Return Values

KErrArgument Reading 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.

Restore ( TUint8, TUint8, const TDesC8 &, const TDesC8 & )

IMPORT_C TIntRestore(TUint8aSector,
TUint8aBlock,
const TDesC8 &aKeyA = KNullDesC8,
const TDesC8 &aKeyB = KNullDesC8
)

Moves the contents of a temporary into the internal data-register.

Parameters
aSectorSector address. Starts from sector 0.
aBlockBlock address. Starts from block 0.
aKeyAAuthentication key A, use KNullDesC8 for factory keys
aKeyBAuthentication key B, use KNullDesC8 for factory keys

Return Values

KErrArgument Reading failed due to tag type specific restrictions
KErrDisconnected No tag in field.
KErrNone The operation is successfully completed.

Transfer ( TUint8, TUint8, const TDesC8 &, const TDesC8 & )

IMPORT_C TIntTransfer(TUint8aSector,
TUint8aBlock,
const TDesC8 &aKeyA = KNullDesC8,
const TDesC8 &aKeyB = KNullDesC8
)

Writes the contents of a temporary internal data-register to a value block.

Parameters
aSectorSector address. Starts from sector 0.
aBlockBlock address. Starts from block 0.
aKeyAAuthentication key A, use KNullDesC8 for factory keys
aKeyBAuthentication key B, use KNullDesC8 for factory keys

Return Values

KErrArgument Reading failed due to tag type specific restrictions
KErrDisconnected No tag in field.
KErrNone The operation is successfully completed.

WriteCancel ( )

IMPORT_C voidWriteCancel()

Cancels any write request.

WriteDataBlock ( TRequestStatus &, const MMifareClassicBlock &, TUint8, TUint8, const TDesC8 &, const TDesC8 & )

IMPORT_C voidWriteDataBlock(TRequestStatus &aStatus,
const MMifareClassicBlock &aMifareClassicBlock,
TUint8aSector,
TUint8aBlock,
const TDesC8 &aKeyA = KNullDesC8,
const TDesC8 &aKeyB = KNullDesC8
)

Writes one block to target Mifare Classic tag. This method can also overwrite sector trailer.

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

Parameters
aStatusThe client's request status.
aMifareClassicBlockBlock which will be written.
aSectorSector offset from sector 0.
aBlockBlock offset from block 0
aKeyAAuthentication key A, use KNullDesC8 for factory keys
aKeyBAuthentication key B, use KNullDesC8 for factory keys
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.

WriteSector ( TRequestStatus &, const CMifareClassicSector &, TUint8, const TDesC8 &, const TDesC8 & )

IMPORT_C voidWriteSector(TRequestStatus &aStatus,
const CMifareClassicSector &aMifareClassicSector,
TUint8aSector,
const TDesC8 &aKeyA = KNullDesC8,
const TDesC8 &aKeyB = KNullDesC8
)

Writes one sector to target Mifare Classic tag.

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

Parameters
aStatusThe client's request status.
aMifareClassicSectorSector which will be written.
aSectorSector offset from sector 0.
aKeyAAuthentication key A, use KNullDesC8 for factory keys
aKeyBAuthentication key B, use KNullDesC8 for factory keys
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.
KErrNotSupportedif trying to write 4 blocks sector to 16 blocks sector or otherwise
KErrServerTerminated Server connection is terminated.