#include <mw/mifareclassicaccessbits.h>
class CMifareClassicAccessBits : public CBase |
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.
IMPORT_C MifareClassicCommon::TSectorTrailerAccessCondition | AccessConditionForSectorTrailer | ( | ) | const |
Gets access condition of sector trailer.
Returns: Access condition of sector trailer.
IMPORT_C void | Copy | ( | const CMifareClassicAccessBits & | aAccessBits | ) |
Copies data from specified CMifareClassicAccessBits to this CMifareClassicAccessBits by replacing any existing data.
Parameter | Description |
---|---|
aAccessBits | Which content is copied to this CMifareClassicAccessBits. |
IMPORT_C TInt | GetAccessConditionForDataBlock | ( | TUint8 | aBlockNumber, |
MifareClassicCommon::TDataBlockAccessCondition & | aAccessCondition | |||
) | const |
Gets access condition for specified data block.
Parameter | Description |
---|---|
aBlockNumber | Block number. |
aAccessCondition | Access condition. |
KErrArgument | if block number is greater than 2. |
KErrNone | if successful. |
IMPORT_C CMifareClassicAccessBits * | NewL | ( | ) | [static] |
Creates a new instance of this class. May leave with one of the system wide error codes.
Returns: Pointer to the newly created instance.
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.
Parameter | Description |
---|---|
aAccessBits | Mifare classic access bits which are copied to this object. |
Returns: Pointer to the newly created instance.
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.
Parameter | Description |
---|---|
aBuffer | Descriptor which content will be copied to this object. |
Returns: Pointer to the newly created instance.
IMPORT_C CMifareClassicAccessBits * | NewLC | ( | ) | [static] |
Creates a new instance of this class. May leave with one of the system wide error codes.
Returns: Pointer to the newly created instance.
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.
Parameter | Description |
---|---|
aAccessBits | Mifare classic access bits which are copied to this object. |
Returns: Pointer to the newly created instance.
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.
Parameter | Description |
---|---|
aBuffer | Descriptor which content will be copied to this object. |
Returns: Pointer to the newly created instance.
IMPORT_C TInt | SetAccessConditionForDataBlock | ( | TUint8 | aBlockNumber, |
MifareClassicCommon::TDataBlockAccessCondition | aAccessCondition | |||
) |
Sets access condition for specified data block.
Parameter | Description |
---|---|
aBlockNumber | Block number. |
aAccessCondition | Access condition. |
KErrArgument | if block number is greater than 2. |
KErrNone | if successful. |
IMPORT_C void | SetAccessConditionForSectorTrailer | ( | MifareClassicCommon::TSectorTrailerAccessCondition | aAccessCondition | ) |
Sets access condition for sector trailer.
Parameter | Description |
---|---|
aAccessCondition | Access condition. |
IMPORT_C TBool | operator!= | ( | const CMifareClassicAccessBits & | aAccessBits | ) | const |
Determines whether this CMifareClassicAccessBits is not equal with specified CMifareClassicAccessBits.
Parameter | Description |
---|---|
aAccessBits | CMifareClassicAccessBits which is compared to this CMifareClassicAccessBits. |
IMPORT_C TBool | operator== | ( | const CMifareClassicAccessBits & | aAccessBits | ) | const |
Determines whether this CMifareClassicAccessBits is equal with specified CMifareClassicAccessBits.
Parameter | Description |
---|---|
aAccessBits | CMifareClassicAccessBits which is compared to this CMifareClassicAccessBits. |