forked from papabricole/EggDuino
-
Notifications
You must be signed in to change notification settings - Fork 2
/
EBBParser.h
56 lines (44 loc) · 1.63 KB
/
EBBParser.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
56
#pragma once
// implemented Eggbot-Protocol-Version v13
// EBB-Command-Reference, I sourced from: http://www.schmalzhaus.com/EBB/EBBParser.html
#include <Stream.h>
class EBBParser {
public:
EBBParser(Stream& stream);
protected:
void parseStream();
virtual void enableMotor(int axis, bool state) = 0;
virtual void stepperMove(int duration, int numPenSteps, int numRotSteps) = 0;
virtual void setPenState(bool up, short delayMs) = 0;
virtual bool getPenState() = 0;
virtual void setPenUpPos(int percent) = 0;
virtual void setPenDownPos(int percent) = 0;
virtual void setServoRateUp(int percentPerSecond) = 0;
virtual void setServoRateDown(int percentPerSecond) = 0;
virtual bool getPrgButtonState() = 0;
virtual void setPinOutput(char port, int pin, int value) = 0;
virtual void setEngraverState(bool state, int power) = 0;
private:
void sendAck();
void sendError();
void parseEM(const char* arg1, const char* arg2);
void parseND();
void parseNI();
void parsePO(const char* arg1, const char* arg2, const char* arg3);
void parseQB();
void parseQL();
void parseQN();
void parseQP();
void parseSC(const char* arg1, const char* arg2);
void parseSE(const char* arg1, const char* arg2, const char* arg3);
void parseSL(const char* arg);
void parseSM(const char* arg1, const char* arg2, const char* arg3);
void parseSN(const char* arg);
void parseSP(const char* arg1, const char* arg2, const char* arg3);
void parseTP(const char* arg);
void parseV();
Stream& mStream;
String mReadBuffer;
unsigned long mNodeCount;
int mLayer;
};