Scope
SerialConnection.h
1 #pragma once
2 
3 namespace scope {
4 
7 
8 protected:
10  HANDLE hCom;
11 
13  BOOL status;
14 
17 
18 public:
20  SerialConnection(const std::wstring& _comstring, const DWORD& _baud = CBR_9600, const BYTE& _bytesize = 8, const BYTE& _parity = NOPARITY, const BYTE& _stopbits = ONESTOPBIT);
21 
23  ~SerialConnection(void);
24 
26  void Send(const std::string& _string);
27 
31  std::vector<BYTE> Receive(const uint32_t& _toread, const uint32_t& _waitfor = 100);
32 };
33 
34 }
BOOL status
current status
void Send(const std::string &_string)
send command string over connection
bool initialized
is connection already initialized?
HANDLE hCom
the connection handle
std::vector< BYTE > Receive(const uint32_t &_toread, const uint32_t &_waitfor=100)
Receive bytes from connection, does only wait 100ms for the bytes to be ready, otherwise throws...
SerialConnection(const std::wstring &_comstring, const DWORD &_baud=CBR_9600, const BYTE &_bytesize=8, const BYTE &_parity=NOPARITY, const BYTE &_stopbits=ONESTOPBIT)
Initializes connection.
~SerialConnection(void)
Closes connection.
Class around a Win32 API serial connection.