C API for BALTECH SDK
brp_protocol.h
Go to the documentation of this file.
1 
9 #ifndef __BRP_PROTOCOL_H__
10 #define __BRP_PROTOCOL_H__
11 
12 
13 #include "protocol.h"
14 
15 
27 #define BRP_MODE_STD 0x00
28 #define BRP_MODE_NONE BRP_MODE_STD
29 
30 
40 #define BRP_MODE_CONTINUOUS 0x01
41 
42 
50 #define BRP_MODE_REPEAT 0x02
51 
52 
56 #define BRP_MODE_BREAK 0x03
57 
68 BRP_LIB brp_protocol brp_create_brp(void);
69 
70 
85 (
86  brp_protocol protocol,
87  int cmd_code,
89  brp_buf param_buf,
92  size_t param_len,
95  brp_buf resp_buf,
96  size_t max_resp_len,
98  size_t * resp_len,
102  brp_time cmd_timeout
105 );
108 
109 
116 (
117  brp_protocol protocol,
118  int cmd_code,
120  brp_buf param_buf,
123  size_t param_len,
126  brp_time cmd_timeout,
127  int mode
130 );
131 
132 
140 (
141  brp_protocol protocol,
142  brp_buf resp_buf,
144  size_t max_resp_len,
146  size_t * resp_len,
148  brp_time timeout
149 );
151 
152 
153 
159 (
160  brp_protocol protocol
161 );
163 
164 
165 #endif //__BRP_H__
166  // end of defgroup brp_lib
unsigned int brp_errcode
This type is used library-wide for passing error codes in the return value of functions.
Definition: errorcodes.h:23
struct brp_protocol_t * brp_protocol
This is a generic handle of a protocol.
Definition: protocol.h:34
unsigned long brp_time
absolute/relative timeout/delay in ms.
Definition: common.h:67
BRP_LIB brp_errcode brp_break_cmd(brp_protocol protocol)
Stops a command that was run with brp_send_cmd() with the mode parameter set to in BRP_MODE_CONTINUOU...
This file primarly defines the common part of all protocol's data structures (:brp_protocol_t) and AP...
BRP_LIB brp_errcode brp_send_cmd(brp_protocol protocol, int cmd_code, brp_buf param_buf, size_t param_len, brp_time cmd_timeout, int mode)
Sends a command frame via a BRP protocol.
BRP_LIB brp_errcode brp_recv_cmd(brp_protocol protocol, brp_buf resp_buf, size_t max_resp_len, size_t *resp_len, brp_time timeout)
Returns the response of a command runned on the BRP device connected via base_protocol.
BRP_LIB brp_protocol brp_create_brp(void)
Creates a new BRP protocol.
unsigned char * brp_buf
represents a pointer to a protocol data buffer.
Definition: common.h:61
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.