uFCoder 2.62
Loading...
Searching...
No Matches
General purpose card related commands

Functions for getting common card data, not specific to card type. More...

Functions

UFR_STATUS DL_API COMTransceive (IN uint8_t *cmd, uint32_t cmd_length, IN uint8_t *cmd_ext, uint32_t cmd_ext_length, OUT uint8_t *rsp, VAR uint32_t *rsp_length, OUT uint8_t *rsp_ext, VAR uint32_t *rsp_ext_length)
 As of uFCoder library v5.0.71 users can use COM protocol via uFCoder library by calling this method. It handles transmission of CMD and CMD_EXT commands and it handles RSP and RSP_EXT packets that are a response to the COM protocol commands.
 
UFR_STATUS DL_API GetCardId (VAR uint8_t *lpucCardType, OUT uint32_t *lpulCardSerial)
 Returns card UID as a 4-byte array. This function is deprecated and used only for backward compatibility with older firmware versions (before v2.0).
 
UFR_STATUS DL_API GetCardIdEx (VAR uint8_t *lpucSak, OUT uint8_t *aucUid, VAR uint8_t *lpucUidSize)
 This function returns UID of card actually present in RF field of reader. It can handle all three known types : 4, 7 and 10 byte long UIDs.
 
UFR_STATUS DL_API GetCardSize (VAR uint32_t *lpulLinearSize, VAR uint32_t *lpulRawSize)
 Function returns size of user data space on the card (LinearSize), and size of total data space on the card (RawSize).
 
UFR_STATUS DL_API GetDlogicCardType (VAR uint8_t *lpucCardType)
 This function returns card type according to DlogicCardType enumeration.
 
UFR_STATUS DL_API GetLastCardIdEx (VAR uint8_t *lpucSak, OUT uint8_t *aucUid, VAR uint8_t *lpucUidSize)
 This function returns UID of last card which was present in RF field of reader.
 

Detailed Description

Functions for getting common card data, not specific to card type.

Function Documentation

◆ COMTransceive()

UFR_STATUS DL_API COMTransceive ( IN uint8_t * cmd,
uint32_t cmd_length,
IN uint8_t * cmd_ext,
uint32_t cmd_ext_length,
OUT uint8_t * rsp,
VAR uint32_t * rsp_length,
OUT uint8_t * rsp_ext,
VAR uint32_t * rsp_ext_length )

As of uFCoder library v5.0.71 users can use COM protocol via uFCoder library by calling this method. It handles transmission of CMD and CMD_EXT commands and it handles RSP and RSP_EXT packets that are a response to the COM protocol commands.

Parameters
cmdPointer to array of CMD bytes for transmission. Last byte is the checksum.
cmd_lengthLength of the CMD array, always set it to 7.
cmd_extPointer to array of CMD_EXT bytes for transmission. Last byte is the checksum.
cmd_ext_lengthIf the length is greater than 0, CMD_EXT bytes will be transmitted. Otherwise they will not. This is the size of CMD_EXT array that will be sent to the reader.
rspPointer to array of bytes containing RSP bytes.
rsp_lengthPointer to a variable holding how many RSP bytes have been received.
rsp_extPointer to array of bytes containing RSP bytes. If greater than zero, RSP_EXT exists.
rsp_ext_lengthPointer to a variable holding how many RSP_EXT byte have been received.
Returns
Operation status

◆ GetCardId()

UFR_STATUS DL_API GetCardId ( VAR uint8_t * lpucCardType,
OUT uint32_t * lpulCardSerial )

Returns card UID as a 4-byte array. This function is deprecated and used only for backward compatibility with older firmware versions (before v2.0).

We strongly discourage use of this function. This function can’t successfully handle 7 byte UIDS.

Parameters
lpucCardTypereturns pointer to variable which holds card type according to SAK lpulCardSerial returns pointer to array of card UID bytes, 4 bytes long ONLY
lpulCardSerialreturns pointer to array of card UID bytes, 4 bytes long ONLY
Returns
Operation status

◆ GetCardIdEx()

UFR_STATUS DL_API GetCardIdEx ( VAR uint8_t * lpucSak,
OUT uint8_t * aucUid,
VAR uint8_t * lpucUidSize )

This function returns UID of card actually present in RF field of reader. It can handle all three known types : 4, 7 and 10 byte long UIDs.

This function is recommended for use instead of GetCardId.

Parameters
lpucSakreturns pointer to variable which holds card type according to SAK
aucUidreturns pointer to array of card UID bytes, variable length
lpucUidSizereturns pointer to variable holding information about UID length
Returns
Operation status

◆ GetCardSize()

UFR_STATUS DL_API GetCardSize ( VAR uint32_t * lpulLinearSize,
VAR uint32_t * lpulRawSize )

Function returns size of user data space on the card (LinearSize), and size of total data space on the card (RawSize).

The user data space is accessed via functions LinearWrite and LinearRead. Total data space is accessed via functions LinRowWrite and LinRowRead. For example Mifare Classic 1K card have 752 bytes of user data space (sector trailers and block 0 are not included), and 1024 bytes of total data space.

Parameters
lpulLinearSizepointer to variable which contain size of user data space lpulRawSize pointer to variable which contain size of total data space
lpulRawSizepointer to variable which contain size of total data space
Returns
Operation status

◆ GetDlogicCardType()

UFR_STATUS DL_API GetDlogicCardType ( VAR uint8_t * lpucCardType)

This function returns card type according to DlogicCardType enumeration.

For details, please refer to Appendix: DLogic CardType enumeration. If the card type is not supported, function return the lpucCardType value equal to zero : TAG_UNKNOWN = 0x00

Parameters
lpucCardTypepointer to lpucCardType variable. Variable lpucCardType holds returned value of actual card type present in RF field.
Returns
Operation status

◆ GetLastCardIdEx()

UFR_STATUS DL_API GetLastCardIdEx ( VAR uint8_t * lpucSak,
OUT uint8_t * aucUid,
VAR uint8_t * lpucUidSize )

This function returns UID of last card which was present in RF field of reader.

It can handle all three known types : 4, 7 and 10 byte long UIDs. Difference with GetCardIdEx is that card does not be in RF field mandatory, UID value is stored in temporary memory area.

Parameters
lpucSakreturns pointer to variable which holds card type according to SAK
aucUidreturns pointer to array of card UID bytes, variable length
lpucUidSizereturns pointer to variable holding information about UID length
Returns
Operation status