38 lines
582 B
C++
38 lines
582 B
C++
/*
|
|
#ifndef _SERIALPORTWIN_H_
|
|
#define _SERIALPORTWIN_H_
|
|
#include <windows.h>
|
|
#include "AbstractPort.h"
|
|
#include <time.h>
|
|
|
|
|
|
class SerialPortWin : public AbstractPort
|
|
{
|
|
Q_OBJECT
|
|
HANDLE hCommDev;
|
|
DCB dcb;
|
|
COMSTAT Stat;
|
|
DWORD Errors;
|
|
|
|
|
|
|
|
bool opened;
|
|
public:
|
|
SerialPortWin();
|
|
bool open_port (QString port_name);
|
|
bool close_port ();
|
|
int receive_char ();
|
|
bool send_char (unsigned char character);
|
|
int receive_packet (unsigned char *packet);
|
|
int send_packet (unsigned char *packet);
|
|
bool isOpen()
|
|
{
|
|
return opened;
|
|
}
|
|
signals:
|
|
void error(int err);
|
|
};
|
|
|
|
#endif
|
|
*/
|