-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserial_control.h
53 lines (36 loc) · 1 KB
/
serial_control.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
#ifndef COG_ESTIMATOR_SERIAL_CONTROL_H_
#define COG_ESTIMATOR_SERIAL_CONTROL_H_
#include "fake_stream.h"
#include "measure.h"
#include <SerialCommand.h>
#define FIRMWARE_VER "1.0"
namespace serial_control {
SerialCommand SCmd;
void print_com() {
measure::draw_com();
}
void print_version() {
strm::cout << strm::endl
<< "*************************************" << strm::endl
<< "COMEstimator v" << FIRMWARE_VER << strm::endl
<< "Made by Y-modify, Nyanyan & coord.e" << strm::endl
<< "Copyright (c) 2018 Y-modify All Rights Reserved." << strm::endl
<< "*************************************" << strm::endl
<< strm::endl;
}
void what() {
strm::cout << "I can't understand" << strm::endl;
}
void what(const char *command) {
strm::cout << "Command" << command << "is not defined" << strm::endl;
}
void setup() {
SCmd.addCommand("get", print_com);
SCmd.addCommand("version", print_version);
SCmd.setDefaultHandler(what);
}
void check_command() {
SCmd.readSerial();
}
};
#endif