uFCoder 2.58
Loading...
Searching...
No Matches
Anti-collision support i.e. multi card reader mode

Functions

UFR_STATUS DL_API EnableAntiCollision (void)
 
UFR_STATUS DL_API DisableAntiCollision (void)
 
UFR_STATUS DL_API EnumCards (VAR uint8_t *lpucCardsNumber, OUT uint8_t *lpucUidListSize)
 
UFR_STATUS DL_API ListCards (OUT uint8_t *aucUidList, uint8_t ucUidListSize)
 
UFR_STATUS DL_API SelectCard (IN const uint8_t *aucUid, uint8_t ucUidSize, OUT uint8_t *lpucSelctedCardType)
 
UFR_STATUS DL_API DeslectCard (void)
 
UFR_STATUS DL_API GetAntiCollisionStatus (VAR int8_t *lpcIsAntiCollEnabled, VAR int8_t *lpcIsAnyCardSelected)
 

Detailed Description

Function Documentation

◆ EnableAntiCollision()

UFR_STATUS DL_API EnableAntiCollision ( void )

This function puts the reader in an “anti-collision” mode of operation.

Returns
Operation status

◆ DisableAntiCollision()

UFR_STATUS DL_API DisableAntiCollision ( void )

Exits from “anti-collision” mode of operation i.e. put the reader in to “single card” mode of operation.

Returns
Operation status

◆ EnumCards()

UFR_STATUS DL_API EnumCards ( VAR uint8_t * lpucCardsNumber,
OUT uint8_t * lpucUidListSize )

If the reader is in an “anti-collision” mode of operation, this function enumerates cards which are found in the reader field. Otherwise the function returns ANTI_COLLISION_DISABLED status code. All the calls to the ListCards(), SelectCard() and DeselectCard() work with UIDs from the actual UID list of the enumerated cards, which is obtained by the last call of this function.

Parameters
lpucCardsNumberIf the function is successfully executed, the memory location on which this pointer points to, will contain a number of the enumerated cards.
lpucUidListSizeIf the function is successfully executed, the memory location on which this pointer points to, will contain a UID list of the enumerated cards size in bytes.
Returns
Operation status

◆ ListCards()

UFR_STATUS DL_API ListCards ( OUT uint8_t * aucUidList,
uint8_t ucUidListSize )

Before calling this function you have to call EnumCards() first. For each UID of the cards detected in the reader field, there are 11 “UID record bytes” allocated in the list. First of those 11 bytes allocated designate actual UID length immediately followed by the exactly 10 bytes of UID (which is maximum hypothetical UID size). E.g, if the actual UID length is 4 bytes, you should ignore last 6 bytes of the UID record.

Parameters
aucUidListPointer to the memory alocated for the UID list. Before calling this function, you should alocate atleast *lpucUidListSize bytes which is returned by the prior call to EnumCards() function.
ucUidListSizeSize (in bytes) of the array alocated on the memory location aucUidList points to.
Returns
Operation status

◆ SelectCard()

UFR_STATUS DL_API SelectCard ( IN const uint8_t * aucUid,
uint8_t ucUidSize,
OUT uint8_t * lpucSelctedCardType )

Selects one of the cards which UID is on the actual UID list of the enumerated cards. If there is any of the cards previously selected calling this function you will get an CARD_ALREADY_SELECTED status code and, in such a case, you should call DeslectCard() function prior using SelectCard(). If UID list of the enumerated cards is empty, you will get an NO_TAGS_ENUMERRATED status code.

Parameters
aucUidpointer to the byte array containing UID of the card which is to be selected
ucUidSizeactual UID size
lpucSelctedCardTypepointer to byte which will contain DlogicCardType constant of the selected card, in case of successful execution of this function
Returns
Operation status

◆ DeslectCard()

UFR_STATUS DL_API DeslectCard ( void )

If the reader is in a “anti-collision” mode of operation, this function deselects currently selected card. Otherwise function returns ANTI_COLLISION_DISABLED status code.

Returns
Operation status

◆ GetAntiCollisionStatus()

UFR_STATUS DL_API GetAntiCollisionStatus ( VAR int8_t * lpcIsAntiCollEnabled,
VAR int8_t * lpcIsAnyCardSelected )

Calling this function you can get current anti-collision status of the reader.

Parameters
lpcIsAntiCollEnabledpointer to byte which will contain 1 if reader is in a “anti-collision” mode of operation, 0 otherwise
lpcIsAnyCardSelectedpointer to byte which will contain 1 if reader is in a “anti-collision” mode of operation and there is selected card, 0 otherwise
Returns
Operation status