Webcam Tracker  V1.0
Using openCV and an Arduino Uno
SerialCom.h
Go to the documentation of this file.
1 
8 #pragma once
9 
11 #include <tchar.h>
12 #include <iostream>
13 #include <Windows.h>
14 
16 #include "ceSerial.h"
17 
18 using namespace std;
19 using namespace ce;
20 
24 class SerialCom
25 {
26 private:
27  ceSerial serial;
28  string line;
29  string lastMessage;
30  bool newMessage;
31  static SerialCom* instance;
32 
39  SerialCom(string portName, long baudeRate, int dataSize, char parityType, float nStopBits );
40 
44  void publishError(string message);
45 
49  void publishSucces(string message);
50 
51 public:
60  static SerialCom* initialize(string portName, long baudeRate, int dataSize, char parityType, float nStopBits);
61 
65  void write(char* message);
66 
70  void readString();
71 
74  bool newMessageAvailable();
75 
78  string* getLastMessage();
79 
80 };
81 
is responsable for the serial communication between PC-application and the Arduino Uno
Definition: SerialCom.h:25
ceSerial serial
Object which holds the ceSerial communication class.
Definition: SerialCom.h:27
string lastMessage
last serial message
Definition: SerialCom.h:29
static SerialCom * instance
pointer to the current used instance
Definition: SerialCom.h:31
string line
string of all characters in the serial message
Definition: SerialCom.h:28
bool newMessage
new message available flag
Definition: SerialCom.h:30