#include <mw/mifareclassicconnection.h>
class CMifareClassicConnection : public CActive |
Inherited Attributes | |
---|---|
CActive::iStatus |
Inherited Enumerations | |
---|---|
CActive:TPriority |
This class provides access to a Mifare classic tag.
{nfctagextension.lib}
IMPORT_C TNfcConnectionInfo::TNfcConnectionMode | ConnectionMode | ( | ) |
See also: MNfcConnection
IMPORT_C TInt | Decrement | ( | TUint8 | aSector, |
TUint8 | aBlock, | |||
TUint32 | aValue, | |||
const TDesC8 & | aKeyA = KNullDesC8 , | |||
const TDesC8 & | aKeyB = KNullDesC8 | |||
) |
Decrements the contents of a block and stores the result in a temprary internal data register.
Parameter | Description |
---|---|
aSector | Sector address. Starts from sector 0. |
aBlock | Block address. Starts from block 0. |
aValue | Value to decrement. |
aKeyA | Authentication key A, use KNullDesC8 for factory keys |
aKeyB | Authentication key B, use KNullDesC8 for factory keys |
KErrArgument | Reading failed due to tag type specific restrictions |
KErrDisconnected | No tag in field. |
KErrNone | The operation is successfully completed. |
IMPORT_C TInt | Increment | ( | TUint8 | aSector, |
TUint8 | aBlock, | |||
TUint32 | aValue, | |||
const TDesC8 & | aKeyA = KNullDesC8 , | |||
const TDesC8 & | aKeyB = KNullDesC8 | |||
) |
Increments the content of a block and stores the result in a temporary internal data register.
Parameter | Description |
---|---|
aSector | Sector address. Starts from sector 0. |
aBlock | Block address. Starts from block 0. |
aValue | Value to increment. |
aKeyA | Authentication key A, use KNullDesC8 for factory keys |
aKeyB | Authentication key B, use KNullDesC8 for factory keys |
KErrArgument | Reading failed due to tag type specific restrictions |
KErrDisconnected | No tag in field. |
KErrNone | The operation is successfully completed. |
IMPORT_C CMifareClassicConnection * | NewL | ( | RNfcServer & | aNfcServer | ) | [static] |
Creates a new instance of this class. May leave with one of the system wide error codes.
Parameter | Description |
---|---|
aNfcServer | Reference to NFC Server. |
Returns: Pointer to the newly created instance.
IMPORT_C CMifareClassicConnection * | NewLC | ( | RNfcServer & | aNfcServer | ) | [static] |
Creates a new instance of this class. May leave with one of the system wide error codes.
Parameter | Description |
---|---|
aNfcServer | Reference to NFC Server. |
Returns: Pointer to the newly created instance.
IMPORT_C void | RawModeAccess | ( | TRequestStatus & | aStatus, |
const TDesC8 & | aCommand, | |||
TDes8 & | aResponse, | |||
TTimeIntervalMicroSeconds32 & | aTimeout | |||
) |
See also: MNfcConnection
IMPORT_C void | ReadDataBlock | ( | TRequestStatus & | aStatus, |
MMifareClassicBlock & | aMifareClassicBlock, | |||
TUint8 | aSector, | |||
TUint8 | aBlock, | |||
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.
Parameter | Description |
---|---|
aStatus | The client's request status. |
aMifareClassicBlock | Block where read data is written to. |
aSector | Sector address starts from sector 0. |
aBlock | Block address starts from block 0. |
aKeyA | Authentication key A, use KNullDesC8 for factory keys |
aKeyB | Authentication key B, use KNullDesC8 for factory keys |
Returns: Return values for aStatus:
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. |
IMPORT_C void | ReadSector | ( | TRequestStatus & | aStatus, |
CMifareClassicSector & | aMifareClassicSector, | |||
TUint8 | aSector, | |||
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.
Parameter | Description |
---|---|
aStatus | The client's request status. |
aMifareClassicSector | Sector where read data is written to. |
aSector | Sector offset from sector 0. |
aKeyA | Authentication key A, use KNullDesC8 for factory keys |
aKeyB | Authentication key B, use KNullDesC8 for factory keys |
Returns: Return values for aStatus:
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. |
IMPORT_C TInt | Restore | ( | TUint8 | aSector, |
TUint8 | aBlock, | |||
const TDesC8 & | aKeyA = KNullDesC8 , | |||
const TDesC8 & | aKeyB = KNullDesC8 | |||
) |
Moves the contents of a temporary into the internal data-register.
Parameter | Description |
---|---|
aSector | Sector address. Starts from sector 0. |
aBlock | Block address. Starts from block 0. |
aKeyA | Authentication key A, use KNullDesC8 for factory keys |
aKeyB | Authentication key B, use KNullDesC8 for factory keys |
KErrArgument | Reading failed due to tag type specific restrictions |
KErrDisconnected | No tag in field. |
KErrNone | The operation is successfully completed. |
IMPORT_C TInt | Transfer | ( | TUint8 | aSector, |
TUint8 | aBlock, | |||
const TDesC8 & | aKeyA = KNullDesC8 , | |||
const TDesC8 & | aKeyB = KNullDesC8 | |||
) |
Writes the contents of a temporary internal data-register to a value block.
Parameter | Description |
---|---|
aSector | Sector address. Starts from sector 0. |
aBlock | Block address. Starts from block 0. |
aKeyA | Authentication key A, use KNullDesC8 for factory keys |
aKeyB | Authentication key B, use KNullDesC8 for factory keys |
KErrArgument | Reading failed due to tag type specific restrictions |
KErrDisconnected | No tag in field. |
KErrNone | The operation is successfully completed. |
IMPORT_C void | WriteDataBlock | ( | TRequestStatus & | aStatus, |
const MMifareClassicBlock & | aMifareClassicBlock, | |||
TUint8 | aSector, | |||
TUint8 | aBlock, | |||
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.
Parameter | Description |
---|---|
aStatus | The client's request status. |
aMifareClassicBlock | Block which will be written. |
aSector | Sector offset from sector 0. |
aBlock | Block offset from block 0 |
aKeyA | Authentication key A, use KNullDesC8 for factory keys |
aKeyB | Authentication key B, use KNullDesC8 for factory keys |
Returns: Return values for aStatus:
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. |
IMPORT_C void | WriteSector | ( | TRequestStatus & | aStatus, |
const CMifareClassicSector & | aMifareClassicSector, | |||
TUint8 | aSector, | |||
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.
Parameter | Description |
---|---|
aStatus | The client's request status. |
aMifareClassicSector | Sector which will be written. |
aSector | Sector offset from sector 0. |
aKeyA | Authentication key A, use KNullDesC8 for factory keys |
aKeyB | Authentication key B, use KNullDesC8 for factory keys |
Returns: Return values for aStatus:
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. |