MySensors Library & Examples  2.3.2-62-ge298769
Serial.h
1 
20 #pragma once
21 
22 #if defined(_WIN32)
23 #include <string>
24 #include <windows.h>
25 
26 typedef std::basic_string<TCHAR> tstring;
27 
28 class Serial
29 {
30 
31 private:
32  HANDLE commHandle;
33 
34 public:
35  Serial(
36  std::string &commPortName,
37  int bitRate = 115200
38  );
39 
40  virtual ~Serial();
41 
48  int writeByte(uint8_t *buffer);
49 
57  int read(uint8_t *buffer, int buffLen);
58 
63  int16_t getByte();
64 
67  bool serialDataAvail();
68 
71  void flush();
72 };
73 
74 #endif
getByte
uint8_t getByte(void) const
Get unsigned 8-bit integer payload.