#ifndef _LINUXCOMM_H_
#define _LINUXCOMM_H_

#include "commdef.h"
#include "interface.h"

#include <pthread.h>

class LinuxCommInterface : public ArcInterface
{
public:		
	LinuxCommInterface();	
	~LinuxCommInterface();
	bool init(const char nPortNum, char nBaudRate = 7, char nStopBit = 0);
	int send(sIF_CMD_BLOCK *ifData);	
	int recv(sIF_CMD_BLOCK *ifData);		
	int syncSend(sIF_CMD_BLOCK *ifData);
	void requirelock();
    	void releaselock();
    	int  getMTU();
	void *getDeviceHandle();

public:
	BOOL ClearReadWriteBuffer();
	int	m_hComm;	
    int fd;
    pthread_mutex_t mut;
};

#endif
