summaryrefslogtreecommitdiff
path: root/Mode/ModeConfig.h
blob: 6c0ac73475f7d7cdd82f6f78bf5868372070c22a (plain)
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
#ifndef __MODECONFIG_H__
#define __MODECONFIG_H__

#include "Mode.h"
#include "LayoutConfig.h"  
#include "mbed.h"
#include "MTSSerial.h"
#include "Commands.h"
#include "mDot.h"
#include "ButtonHandler.h"

class ModeConfig : public Mode {

public:

    ModeConfig(DOGS102* lcd, ButtonHandler* buttons, mDot* dot, LoRaHandler* lora, GPSPARSER* gps);
    
    // Command error text...
    static const char command_error[];
    
    // Response texts...
    static const char newline[];
    static const char done[];
    static const char error[];

    bool start();
    
private: 

    mts::MTSSerial _serial;
    LayoutConfig _lc;
    std::vector<Command*> _commands;

    void addCommand(Command* cmd);
    
    void printHelp();

    bool readable();
    bool writeable();
    char read();
    void write(const char* message);
    void writef(const char* format, ... );
    
};

#endif // __MODECONFIG_H__