60 #if defined( MBG_TGT_POSIX ) 64 #if !defined( _USE_SELECT_FOR_SERIAL_IO ) 65 #if defined( MBG_TGT_POSIX ) 66 #define _USE_SELECT_FOR_SERIAL_IO 1 68 #define _USE_SELECT_FOR_SERIAL_IO 0 87 #if !defined( DEFAULT_SERIAL_DEVICE_NAME ) 90 #if defined( MBG_TGT_WIN32 ) || defined( MBG_TGT_DOS ) 91 #define DEFAULT_SERIAL_DEVICE_NAME "COM1" 92 #define DEFAULT_SERIAL_DEVICE_NAME_2 "COM2" 93 #elif defined( MBG_TGT_LINUX ) 94 #define DEFAULT_SERIAL_DEVICE_NAME "/dev/ttyS0" 95 #define DEFAULT_SERIAL_DEVICE_NAME_2 "/dev/ttyS1" 96 #elif defined( MBG_TGT_FREEBSD ) 104 #if ( __FreeBSD__ > 7 ) 105 #define DEFAULT_SERIAL_DEVICE_NAME "/dev/cuau0" 106 #define DEFAULT_SERIAL_DEVICE_NAME_2 "/dev/cuau1" 108 #define DEFAULT_SERIAL_DEVICE_NAME "/dev/cuad0" 109 #define DEFAULT_SERIAL_DEVICE_NAME_2 "/dev/cuad1" 111 #elif defined( MBG_TGT_NETBSD ) 114 #define DEFAULT_SERIAL_DEVICE_NAME "/dev/dty00" 115 #define DEFAULT_SERIAL_DEVICE_NAME_2 "/dev/dty01" 117 #error DEFAULT_SERIAL_DEVICE_NAME needs to be defined for this target. 136 #if defined( MBG_TGT_CVI ) 140 #elif defined( MBG_TGT_WIN32 ) 144 #elif defined( MBG_TGT_DOS ) 146 #if defined( _USE_V24TOOLS ) 147 #include <v24tools.h> 171 #if defined( MBG_TGT_WIN32 ) 173 int org_dcb_has_been_read;
175 COMMTIMEOUTS org_commtimeouts;
176 int org_commtimeouts_have_been_read;
179 int comm_prop_have_been_read;
182 #if defined( MBG_TGT_POSIX ) 183 struct termios org_tio;
void mbgserio_flush_tx(MBGSERIO_DEV *mdev)
int mbgserio_read_wait(MBGSERIO_DEV *mdev, void *buffer, uint count)
void mbgserio_free_str_list(MBG_STR_LIST *list)
int mbgserio_write(MBGSERIO_DEV *mdev, const void *buffer, unsigned int count)
int mbgserio_open(MBGSERIO_DEV **pp_mdev, const char *dev_name)
Open a serial port and set up a MBGSERIO_DEV structure.
ulong poll_timeout
The default timeout when waiting for data.
int mbgserio_setup_port_str_list(MBG_STR_LIST **list, int max_devs)
int org_tio_has_been_read
struct _MBG_STR_LIST MBG_STR_LIST
struct _MBG_STR_LIST * next
MBG_PORT_HANDLE port_handle
the handle that will be used for the device
int mbgserio_read(MBGSERIO_DEV *mdev, void *buffer, unsigned int count)
int mbgserio_close(MBGSERIO_DEV **pp_mdev)
Close a serial port specified by a MBGSERIO_DEV structure.
int mbgserio_set_parms(MBGSERIO_DEV *mdev, uint32_t baud_rate, const char *framing)