TeensyNanoExoCode
Loading...
Searching...
No Matches
BleMessage.h
Go to the documentation of this file.
1
9#ifndef BLEMESSAGE_H
10#define BLEMESSAGE_H
11
12#include <vector>
13static const int _max_size = 10;
14
16{
17 public:
22 BleMessage();
23
28 void clear();
29
35 void copy(BleMessage* n);
36
37 // GUI command
38 char command = 0;
39 // Number of parameters to expect with the command
40 int expecting = 0;
41 // Variable to indicate the message has all of its data
42 bool is_complete = false;
43 // Array to hold the message parameters
44 float data[_max_size];
45
51 static void print(BleMessage msg);
52
60 static int matching(BleMessage msg1, BleMessage msg2);
61 private:
62 // Current index of the data array
63 int _size = 0;
64};
65
66#endif
Definition BleMessage.h:16
static void print(BleMessage msg)
Print the message values to the Serial monitor.
Definition BleMessage.cpp:30
BleMessage()
Construct a new Ble Message object.
Definition BleMessage.cpp:5
char command
Definition BleMessage.h:38
bool is_complete
Definition BleMessage.h:42
static int matching(BleMessage msg1, BleMessage msg2)
Check if two messages are matching.
Definition BleMessage.cpp:54
void clear()
Set the message back to its defaults.
Definition BleMessage.cpp:10
float data[_max_size]
Definition BleMessage.h:44
void copy(BleMessage *n)
Sets its values equal to another BleMessage.
Definition BleMessage.cpp:18
int expecting
Definition BleMessage.h:40