C API for BALTECH SDK
lg.h File Reference

This command group provides access to the LEGIC Prime card system. More...

#include "../typedefs.h"

Go to the source code of this file.

Macros

#define BRP_Lg_ErrNomim   BRP_ERR_STATUS(0x1100, 0x01)
 No LEGIC Prime card detected. More...
 
#define BRP_Lg_ErrInvalidCmd   BRP_ERR_STATUS(0x1100, 0x02)
 Either the desired command is impossible to execute because no card is currently selected, or the specified parameters are invalid (e.g. More...
 
#define BRP_Lg_ErrAccessDenied   BRP_ERR_STATUS(0x1100, 0x03)
 Read/write not allowed due to the access conditions flags of the selected card/segment. More...
 
#define BRP_Lg_ErrHf   BRP_ERR_STATUS(0x1100, 0x04)
 Error occurred while transferring data via the HF field. More...
 
#define BRP_Lg_ErrDataCorrupt   BRP_ERR_STATUS(0x1100, 0x05)
 Data has been corrupted during transmission between the reader and the card. More...
 
#define BRP_Lg_ErrCrc   BRP_ERR_STATUS(0x1100, 0x06)
 CRC checksum invalid. More...
 
#define BRP_Lg_ErrCommunication   BRP_ERR_STATUS(0x1100, 0x07)
 Checksum error most likely occurred in internal communication. More...
 
#define BRP_Lg_ErrMimCorrupt   BRP_ERR_STATUS(0x1100, 0x08)
 Card is corrupted and may not longer be used. More...
 
#define BRP_Lg_ErrBusy   BRP_ERR_STATUS(0x1100, 0x09)
 The SM05 is busy and cannot process the command. More...
 
#define BRP_Lg_NotInitialized   BRP_ERR_STATUS(0x1100, 0x0A)
 The SC-2560 is still powering up and is not available yet. More...
 

Functions

brp_errcode brp_Lg_Select (brp_protocol protocol, unsigned TO, unsigned Adr, unsigned Len, unsigned PollTime, unsigned CRCAdr, unsigned SafeDat, unsigned ChgSeg, unsigned ProtHead, unsigned CRCCalc, unsigned CRCChk, unsigned SegID, brp_buf Stamp, size_t Stamp_len, brp_Lg_Select_MediaType *MediaType, unsigned *FuncLevel, unsigned *OrgLevel, brp_Lg_Select_EvStat *EvStat, unsigned *ActSegID, unsigned *ActAdr, brp_buf *Data, size_t *Data_len, brp_mempool *mempool)
 This command selects a specific segment of a LEGIC Prime card and reads some data from it. More...
 
brp_errcode brp_Lg_Idle (brp_protocol protocol, brp_Lg_Idle_PowOff PowOff)
 Switch power supply of HF field to the level specified in the PowOff parameter. More...
 
brp_errcode brp_Lg_GenSetRead (brp_protocol protocol, unsigned DesiredGenSetNum, unsigned *GenSetNum, brp_buf *Stamp, unsigned *StampLen, unsigned *WriteExLen, bool *WriteExShad, brp_Lg_GenSetRead_WriteExMode *WriteExMode, unsigned *WriteExStart, brp_mempool *mempool)
 Read stamp data with ID specified in the GenSetNum parameter from the reader's EEPROM. More...
 
brp_errcode brp_Lg_GenSetDelete (brp_protocol protocol, unsigned GenSetNum, unsigned *DeletedGenSetNum)
 Delete stamp data with ID specified in the GenSetNum parameter from the reader's EEPROM. More...
 
brp_errcode brp_Lg_ReadMIM (brp_protocol protocol, unsigned Adr, unsigned Len, unsigned *DataAdr, brp_buf *Data, size_t *Data_len, brp_mempool *mempool)
 Read Len Bytes from the currently selected card/segment, starting at address Adr. More...
 
brp_errcode brp_Lg_ReadMIMCRC (brp_protocol protocol, unsigned Adr, unsigned Len, unsigned CRCAdr, unsigned *DataAdr, brp_buf *Data, size_t *Data_len, brp_mempool *mempool)
 This command is similar to the brp_Lg_ReadMIM() command, except that a CRC checksum is calculated over the read Bytes and compared to the CRC checksum given in the CRCAdr parameter. More...
 
brp_errcode brp_Lg_WriteMIM (brp_protocol protocol, unsigned Adr, brp_buf Data, size_t Data_len)
 Write data to selected card/segment. More...
 
brp_errcode brp_Lg_WriteMIMCRC (brp_protocol protocol, unsigned Adr, unsigned DataLen, unsigned CRCAdr, brp_buf Data, size_t Data_len)
 This command is similar to the brp_Lg_WriteMIM() command, except that a CRC checksum is calculated over the data to write and compared to the CRC checksum given in the CRCAdr parameter. More...
 
brp_errcode brp_Lg_MakeMIMCRC (brp_protocol protocol, unsigned Adr, unsigned Len, unsigned CRCAdr)
 Create CRC checksum at CRCAdr for a data block of length Len present at address Adr. More...
 
brp_errcode brp_Lg_ReadSMStatus (brp_protocol protocol, brp_buf *RFU, unsigned *SWV, unsigned *SmStat, unsigned *HfPow, bool *NoMIM, brp_Lg_ReadSMStatus_MIMVersion *MIMVersion, brp_mempool *mempool)
 Retrieve status information from LEGIC prime SM 05 chip as well as information from the currently selected MIM. More...
 
brp_errcode brp_Lg_SetPassword (brp_protocol protocol, brp_buf Password, brp_Lg_SetPassword_PwdStat *PwdStat)
 Activates password protection for the SC-2560. More...
 
brp_errcode brp_Lg_Lock (brp_protocol protocol, brp_Lg_Lock_PwdStat *PwdStat)
 Locks the SC-2560. More...
 
brp_errcode brp_Lg_Unlock (brp_protocol protocol, brp_buf Password, brp_Lg_Unlock_PwdStat *PwdStat)
 Unlocks the SC-2560 with a password. More...
 

Detailed Description

This command group provides access to the LEGIC Prime card system.

This command group is only available for readers equipped with the LEGIC prime reader module SM05!

Definition in file lg.h.