BALTECH SDK wrapper functions reference
ultralight.h
Go to the documentation of this file.
1 
10 #ifndef __BRP_BALTECH_SDK_CMDS_ULTRALIGHT_H__
11 #define __BRP_BALTECH_SDK_CMDS_ULTRALIGHT_H__
12 #include "../typedefs.h"
16 #define BRP_Ultralight_ErrNoTag BRP_ERR_STATUS(0x2500, 0x01)
17 
20 #define BRP_Ultralight_ErrAuth BRP_ERR_STATUS(0x2500, 0x02)
21 
24 #define BRP_Ultralight_ErrHf BRP_ERR_STATUS(0x2500, 0x03)
25 
28 #define BRP_Ultralight_ErrKey BRP_ERR_STATUS(0x2500, 0x04)
29 
32 #define BRP_Ultralight_ErrNack BRP_ERR_STATUS(0x2500, 0x05)
33 
36 #define BRP_Ultralight_ErrInterface BRP_ERR_STATUS(0x2500, 0x18)
37 
40 #define BRP_Ultralight_ErrCmd BRP_ERR_STATUS(0x2500, 0x19)
41 
44 #define BRP_Ultralight_ErrHwNotSupported BRP_ERR_STATUS(0x2500, 0x20)
45 #ifdef BALTECH_SDK_INTERNAL
46 
49 #define BRP_Ultralight_ErrFirmwareNotSupported BRP_ERR_STATUS(0x2500, 0x21)
50 #endif // BALTECH_SDK_INTERNAL
51 
56 #define BRP_Ultralight_BreakErr BRP_ERR_STATUS(0x2500, 0x28)
57 typedef struct {
59  unsigned Cmd;
61  size_t Param_len;
63  size_t* Response_len;
78 #ifdef BRP_SUPPORT_LEGACY_METHODS
79 brp_errcode brp_Ultralight_ExecCmd(brp_protocol protocol, unsigned Cmd, brp_buf Param, size_t Param_len, brp_buf* Response, size_t* Response_len, brp_mempool *mempool);
80 #else
82 #endif
83 typedef struct {
85  unsigned PageAdr;
98 #ifdef BRP_SUPPORT_LEGACY_METHODS
99 brp_errcode brp_Ultralight_Read(brp_protocol protocol, unsigned PageAdr, brp_buf* PageData, brp_mempool *mempool);
100 #else
102 #endif
103 typedef struct {
105  unsigned PageAdr;
116 #ifdef BRP_SUPPORT_LEGACY_METHODS
117 brp_errcode brp_Ultralight_Write(brp_protocol protocol, unsigned PageAdr, brp_buf PageData);
118 #else
120 #endif
121 typedef struct {
124  bool HasExtIdx;
125  unsigned KeyIdx;
127  size_t DivData_len;
128  unsigned KeyExtIdx;
144 #ifdef BRP_SUPPORT_LEGACY_METHODS
145 brp_errcode brp_Ultralight_AuthE2(brp_protocol protocol, brp_Ultralight_AuthE2_DivMode DivMode, bool HasExtIdx, unsigned KeyIdx, brp_buf DivData, size_t DivData_len, unsigned KeyExtIdx);
146 #else
148 #endif
149 typedef struct {
153  size_t Key_len;
164 #ifdef BRP_SUPPORT_LEGACY_METHODS
166 #else
168 #endif
169 typedef struct {
171  unsigned SectorNumber;
180 #ifdef BRP_SUPPORT_LEGACY_METHODS
181 brp_errcode brp_Ultralight_SectorSwitch(brp_protocol protocol, unsigned SectorNumber);
182 #else
184 #endif
185 #endif
186 
brp_errcode brp_Ultralight_AuthE2(brp_Ultralight_AuthE2_t params)
Authenticates to a Ultralight-c card.
brp_protocol protocol
Definition: ultralight.h:84
brp_protocol protocol
Definition: ultralight.h:58
unsigned int brp_errcode
This type is used library-wide for passing error codes in the return value of functions.
Definition: errorcodes.h:23
brp_Ultralight_AuthUser_CryptoMode CryptoMode
Definition: ultralight.h:151
struct brp_protocol_t * brp_protocol
This is a generic handle of a protocol.
Definition: protocol.h:34
brp_Ultralight_AuthE2_DivMode
Specifies diversification algorithm.
Definition: typedefs.h:2210
struct brp_mempool_object_t * brp_mempool
mempool handle.
Definition: mempool.h:29
brp_protocol protocol
Definition: ultralight.h:104
brp_errcode brp_Ultralight_AuthUser(brp_Ultralight_AuthUser_t params)
Authenticates to an Ultralight-C/EV1 card.
brp_protocol protocol
Definition: ultralight.h:122
brp_errcode brp_Ultralight_Write(brp_Ultralight_Write_t params)
Standard write command for Ultralight cards.
brp_Ultralight_AuthUser_CryptoMode
Sets the encryption algorithm.
Definition: typedefs.h:2232
brp_errcode brp_Ultralight_SectorSwitch(brp_Ultralight_SectorSwitch_t params)
Selects a sector of an Ultralight-C/EV1 card.
brp_Ultralight_AuthE2_DivMode DivMode
Definition: ultralight.h:123
brp_mempool * mempool
Definition: ultralight.h:64
brp_mempool * mempool
Definition: ultralight.h:87
unsigned char * brp_buf
represents a pointer to a protocol data buffer.
Definition: common.h:61
brp_errcode brp_Ultralight_Read(brp_Ultralight_Read_t params)
Standard read command for Ultralight cards.
brp_errcode brp_Ultralight_ExecCmd(brp_Ultralight_ExecCmd_t params)
Generic command to communicate to a Mifare Ultralight card.