#include <mw/mifareclassicsector.h>
Link against: nfctagextension.lib
class CMifareClassicSector : public CBase |
Public Member Enumerations | |
---|---|
enum | TSectorType { E1KSector, E4KSector } |
This class provides easy access to Mifare classic sectors.
IMPORT_C const CMifareClassicAccessBits & | AccessBits | ( | ) | const |
Returns reference CMifareClassicAccessBits of this CMifareClassicSector.
IMPORT_C MifareClassicCommon::TSectorTrailerAccessCondition | AccessConditionForSectorTrailer | ( | ) |
Return access condition for sector trailer.
IMPORT_C TInt | Copy | ( | const CMifareClassicSector & | aSector | ) |
Copies data from specified CMifareClassicSector to this CMifareClassicSector by replacing any existing data.
Parameters | |
---|---|
aSector | Sector which content is copied to this CMifareClassicSector. |
IMPORT_C HBufC8 * | ExportDataL | ( | ) | const |
Transforms this sector into raw data.
IMPORT_C HBufC8 * | ExportDataLC | ( | ) | const |
Transforms this sector into raw data.
IMPORT_C TInt | GetAccessConditionForDataBlock | ( | TUint8 | aBlockNumber, |
MifareClassicCommon::TDataBlockAccessCondition & | aAccessCondition | |||
) | const |
Gets access condition for specified data block.
Parameters | |
---|---|
aBlockNumber | Block number. |
aAccessCondition | Access condition. |
KErrArgument | if block number is greater than 2. |
KErrNone | if successful. |
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.
Parameters | |
---|---|
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 ) |
KErrArgument | If size of the buffer differ from the size of the mifare classic sector. |
KErrNone | If successful. |
IMPORT_C CMifareClassicSector * | NewL | ( | TSectorType | aSize | ) | [static] |
Creates a new instance of this class. May leave with one of the system wide error codes.
Parameters | |
---|---|
aSize | Describes whether sector is 1 or 4 kilobytes. |
IMPORT_C CMifareClassicSector * | NewL | ( | CMifareClassicSector & | aSector | ) | [static] |
Creates a new instance of this class. May leave with one of the system wide error codes.
Parameters | |
---|---|
aSector | Mifare classic sector which content is copied to this object. |
IMPORT_C CMifareClassicSector * | NewL | ( | const TDesC8 & | aData | ) | [static] |
Creates a new instance of this class. May leave with one of the system wide error codes.
Parameters | |
---|---|
aData | Descriptor which content will be copied to this object. |
IMPORT_C CMifareClassicSector * | NewL | ( | const TDesC8 & | aKeyA, |
const TDesC8 & | aKeyB, | |||
const CMifareClassicAccessBits & | aAccessBits, | |||
const RPointerArray< CMifareClassicDataBlock > & | aBlockArray | |||
) | [static] |
Creates a new instance of this class. May leave with one of the system wide error codes.
Parameters | |
---|---|
aKeyA | Key A for sector. |
aKeyB | Key B for sector. |
aAccessBits | Accessbits for sector. |
aBlockArray | Data block array for sector. |
IMPORT_C CMifareClassicSector * | NewLC | ( | TSectorType | aSize | ) | [static] |
Creates a new instance of this class. May leave with one of the system wide error codes.
Parameters | |
---|---|
aSize | Describes whether sector is 1 or 4 kilobytes. |
IMPORT_C CMifareClassicSector * | NewLC | ( | CMifareClassicSector & | aSector | ) | [static] |
Creates a new instance of this class. May leave with one of the system wide error codes.
Parameters | |
---|---|
aSector | Mifare classic sector which content is copied to this object. |
IMPORT_C CMifareClassicSector * | NewLC | ( | const TDesC8 & | aData | ) | [static] |
Creates a new instance of this class. May leave with one of the system wide error codes.
Parameters | |
---|---|
aData | Descriptor which content will be copied to this object. |
IMPORT_C CMifareClassicSector * | NewLC | ( | const TDesC8 & | aKeyA, |
const TDesC8 & | aKeyB, | |||
const CMifareClassicAccessBits & | aAccessBits, | |||
const RPointerArray< CMifareClassicDataBlock > & | aBlockArray | |||
) | [static] |
Creates a new instance of this class. May leave with one of the system wide error codes.
Parameters | |
---|---|
aKeyA | Key A for sector. |
aKeyB | Key B for sector. |
aAccessBits | Accessbits for sector. |
aBlockArray | Data block array for sector. |
IMPORT_C TSectorType | SectorType | ( | ) | const |
Returns TSectorType of this CMifareClassicSector.
IMPORT_C void | SetAccessBits | ( | const CMifareClassicAccessBits & | aAccessBits | ) |
Sets specified CMifareClassicAccessBits for this CMifareClassicSector by replacing any existing data.
Parameters | |
---|---|
aAccessBits | New access bits for sector. |
IMPORT_C TInt | SetAccessConditionForDataBlock | ( | TUint8 | aBlockNumber, |
const MifareClassicCommon::TDataBlockAccessCondition & | aAccessCondition | |||
) |
Sets access condition for specified data block.
Parameters | |
---|---|
aBlockNumber | Block number |
aAccessCondition | Accesscondition |
KErrArgument | if block number is greater than 2. |
KErrNone | if successful. |
IMPORT_C void | SetAccessConditionForSectorTrailer | ( | const MifareClassicCommon::TSectorTrailerAccessCondition & | aAccessCondition | ) |
Sets access condition for sector trailer.
Parameters | |
---|---|
aAccessCondition | Access condition for sector trailer. |
IMPORT_C TInt | SetSecretKey | ( | MifareClassicCommon::TKeyType | aKeyType, |
const TDesC8 & | aKey | |||
) |
Sets secret key of the mifare classic sector.
Parameters | |
---|---|
aKeyType | aKeyType, the keytype of secret key. |
aKey | Secret key, which size of key must be 6 bytes. |
KErrArgument | If size of aKeyType differ from 6 bytes. |
KErrNone | If successful |
IMPORT_C TBool | operator!= | ( | const CMifareClassicSector & | aSector | ) | const |
Determines whether this CMifareClassicSector is equal with specified CMifareClassicSector.
Parameters | |
---|---|
aSector | CMifareClassicSector which is compared to this CMifareClassicSector. |
IMPORT_C TBool | operator== | ( | const CMifareClassicSector & | aSector | ) | const |
Determines whether this CMifareClassicSector is equal with specified CMifareClassicSector.
Parameters | |
---|---|
aSector | CMifareClassicSector which is compared to this CMifareClassicSector. |