CMifareClassicAccessBits Class Reference

#include <mw/mifareclassicaccessbits.h>

Link against: nfctagextension.lib

class CMifareClassicAccessBits : public CBase

Inherits from

  • CMifareClassicAccessBits

Detailed Description

This class provides easy way to handle Mifare Classic access bits. Access bits are used to control accessibility of blocks on a Mifare Classic tag.

Detailed description of access conditions and bit combinations can be found from Mifare Standard Card Data sheets.

For Mifare Classic 1k, take reference from MF1ICS50 FS Sector 6.7 Memory access for access conditions. Table 3. describes access conditions for the sector trailer and Table 4. describes access conditions for data blocks.

For Mifare Classic 4k, take reference from MF1ICS70 FS Sector 6.7 Memory access for access conditions. Table 3. describes access conditions for the sector trailer and Table 4. describes access conditions for data blocks.

Constructor & Destructor Documentation

~CMifareClassicAccessBits ( )

IMPORT_C~CMifareClassicAccessBits()

Destructor.

Member Function Documentation

AccessConditionForSectorTrailer ( )

IMPORT_C MifareClassicCommon::TSectorTrailerAccessConditionAccessConditionForSectorTrailer()const

Gets access condition of sector trailer.

Return Value
Access condition of sector trailer.

Copy ( const CMifareClassicAccessBits & )

IMPORT_C voidCopy(const CMifareClassicAccessBits &aAccessBits)

Copies data from specified CMifareClassicAccessBits to this CMifareClassicAccessBits by replacing any existing data.

Parameters
aAccessBitsWhich content is copied to this CMifareClassicAccessBits.

ExportDataL ( )

IMPORT_C HBufC8 *ExportDataL()const

Creates HBufC8 object to describe Mifare Classic access bits.

Return Value
HBufC8 object.

ExportDataLC ( )

IMPORT_C HBufC8 *ExportDataLC()const

Creates HBufC8 object to describe Mifare Classic access bits.

Return Value
HBufC8 object.

GetAccessConditionForDataBlock ( TUint8, MifareClassicCommon::TDataBlockAccessCondition & )

IMPORT_C TIntGetAccessConditionForDataBlock(TUint8aBlockNumber,
MifareClassicCommon::TDataBlockAccessCondition &aAccessCondition
)const

Gets access condition for specified data block.

Parameters
aBlockNumberBlock number.
aAccessConditionAccess condition.

Return Values

KErrArgument if block number is greater than 2.
KErrNone if successful.

ImportData ( const TDesC8 & )

IMPORT_C TIntImportData(const TDesC8 &aBuf)

Imports data from specified specified descriptor by replacing any existing data.

Parameters
aBufDescriptor which describes Mifare Classic access bits.

Return Values

KErrNone If succesful.

NewL ( )

IMPORT_C CMifareClassicAccessBits *NewL()[static]

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

Return Value
Pointer to the newly created instance.

NewL ( const CMifareClassicAccessBits & )

IMPORT_C CMifareClassicAccessBits *NewL(const CMifareClassicAccessBits &aAccessBits)[static]

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

Parameters
aAccessBitsMifare classic access bits which are copied to this object.
Return Value
Pointer to the newly created instance.

NewL ( const TDesC8 & )

IMPORT_C CMifareClassicAccessBits *NewL(const TDesC8 &aBuffer)[static]

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

Parameters
aBufferDescriptor which content will be copied to this object.
Return Value
Pointer to the newly created instance.

NewLC ( )

IMPORT_C CMifareClassicAccessBits *NewLC()[static]

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

Return Value
Pointer to the newly created instance.

NewLC ( const CMifareClassicAccessBits & )

IMPORT_C CMifareClassicAccessBits *NewLC(const CMifareClassicAccessBits &aAccessBits)[static]

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

Parameters
aAccessBitsMifare classic access bits which are copied to this object.
Return Value
Pointer to the newly created instance.

NewLC ( const TDesC8 & )

IMPORT_C CMifareClassicAccessBits *NewLC(const TDesC8 &aBuffer)[static]

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

Parameters
aBufferDescriptor which content will be copied to this object.
Return Value
Pointer to the newly created instance.

SetAccessConditionForDataBlock ( TUint8, MifareClassicCommon::TDataBlockAccessCondition )

IMPORT_C TIntSetAccessConditionForDataBlock(TUint8aBlockNumber,
MifareClassicCommon::TDataBlockAccessConditionaAccessCondition
)

Sets access condition for specified data block.

Parameters
aBlockNumberBlock number.
aAccessConditionAccess condition.

Return Values

KErrArgument if block number is greater than 2.
KErrNone if successful.

SetAccessConditionForSectorTrailer ( MifareClassicCommon::TSectorTrailerAccessCondition )

IMPORT_C voidSetAccessConditionForSectorTrailer(MifareClassicCommon::TSectorTrailerAccessConditionaAccessCondition)

Sets access condition for sector trailer.

Parameters
aAccessConditionAccess condition.

operator!= ( const CMifareClassicAccessBits & )

IMPORT_C TBooloperator!=(const CMifareClassicAccessBits &aAccessBits)const

Determines whether this CMifareClassicAccessBits is not equal with specified CMifareClassicAccessBits.

Parameters
aAccessBitsCMifareClassicAccessBits which is compared to this CMifareClassicAccessBits.

operator== ( const CMifareClassicAccessBits & )

IMPORT_C TBooloperator==(const CMifareClassicAccessBits &aAccessBits)const

Determines whether this CMifareClassicAccessBits is equal with specified CMifareClassicAccessBits.

Parameters
aAccessBitsCMifareClassicAccessBits which is compared to this CMifareClassicAccessBits.