Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The code for the CCT CTK interface to the RTEMS shell is located in the rce/shell directory. All interaction with the RTEMS operating system is encapsulated away from the user inside the interface. Portions of the shell have been customized by the CCT CTK group, and these customizations are listed below.

...

...

CTK defined commands

...

Commands are added to the shell either at startup (CCI CTK commands, above) or by the user with addCommand. All CCI CTK and user defined commands are based on the Command class defined in rce/shell/Command.hh. The public interface to Command is:

...

Code Block
#include "rce/shell/Command.hh"
namespace FOO {
  using RCE::Shell::Command;
  class NewCommand : public Command {
  public:
    NewCommand();
    virtual ~NewCommand() {}    
    virtual std::string usage();
    virtual MainFunc main();
  };

  int NewCommand_main(int argc, char** argv) {
    printf("This is a test of the new command\n");
    return 0;
  }

  NewCommand::NewCommand() : Command("newCommand", "misc") {}
  
  std::string NewCommand::usage() {
    static std::string u = "  newCommand     # Do nothing but print a message\n";
    return u;
  }

  Command::MainFunc NewCommand::main() {
    return NewCommand_main;
  }
}

...