Mutila: Mouse's Utilities for Arduino
Oft-used utilities: debouncing buttons, averaging samples, and so on.
CommandInterface.h
1 #pragma once
2 
3 #include <Arduino.h>
4 #include <stdint.h>
5 
19 public:
26  CommandInterface(uint8_t maxCmdLen=48);
27 
31 
39  virtual void begin(Stream& stream=Serial);
40 
45  void update();
46 
52  virtual void runCmd() = 0;
53 
54 public:
61  bool echo;
62 
63 protected:
65  void clearBuf();
66 
67 protected:
68  Stream* _stream;
69  uint8_t _maxLen;
70  uint8_t _idx;
71  char* _buf;
72 
73 };
74 
75 
virtual void begin(Stream &stream=Serial)
CommandInterface(uint8_t maxCmdLen=48)
virtual void runCmd()=0