bcap_common.h
Go to the documentation of this file.
1 #ifndef BCAP_COMMON_H_
2 #define BCAP_COMMON_H_
3 
36 #ifndef _BCAP_EXP_COMMON
37 #define _BCAP_EXP_COMMON
38 #endif /* _BCAP_EXP_COMMON */
39 
45 #define BCAP_CHECK_TYPE (0)
46 
51 #define BCAP_CHECK_SEND (BCAP_CHECK_TYPE | CHECK_FUNC_SEND)
52 
57 #define BCAP_CHECK_RECV (BCAP_CHECK_TYPE | CHECK_FUNC_RECV)
58 
63 #define S_EXECUTING _HRESULT_TYPEDEF_(0x00000900L)
64 
69 #define BCAP_HEADER (0x01)
70 
75 #define BCAP_TERMINATOR (0x04)
76 
81 #define BCAP_SIZE_HEADER (1)
82 
87 #define BCAP_SIZE_TERMINATOR (1)
88 
93 #define BCAP_SIZE_LEN (4)
94 
99 #define BCAP_SIZE_SERIAL (2)
100 
105 #define BCAP_SIZE_RESERVE (2)
106 
111 #define BCAP_SIZE_ID (4)
112 
117 #define BCAP_SIZE_ARGC (2)
118 
123 #define BCAP_SIZE_DATA_LEN (4)
124 
129 #define BCAP_POS_HEADER (0)
130 
135 #define BCAP_POS_LEN (BCAP_POS_HEADER + BCAP_SIZE_HEADER)
136 
141 #define BCAP_POS_SERIAL (BCAP_POS_LEN + BCAP_SIZE_LEN)
142 
147 #define BCAP_POS_RESERVE (BCAP_POS_SERIAL + BCAP_SIZE_SERIAL)
148 
153 #define BCAP_POS_ID (BCAP_POS_RESERVE + BCAP_SIZE_RESERVE)
154 
159 #define BCAP_POS_ARGC (BCAP_POS_ID + BCAP_SIZE_ID)
160 
165 #define BCAP_POS_DATA_LEN (BCAP_POS_ARGC + BCAP_SIZE_ARGC)
166 
172 #define BCAP_SIZE_INFO_LEN (14)
173 
178 #define BCAP_SIZE_MIN (BCAP_SIZE_HEADER + BCAP_SIZE_INFO_LEN + BCAP_SIZE_TERMINATOR)
179 
184 #define BCAP_SIZE_BSTR_LEN (4)
185 
190 #define BCAP_SIZE_BSTR_BUFFER (2)
191 
196 #define BCAP_SIZE_VARIANT_TYPE (2)
197 
202 #define BCAP_SIZE_VARIANT_NUM (4)
203 
208 #define BCAP_SIZE_CRC (2)
209 
214 #define BCAP_POS_CRC(total_size) (total_size - BCAP_SIZE_CRC - BCAP_SIZE_TERMINATOR)
215 
220 #define BCAP_SIZE_CALC_CRC(total_size) (total_size - BCAP_SIZE_HEADER - BCAP_SIZE_CRC - BCAP_SIZE_TERMINATOR)
221 
228 {
234 };
235 
236 #ifdef __cplusplus
237 extern "C"
238 {
239 #endif
240 
249  bcap_packet2bytary(const struct BCAP_PACKET *src, char *dst,
250  uint32_t len_dst);
251 
261  bcap_bytary2packet(const char *src, uint32_t len_src,
262  struct BCAP_PACKET *dst);
263 
270  bcap_calc_size_packet(const struct BCAP_PACKET *packet);
271 
278  bcap_calc_crc(uint8_t *buf, uint32_t len_buf);
279 
287  bcap_send(struct CONN_PARAM_COMMON *device, struct BCAP_PACKET *packet_send);
288 
297  bcap_recv(struct CONN_PARAM_COMMON *device, struct BCAP_PACKET *packet_recv,
298  int client);
299 
300 #ifdef __cplusplus
301 }
302 #endif
303 
304 #endif /* BCAP_COMMON_H_ */
unsigned uint32_t
Definition: stdint.h:43
_BCAP_EXP_COMMON HRESULT bcap_recv(struct CONN_PARAM_COMMON *device, struct BCAP_PACKET *packet_recv, int client)
Receives b-CAP packet.
Definition: bcap_common.c:984
uint16_t argc
Definition: bcap_common.h:232
unsigned short uint16_t
Definition: stdint.h:41
VARIANT * args
Definition: bcap_common.h:233
unsigned char uint8_t
Definition: stdint.h:39
_BCAP_EXP_COMMON HRESULT bcap_packet2bytary(const struct BCAP_PACKET *src, char *dst, uint32_t len_dst)
Converts the b-CAP packet to a byte array.
Definition: bcap_common.c:476
#define _BCAP_EXP_COMMON
Definition: bcap_common.h:37
int32_t HRESULT
Definition: dn_common.h:61
int32_t id
Definition: bcap_common.h:231
_BCAP_EXP_COMMON uint32_t bcap_calc_size_packet(const struct BCAP_PACKET *packet)
Calculates the converted buffer size of the b-CAP packet.
Definition: bcap_common.c:847
uint16_t reserv
Definition: bcap_common.h:230
_BCAP_EXP_COMMON HRESULT bcap_bytary2packet(const char *src, uint32_t len_src, struct BCAP_PACKET *dst)
Converts the byte array to a b-CAP packet.
Definition: bcap_common.c:776
A type definition for common communication parameters.
Definition: dn_device.h:170
A type definition for the multi type variable.
Definition: dn_common.h:306
int int32_t
Definition: stdint.h:42
A type definition for the b-CAP packet.
Definition: bcap_common.h:227
_BCAP_EXP_COMMON uint16_t bcap_calc_crc(uint8_t *buf, uint32_t len_buf)
Calculates CRC of the b-CAP packet.
Definition: bcap_common.c:870
_BCAP_EXP_COMMON HRESULT bcap_send(struct CONN_PARAM_COMMON *device, struct BCAP_PACKET *packet_send)
Sends b-CAP packet.
Definition: bcap_common.c:899
uint16_t serial
Definition: bcap_common.h:229


bcap_core
Author(s): DENSO WAVE INCORPORATED
autogenerated on Mon Jun 10 2019 13:12:20