36 #ifndef _DN_EXP_DEVICE 37 #define _DN_EXP_DEVICE 54 #if defined(_USE_WIN_API) 55 #define DNGetLastError() GetLastError() 56 #define OSSUCCEEDED(ret) ((ret) != 0) 57 #define OSFAILED(ret) ((ret) == 0) 59 #if defined(_USE_LINUX_API) 60 #define DNGetLastError() errno 61 #define OSSUCCEEDED(ret) ((ret) == 0) 62 #define OSFAILED(ret) ((ret) == -1) 81 #define EVENPARITY (2) 87 #define ONESTOPBIT (0) 93 #define TWOSTOPBITS (2) 101 #define DEV_BUF_MAX ((uint16_t)-1) 107 #define E_INVALIDPACKET _HRESULT_TYPEDEF_(0x80010000L)
CONN_TYPE
Connection type.
_DN_EXP_DEVICE HRESULT parse_conn_param_serial(const char *opt, struct CONN_PARAM_COM *param)
Parses serial connection parameters.
A type definition for Ethernet connection parameters.
_DN_EXP_DEVICE void memcpy_be(void *dst, const void *src, uint32_t len)
Orders to big endian.
A type definition for common communication parameters.
_DN_EXP_DEVICE void memcpy_le(void *dst, const void *src, uint32_t len)
Orders to little endian.
_DN_EXP_DEVICE int parse_conn_type(const char *opt)
Parses and returns the connection type.
CONN_PARAM_CHECK_FLAG
Definitions for check_conn_param function.
A type definition for serial connection parameters.
_DN_EXP_DEVICE HRESULT check_timeout(int sock, uint32_t timeout)
Checks the communication timeout.
_DN_EXP_DEVICE HRESULT check_conn_param(const struct CONN_PARAM_COMMON *device, int flag)
Checks the communication parameters.
_DN_EXP_DEVICE HRESULT parse_conn_param_ether(const char *opt, struct CONN_PARAM_ETH *param)
Parses Ethernet connection parameters.