BALTECH Docs |
C API for BALTECH SDK
|
brp_errcode brp_Legic_TransparentCommand6000 | ( | brp_protocol | protocol, |
unsigned | CmdCode, | ||
brp_buf | CmdParams, | ||
size_t | CmdParams_len, | ||
unsigned | Timeout, | ||
unsigned * | Status, | ||
brp_buf * | Resp, | ||
size_t * | Resp_len, | ||
brp_mempool * | mempool | ||
) |
Transparent command to directly access the LEGIC reader chip modules from the 6000 series, e.g.
the SM-6300.
Every command which is defined in the LEGIC documentation for the SM-6x00 chip may be executed using this pass-through command.
For the direct communication with the SM-6x00 LEGIC defines a protocol frame that consists of the following fields (refer also to LEGIC documentation):
LEN | CMD | DATA[] | CRC —|—|—|—
The reader firmware handles this frame protocol internally by calculating and appending the LEN and CRC fields automatically. The host application only specifies the fields CMD and DATA in the transparent command parameters.
The protocol frame for the response consists of the following fields:
LEN | CMD | STAT | DATA[] | CRC —|—|—|—|—
Similar to the command frame protocol also the response frame protocol is handled by the reader firmware. It verifies the CRC checksum and removes the LEN, CMD and CRC fields. Only STAT and DATA are returned to the host.
[in] | protocol | used to execute the command |
[in] | CmdCode | Command code of command to be executed. This parameter equals the parameter CMD in the LEGIC documentation. |
[in] | CmdParams | Command specific parameter bytes. This parameter contains all command related parameters also referred to as DATA. Please don't mix the preceding length value up with the LEN field in the LEGIC documentation! |
[in] | CmdParams_len | |
[in] | Timeout | Command execution timeout in ms. The parameter specifies the maximum time the device should wait for a response from the SM6x00 before it interrupts command execution and returns a status message. The required value is not specified exactly by LEGIC. It depends on the particular command and its parameters. In case the reader returns the BRP status code Lga.ErrCommunication the selected timeout might be too small. |
[out] | Status | The received SM6x00 specific status code. This response parameter equals the parameter STAT in the LEGIC documentation. |
[out] | Resp | The received command response bytes. Please don't mix the preceding length value up with the LEN field in the LEGIC documentation! |
[out] | Resp_len | |
[in] | mempool | is used to store response data. Maybe NULL to use an internal mempool, in this case the data is only available until another command uses the internal mempool |