CMifareClassicSector Class Reference
#include
<mw/mifareclassicsector.h>
Link against: nfctagextension.lib
class CMifareClassicSector : public CBase |
Public Member Functions |
---|
| ~CMifareClassicSector() |
IMPORT_C const CMifareClassicAccessBits & | AccessBits() |
IMPORT_C MifareClassicCommon::TSectorTrailerAccessCondition | AccessConditionForSectorTrailer() |
IMPORT_C TInt | Copy(const CMifareClassicSector &) |
IMPORT_C HBufC8 * | ExportDataL() |
IMPORT_C HBufC8 * | ExportDataLC() |
IMPORT_C TInt | GetAccessConditionForDataBlock(TUint8, MifareClassicCommon::TDataBlockAccessCondition &) |
IMPORT_C TInt | GetDataBlock(TUint8, CMifareClassicDataBlock &) |
IMPORT_C TInt | ImportData(const TDesC8 &) |
IMPORT_C CMifareClassicSector * | NewL(TSectorType) |
IMPORT_C CMifareClassicSector * | NewL(CMifareClassicSector &) |
IMPORT_C CMifareClassicSector * | NewL(const TDesC8 &) |
IMPORT_C CMifareClassicSector * | NewL(const TDesC8 &, const TDesC8 &, const CMifareClassicAccessBits &, const RPointerArray< CMifareClassicDataBlock > &) |
IMPORT_C CMifareClassicSector * | NewLC(TSectorType) |
IMPORT_C CMifareClassicSector * | NewLC(CMifareClassicSector &) |
IMPORT_C CMifareClassicSector * | NewLC(const TDesC8 &) |
IMPORT_C CMifareClassicSector * | NewLC(const TDesC8 &, const TDesC8 &, const CMifareClassicAccessBits &, const RPointerArray< CMifareClassicDataBlock > &) |
IMPORT_C TSectorType | SectorType() |
IMPORT_C void | SetAccessBits(const CMifareClassicAccessBits &) |
IMPORT_C TInt | SetAccessConditionForDataBlock(TUint8, const MifareClassicCommon::TDataBlockAccessCondition &) |
IMPORT_C void | SetAccessConditionForSectorTrailer(const MifareClassicCommon::TSectorTrailerAccessCondition &) |
IMPORT_C TInt | SetDataBlock(TUint8, const CMifareClassicDataBlock &) |
IMPORT_C TInt | SetDataBlock(TUint8, const TDesC8 &) |
IMPORT_C TInt | SetSecretKey(MifareClassicCommon::TKeyType, const TDesC8 &) |
IMPORT_C TBool | operator!=(const CMifareClassicSector &) |
IMPORT_C TBool | operator==(const CMifareClassicSector &) |
Detailed Description
This class provides easy access to Mifare classic sectors.
Member Enumeration Documentation
Enum TSectorType
Describes whether sector size is 1 or 4 kilobytes
Enumerator | Value | Description |
---|
E1KSector | 1 | |
E4KSector | | |
Constructor & Destructor Documentation
~CMifareClassicSector ( )
IMPORT_C | ~CMifareClassicSector | ( | ) | |
Member Function Documentation
AccessBits ( )
Returns: Reference to access bits.
AccessConditionForSectorTrailer ( )
Return access condition for sector trailer.
Returns: Access condition for sector trailer.
Copy ( const CMifareClassicSector & )
Parameter | Description | aSector | Sector which content is copied to this CMifareClassicSector. |
ExportDataL ( )
IMPORT_C HBufC8 * | ExportDataL | ( | ) | const |
Transforms this sector into raw data.
Returns: Pointer to descriptor which contains raw data.
ExportDataLC ( )
IMPORT_C HBufC8 * | ExportDataLC | ( | ) | const |
Transforms this sector into raw data.
Returns: Pointer to descriptor which contains raw data.
GetAccessConditionForDataBlock ( TUint8, MifareClassicCommon::TDataBlockAccessCondition & )
Gets access condition for specified data block.
Parameter | Description | aBlockNumber | Block number. |
aAccessCondition | Access condition. |
Return Values
KErrArgument |
if block number is greater than 2.
|
KErrNone |
if successful.
|
GetDataBlock ( TUint8, CMifareClassicDataBlock & )
Parameter | Description | aBlockNumber | Block number. |
Returns: Pointer to Data block object.
ImportData ( const TDesC8 & )
Imports specified data to sector. All old data of the sector will be lost during the execution of this method. If import method fails, old data will be saved.
Parameter | Description | aData | Descriptor for a buffer to read raw data from. Buffer must contain following attributes ( in the following order ):Secret key A ( 6 bytes )Access bits ( 4 bytes )Secret key B ( 6 bytes )DataBlock 0 ( 16 bytes )DataBlock 1 ( 16 bytes )DataBlock 2 ( 16 bytes ) |
Return Values
KErrArgument |
If size of the buffer differ from the size of the mifare classic sector.
|
KErrNone |
If successful.
|
NewL ( TSectorType )
Creates a new instance of this class. May leave with one of the system wide error codes.
Parameter | Description | aSize | Describes whether sector is 1 or 4 kilobytes. |
Returns: Pointer to the newly created instance.
NewL ( CMifareClassicSector & )
Creates a new instance of this class. May leave with one of the system wide error codes.
Parameter | Description | aSector | Mifare classic sector which content is copied to this object. |
Returns: Pointer to the newly created instance.
NewL ( const TDesC8 & )
Creates a new instance of this class. May leave with one of the system wide error codes.
Parameter | Description | aData | Descriptor which content will be copied to this object. |
Returns: Pointer to the newly created instance.
NewL ( const TDesC8 &, const TDesC8 &, const CMifareClassicAccessBits &, const RPointerArray< CMifareClassicDataBlock > & )
Creates a new instance of this class. May leave with one of the system wide error codes.
Parameter | Description | aKeyA | Key A for sector. |
aKeyB | Key B for sector. |
aAccessBits | Accessbits for sector. |
aBlockArray | Data block array for sector. |
Returns: Pointer to the newly created instance.
NewLC ( TSectorType )
Creates a new instance of this class. May leave with one of the system wide error codes.
Parameter | Description | aSize | Describes whether sector is 1 or 4 kilobytes. |
Returns: Pointer to the newly created instance.
NewLC ( CMifareClassicSector & )
Creates a new instance of this class. May leave with one of the system wide error codes.
Parameter | Description | aSector | Mifare classic sector which content is copied to this object. |
Returns: Pointer to the newly created instance.
NewLC ( const TDesC8 & )
Creates a new instance of this class. May leave with one of the system wide error codes.
Parameter | Description | aData | Descriptor which content will be copied to this object. |
Returns: Pointer to the newly created instance.
NewLC ( const TDesC8 &, const TDesC8 &, const CMifareClassicAccessBits &, const RPointerArray< CMifareClassicDataBlock > & )
Creates a new instance of this class. May leave with one of the system wide error codes.
Parameter | Description | aKeyA | Key A for sector. |
aKeyB | Key B for sector. |
aAccessBits | Accessbits for sector. |
aBlockArray | Data block array for sector. |
Returns: Pointer to the newly created instance.
SectorType ( )
Returns: TSectorType of this CMifareClassicSector.
SetAccessBits ( const CMifareClassicAccessBits & )
Parameter | Description | aAccessBits | New access bits for sector. |
SetAccessConditionForDataBlock ( TUint8, const MifareClassicCommon::TDataBlockAccessCondition & )
Sets access condition for specified data block.
Parameter | Description | aBlockNumber | Block number |
aAccessCondition | Accesscondition |
Return Values
KErrArgument |
if block number is greater than 2.
|
KErrNone |
if successful.
|
SetAccessConditionForSectorTrailer ( const MifareClassicCommon::TSectorTrailerAccessCondition & )
Sets access condition for sector trailer.
Parameter | Description | aAccessCondition | Access condition for sector trailer. |
SetDataBlock ( TUint8, const CMifareClassicDataBlock & )
Parameter | Description | aBlockNumber | Block number. |
aDataBlock | Data block. |
Return Values
KErrArgument |
If block number is greater than 2.
|
KErrNone |
If successfull.
|
SetDataBlock ( TUint8, const TDesC8 & )
Parameter | Description | aBlockNumber | Block number. |
aData | Data |
Return Values
KErrArgument |
If aData parameter's size is not 16 bytes.
|
KErrNone |
If successfull.
|
SetSecretKey ( MifareClassicCommon::TKeyType, const TDesC8 & )
Sets secret key of the mifare classic sector.
Parameter | Description | aKeyType | aKeyType, the keytype of secret key. |
aKey | Secret key, which size of key must be 6 bytes. |
Return Values
KErrArgument |
If size of aKeyType differ from 6 bytes.
|
KErrNone |
If successful
|
operator!= ( const CMifareClassicSector & )
Parameter | Description | aSector | CMifareClassicSector which is compared to this CMifareClassicSector. |
operator== ( const CMifareClassicSector & )
Parameter | Description | aSector | CMifareClassicSector which is compared to this CMifareClassicSector. |