Fork of Smoothie to port to mbed non-LPC targets.

Dependencies:   mbed

Fork of Smoothie by Stéphane Cachat

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SimpleShell.h Source File

SimpleShell.h

00001 /*
00002       This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl).
00003       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.
00004       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.
00005       You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
00006 */
00007 
00008 
00009 #ifndef simpleshell_h
00010 #define simpleshell_h
00011 
00012 #include "libs/Kernel.h"
00013 #include "libs/nuts_bolts.h"
00014 #include "libs/utils.h"
00015 #include "libs/StreamOutput.h"
00016 
00017 class SimpleShell : public Module
00018 {
00019 public:
00020     SimpleShell() {}
00021 
00022     void on_module_loaded();
00023     void on_console_line_received( void *argument );
00024     void on_gcode_received(void *argument);
00025     void on_second_tick(void *);
00026 
00027 private:
00028     void ls_command(string parameters, StreamOutput *stream );
00029     void cd_command(string parameters, StreamOutput *stream );
00030     void delete_file_command(string parameters, StreamOutput *stream );
00031     void pwd_command(string parameters, StreamOutput *stream );
00032     void cat_command(string parameters, StreamOutput *stream );
00033     void rm_command(string parameters, StreamOutput *stream );
00034     void break_command(string parameters, StreamOutput *stream );
00035     void reset_command(string parameters, StreamOutput *stream );
00036     void dfu_command(string parameters, StreamOutput *stream );
00037     void help_command(string parameters, StreamOutput *stream );
00038     void version_command(string parameters, StreamOutput *stream );
00039     void get_command(string parameters, StreamOutput *stream );
00040     void set_temp_command(string parameters, StreamOutput *stream );
00041     void mem_command(string parameters, StreamOutput *stream );
00042 
00043     void net_command( string parameters, StreamOutput *stream);
00044 
00045     void load_command( string parameters, StreamOutput *stream);
00046     void save_command( string parameters, StreamOutput *stream);
00047 
00048     bool parse_command(unsigned short cs, string args, StreamOutput *stream);
00049 
00050     typedef void (SimpleShell::*PFUNC)(string parameters, StreamOutput *stream);
00051     typedef struct {
00052         unsigned short command_cs;
00053         PFUNC pfunc;
00054     } ptentry_t;
00055 
00056     static ptentry_t commands_table[];
00057     int reset_delay_secs;
00058 };
00059 
00060 
00061 #endif