C API for BALTECH SDK

§ brp_secured_recv_frm()

BRP_LIB brp_errcode brp_secured_recv_frm ( brp_protocol  protocol,
int  sec_mode,
brp_sec_key  key,
brp_sec_iv  iv,
int  cmd_code,
brp_frame  resp_frm,
brp_time  timeout 
)

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
sec_modesee BRP_SECMODE_ constants. By default BRP_SECMODE_STD
keythe key that shall be used to establish a secure channel. Please note that this key is copied and stays in memory until calling brp_destroy(protocol)
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_send_frm()!!!
cmd_codeSame as cmd_code in brp_secured_send_frm(). Required for correct error codes.
resp_frmReference to a frame, where the response shall be stored (=added).
timeoutmaximum time to wait for response. If more time is required BRP_ERR_TIMEOUT