Merge pull request #172 from wolfmanjm/feature/get_public_value_event
[clinton/Smoothieware.git] / src / modules / utils / simpleshell / SimpleShell.h
1 /*
2 This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl).
3 Smoothie is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
4 Smoothie is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
5 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
6 */
7
8
9 #ifndef simpleshell_h
10 #define simpleshell_h
11
12 #include "libs/Kernel.h"
13 #include "libs/nuts_bolts.h"
14 #include "libs/utils.h"
15 #include "libs/StreamOutput.h"
16
17 #define ls_command_checksum CHECKSUM("ls")
18 #define cd_command_checksum CHECKSUM("cd")
19 #define pwd_command_checksum CHECKSUM("pwd")
20 #define cat_command_checksum CHECKSUM("cat")
21 #define reset_command_checksum CHECKSUM("reset")
22 #define dfu_command_checksum CHECKSUM("dfu")
23 #define break_command_checksum CHECKSUM("break")
24 #define help_command_checksum CHECKSUM("help")
25 #define version_command_checksum CHECKSUM("version")
26 #define get_command_checksum CHECKSUM("get")
27 #define get_temp_command_checksum CHECKSUM("temp")
28 #define get_pos_command_checksum CHECKSUM("pos")
29
30 #define set_temp_command_checksum CHECKSUM("set_temp")
31
32 class SimpleShell : public Module {
33 public:
34 SimpleShell(){}
35
36 void on_module_loaded();
37 void on_console_line_received( void* argument );
38 void on_second_tick(void*);
39 string absolute_from_relative( string path );
40 void ls_command( string parameters, StreamOutput* stream );
41 void cd_command( string parameters, StreamOutput* stream );
42 void pwd_command( string parameters, StreamOutput* stream );
43 void cat_command( string parameters, StreamOutput* stream );
44 void break_command(string parameters, StreamOutput* stream );
45 void reset_command(string parameters, StreamOutput* stream );
46 void dfu_command(string parameters, StreamOutput* stream );
47 void help_command(string parameters, StreamOutput* stream );
48 void version_command(string parameters, StreamOutput* stream );
49 void get_command(string parameters, StreamOutput* stream );
50 void set_temp_command(string parameters, StreamOutput* stream );
51
52 private:
53 string current_path;
54 int reset_delay_secs;
55 };
56
57
58 #endif