C API for BALTECH SDK

§ brp_secured_send_frm()

BRP_LIB brp_errcode brp_secured_send_frm ( brp_protocol  protocol,
int  security_level,
int  sec_mode,
brp_sec_key  key,
brp_sec_iv  iv,
int  cmd_code,
brp_buf  param_buf,
size_t  param_len,
brp_time  cmd_timeout,
int  mode 
)

Sends an encrypted command.

This command is only for low-level usage. Instead of using it, it is recommended to use the high-level wrapper brp_create_secure_channel()

Parameters
protocoldevice against which the library shall authenticate
security_levelsecurity level that shall be authenticated
sec_modesee BRP_SECMODE_ constants. By default BRP_SECMODE_STD
keythe key that shall be used to establish a secure channel.
ivnext IV (has to be initialized to 00 ... 00 00). Is only relevant if BRP_SECMODE_STATELESS is not set (otherwise may be NULL). ATTENTION: This value will change and the changed value has to be passed to next brp_secured_recv_frm()!!!
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.
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.
modehas to be one of the BRP_MODE_* constants. by default BRP_MODE_STD could be used.