-
Notifications
You must be signed in to change notification settings - Fork 3
/
WeArtController.h
55 lines (40 loc) · 1010 Bytes
/
WeArtController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#pragma once
#include "WeArtMessageSerializer.h"
#include <cstdint>
#include <string>
//! @private
enum WeArtMessageType
{
MessageSent, MessageReceived
};
//! @private
enum WeArtError
{
ConnectionError, SendMessageError, ReceiveMessageError
};
//! @private
static char messagesSeparator = '~';
//! @private
class UWeArtController
{
public:
void PauseController();
void UnpauseController();
void ScheduleController();
void SendMessage(WeArtMessage* message);
bool ReceiveMessages(std::vector<WeArtMessage*>& messages);
void OnMessageReceived(WeArtMessage* msg);
void StopConnection();
void LogMessage(WeArtMessageType type, std::string& message);
void LogError(WeArtError error, std::string& message);
protected:
int clientPort;
bool debugMessages;
bool controllerAutoStart;
bool isCancellationRequested = false;
WeArtMessageSerializer messageSerializer;
uint8_t* messageReceivedBuffer[1024];
std::string trailingText;
bool IsConnected = false;
bool IsPaused = false;
};