C API for BALTECH SDK

§ brp_exec_cmd()

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.

Returns
A error code indicating the success of the execution of the command.
Parameters
protocola protocol handle, where the connected reader shall run the passed command.
cmd_codeA 16bit code identifiying the exact command to run (bits 0-7 are "command code", bits 8-15 are "device code")
param_bufA buffer where command parameter are stored in serialized form. If NULL, it will be ignored.
param_lenLength of 'param_buf' in bytes.
resp_bufReference to a buffer, where the response is stored.
max_resp_lenmaximum 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_lenactual size of response. If NULL, this command has to return exactly max_resp_len bytes (otherwise BRP_ERR_FRAMEFORMAT is returned)
cmd_timeoutMaximum time to wait until command is executed. If the command is not run within this time a BRP_ERR_CMD_TIMEOUT is returned.