BALTECH Docs |
C API for BALTECH SDK
|
BRP_LIB brp_errcode brp_exec_cmd | ( | brp_protocol | protocol, |
int | cmd_code, | ||
brp_buf | param_buf, | ||
size_t | param_len, | ||
brp_buf | resp_buf, | ||
size_t | max_resp_len, | ||
size_t * | resp_len, | ||
brp_time | cmd_timeout | ||
) |
Runs a command on the BRP device connected via the assigned protocol.
This is recommended for syncronous command execution. Internally it is a shortcut for running:
for asyncronous command execution run these commands directly.
protocol | a protocol handle, where the connected reader shall run the passed command. |
cmd_code | A 16bit code identifiying the exact command to run (bits 0-7 are "command code", bits 8-15 are "device code") |
param_buf | A buffer where command parameter are stored in serialized form. If NULL, it will be ignored. |
param_len | Length of 'param_buf' in bytes. |
resp_buf | Reference to a buffer, where the response is stored. |
max_resp_len | maximum size of 'resp_buf'. If more data is returned than this value, the first max_resp_len bytes will be written and BRP_ERR_BUFFER_OVERFLOW will be returned. |
resp_len | actual size of response. If NULL, this command has to return exactly max_resp_len bytes (otherwise BRP_ERR_FRAMEFORMAT is returned) |
cmd_timeout | Maximum time to wait until command is executed. If the command is not run within this time a BRP_ERR_CMD_TIMEOUT is returned. |