BALTECH Docs |
C API for BALTECH SDK
|
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()
protocol | device against which the library shall authenticate |
security_level | security level that shall be authenticated |
sec_mode | see BRP_SECMODE_ constants. By default BRP_SECMODE_STD |
key | the key that shall be used to establish a secure channel. |
iv | next 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_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. |
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. |
mode | has to be one of the BRP_MODE_* constants. by default BRP_MODE_STD could be used. |