dn_com.h
Go to the documentation of this file.
1 #ifndef DN_COM_H_
2 #define DN_COM_H_
3 
36 #ifndef _DN_EXP_COM
37 #define _DN_EXP_COM
38 #endif /* _DN_EXP_COM */
39 
45 #if defined(_USE_WIN_API)
46 #define COM_BITS_CTS MS_CTS_ON
47 typedef DCB COM_STATE;
48 #elif defined(_USE_LINUX_API)
49 #define COM_BITS_CTS TIOCM_CTS
50 typedef struct termios COM_STATE;
51 #endif
52 
53 #ifdef __cplusplus
54 extern "C"
55 {
56 #endif
57 
65  com_open(void *param, int *sock);
66 
73  com_close(int *sock);
74 
84  com_send(int sock, const char *buf, uint32_t len_buf, void *arg);
85 
96  com_recv(int sock, char *buf, uint32_t len_buf, uint32_t *len_recved,
97  uint32_t timeout, void *arg);
98 
106  com_set_timeout(int sock, uint32_t timeout);
107 
115  com_clear(int sock, uint32_t timeout);
116 
124  com_get_state(int sock, COM_STATE *state);
125 
133  com_set_state(int sock, COM_STATE *state);
134 
142  com_get_modem_state(int sock, uint32_t *state);
143 
144 #ifdef __cplusplus
145 }
146 #endif
147 
148 #endif /* DN_COM_H_ */
#define _DN_EXP_COM
Definition: dn_com.h:37
unsigned uint32_t
Definition: stdint.h:43
_DN_EXP_COM HRESULT com_clear(int sock, uint32_t timeout)
Clears the received buffer.
Definition: dn_com.c:508
_DN_EXP_COM HRESULT com_get_modem_state(int sock, uint32_t *state)
Gets the serial port pin status.
Definition: dn_com.c:581
_DN_EXP_COM HRESULT com_open(void *param, int *sock)
Opens serial port.
Definition: dn_com.c:360
_DN_EXP_COM HRESULT com_set_timeout(int sock, uint32_t timeout)
Sets timeout value to the serial socket.
Definition: dn_com.c:489
_DN_EXP_COM HRESULT com_recv(int sock, char *buf, uint32_t len_buf, uint32_t *len_recved, uint32_t timeout, void *arg)
Receives serial packet.
Definition: dn_com.c:453
int32_t HRESULT
Definition: dn_common.h:61
_DN_EXP_COM HRESULT com_close(int *sock)
Closes the socket.
Definition: dn_com.c:385
int COM_STATE
_DN_EXP_COM HRESULT com_send(int sock, const char *buf, uint32_t len_buf, void *arg)
Sends serial packet.
Definition: dn_com.c:412
_DN_EXP_COM HRESULT com_set_state(int sock, COM_STATE *state)
Puts the serial socket parameters.
Definition: dn_com.c:554
_DN_EXP_COM HRESULT com_get_state(int sock, COM_STATE *state)
Gets the serial socket parameters.
Definition: dn_com.c:527


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