13 #ifndef MITKSERIALCOMMUNICATION_H_HEADER_INCLUDED_ 14 #define MITKSERIALCOMMUNICATION_H_HEADER_INCLUDED_ 18 #include <itkObject.h> 19 #include <itkObjectFactory.h> 47 itkFactorylessNewMacro(Self);
70 BaudRate14400 = 14400,
71 BaudRate19200 = 19200,
72 BaudRate38400 = 38400,
73 BaudRate57600 = 57600,
74 BaudRate115200 = 115200,
75 BaudRate230400 = 230400,
76 BaudRate460800 = 460800,
77 BaudRate500000 = 500000,
78 BaudRate576000 = 576000,
79 BaudRate921600 = 921600,
80 BaudRate1000000 = 1000000,
81 BaudRate1152000 = 1152000,
83 BaudRate1500000 = 1500000,
84 BaudRate2000000 = 2000000,
85 BaudRate2500000 = 2500000,
86 BaudRate3000000 = 3000000,
87 BaudRate3500000 = 3500000,
88 BaudRate4000000 = 4000000
112 HardwareHandshakeOn = 1,
113 HardwareHandshakeOff = 0
126 int OpenConnection();
131 void CloseConnection();
152 int Receive(std::string& answer,
unsigned int numberOfBytes,
const char *eol=
nullptr);
163 int Send(
const std::string& input,
bool block =
false);
168 void SendBreak(
unsigned int ms = 400);
173 void ClearReceiveBuffer();
178 void ClearSendBuffer();
209 itkGetStringMacro(DeviceName);
219 itkSetStringMacro(DeviceName);
274 itkGetConstMacro(SendTimeout,
unsigned int);
281 itkSetMacro(SendTimeout,
unsigned int);
286 itkGetConstMacro(ReceiveTimeout,
unsigned int);
295 itkSetMacro(ReceiveTimeout,
unsigned int);
306 int ApplyConfiguration();
313 int ApplyConfigurationWin();
319 int ApplyConfigurationUnix();
338 HANDLE m_ComPortHandle;
339 DWORD m_PreviousMask;
340 COMMTIMEOUTS m_PreviousTimeout;
341 DCB m_PreviousDeviceControlBlock;
std::string m_DeviceName
device name that is used to connect to the serial interface (will be used if != "") ...
BaudRate m_BaudRate
baud rate of the serial interface connection
Parity m_Parity
parity mode
unsigned int m_SendTimeout
timeout for sending data to the serial interface in milliseconds
DataCollection - Class to facilitate loading/accessing structured data.
StopBits m_StopBits
number of stop bits per symbol
unsigned int m_ReceiveTimeout
timeout for receiving data from the serial interface in milliseconds
HardwareHandshake m_HardwareHandshake
whether to use hardware handshake for the connection
#define mitkClassMacroItkParent(className, SuperClassName)
PortNumber m_PortNumber
port number of the device
serial communication interface
DataBits m_DataBits
number of data bits per symbol
bool m_Connected
is set to true if a connection currently established