
#include <termios.h>
#include <dlfcn.h>
#include <cssl.h>

#include <sys/stat.h> 
#define TRANSFERSIZE  64
#define TRANSFERSIZE2  32
#define TRANSFERSIZE128 128

typedef union{
	unsigned long lnum;
	unsigned char hex[4];
} tagVal;

GtkWidget* create_window1 (void);
void MessageBox(gchar *message);

enum methodType{
	WriteType = 0,
 ReadType, 
 WriteReadType
};
typedef struct timeTag{
	time_t WriteBegin;
	time_t WriteEnd;
	time_t ReadBegin;
	time_t ReadEnd;
	time_t WriteReadBegin;
	time_t WriteReadEnd;
} Time;

typedef struct transTag{
	enum methodType method;
	gboolean 	isfileopen;	// for Write, read Tab
	gboolean	isfileopen2; // 2nd fileopen for WriteRead Tab
	gchar 		*filename;	// Write, Read Tab 
	gchar 		*filename2; // 2nd filename for WriteRead,
	glong		filesize;
	glong		filesize2;
	gint		baudrate;	
	gint		databit;
	gint		stopbit;
	gint		parity;
	gchar		usbline[10];
	gchar		ttyline[10];
	Time	    time;
	gboolean	loopback;
	GString	    linedata;
} Trans;

typedef struct infoTag{
	gchar	*line;
	gchar   *filename;
	gint	baudrate;
	glong 	filesize;
	cssl_t *serial;
	gboolean	loopback;
	GString 	linedata;
} Info;

