36 #ifndef _BCAP_EXP_COMMON 37 #define _BCAP_EXP_COMMON 45 #define BCAP_CHECK_TYPE (0) 51 #define BCAP_CHECK_SEND (BCAP_CHECK_TYPE | CHECK_FUNC_SEND) 57 #define BCAP_CHECK_RECV (BCAP_CHECK_TYPE | CHECK_FUNC_RECV) 63 #define S_EXECUTING _HRESULT_TYPEDEF_(0x00000900L) 69 #define BCAP_HEADER (0x01) 75 #define BCAP_TERMINATOR (0x04) 81 #define BCAP_SIZE_HEADER (1) 87 #define BCAP_SIZE_TERMINATOR (1) 93 #define BCAP_SIZE_LEN (4) 99 #define BCAP_SIZE_SERIAL (2) 105 #define BCAP_SIZE_RESERVE (2) 111 #define BCAP_SIZE_ID (4) 117 #define BCAP_SIZE_ARGC (2) 123 #define BCAP_SIZE_DATA_LEN (4) 129 #define BCAP_POS_HEADER (0) 135 #define BCAP_POS_LEN (BCAP_POS_HEADER + BCAP_SIZE_HEADER) 141 #define BCAP_POS_SERIAL (BCAP_POS_LEN + BCAP_SIZE_LEN) 147 #define BCAP_POS_RESERVE (BCAP_POS_SERIAL + BCAP_SIZE_SERIAL) 153 #define BCAP_POS_ID (BCAP_POS_RESERVE + BCAP_SIZE_RESERVE) 159 #define BCAP_POS_ARGC (BCAP_POS_ID + BCAP_SIZE_ID) 165 #define BCAP_POS_DATA_LEN (BCAP_POS_ARGC + BCAP_SIZE_ARGC) 172 #define BCAP_SIZE_INFO_LEN (14) 178 #define BCAP_SIZE_MIN (BCAP_SIZE_HEADER + BCAP_SIZE_INFO_LEN + BCAP_SIZE_TERMINATOR) 184 #define BCAP_SIZE_BSTR_LEN (4) 190 #define BCAP_SIZE_BSTR_BUFFER (2) 196 #define BCAP_SIZE_VARIANT_TYPE (2) 202 #define BCAP_SIZE_VARIANT_NUM (4) 208 #define BCAP_SIZE_CRC (2) 214 #define BCAP_POS_CRC(total_size) (total_size - BCAP_SIZE_CRC - BCAP_SIZE_TERMINATOR) 220 #define BCAP_SIZE_CALC_CRC(total_size) (total_size - BCAP_SIZE_HEADER - BCAP_SIZE_CRC - BCAP_SIZE_TERMINATOR)
_BCAP_EXP_COMMON HRESULT bcap_recv(struct CONN_PARAM_COMMON *device, struct BCAP_PACKET *packet_recv, int client)
Receives b-CAP packet.
_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.
_BCAP_EXP_COMMON uint32_t bcap_calc_size_packet(const struct BCAP_PACKET *packet)
Calculates the converted buffer size of the b-CAP packet.
_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.
A type definition for common communication parameters.
A type definition for the multi type variable.
A type definition for the b-CAP packet.
_BCAP_EXP_COMMON uint16_t bcap_calc_crc(uint8_t *buf, uint32_t len_buf)
Calculates CRC of the b-CAP packet.
_BCAP_EXP_COMMON HRESULT bcap_send(struct CONN_PARAM_COMMON *device, struct BCAP_PACKET *packet_send)
Sends b-CAP packet.