Package se.sics.mspsim.cli

Examples of se.sics.mspsim.cli.CommandHandler


   * @param fileELF ELF file
   * @param cpu MSP430 cpu
   * @throws IOException Preparing mote failed
   */
  protected void prepareMote(File fileELF, GenericNode node) throws IOException {
    this.commandHandler = new CommandHandler(System.out, System.err);
   
    this.mspNode = node;
   
    node.setCommandHandler(commandHandler);

View Full Code Here


    public void init(String name, ComponentRegistry registry) {
        this.registry = registry;
    }

    public void start() {
        CommandHandler commandHandler = (CommandHandler) registry.getComponent("commandHandler");
        if (commandHandler != null) {
            commandHandler.registerCommand("contikichecker", new BasicAsyncCommand("enable the Contiki checker", "") {

                @Override
                public int executeCommand(final CommandContext context) {
                    if (profiler != null) {
                        context.err.println("already running");
View Full Code Here

    String script = config.getProperty("autorun");
    if (script != null) {
      File fp = new File(script);
      if (fp.canRead()) {
        CommandHandler ch = registry.getComponent(CommandHandler.class, "commandHandler");
        script = script.replace('\\', '/');
        System.out.println("Autoloading script: " + script);
        config.setProperty("autoloadScript", script);
        if (ch != null) {
          ch.lineRead("source \"" + script + '"');
        }
      }
    }

    if (args.length > 1) {
        // Run the following arguments as commands
        CommandHandler ch = registry.getComponent(CommandHandler.class, "commandHandler");
        if (ch != null) {
            for (int i = 1; i < args.length; i++) {
                System.out.println("calling '" + args[i] + "'");
                ch.lineRead(args[i]);
            }
        }
    }
    System.out.println("-----------------------------------------------");
    System.out.println("MSPSim " + MSP430Constants.VERSION + " starting firmware: " + firmwareFile);
View Full Code Here

    registry.registerComponent("cpu", cpu);
    registry.registerComponent("node", this);
    registry.registerComponent("config", config);
   
    CommandHandler ch = registry.getComponent(CommandHandler.class, "commandHandler");

    if (ch == null) {
        if (config.getPropertyAsBoolean("jconsole", false)) {
            ConsoleUI console = new ConsoleUI();
            PrintStream consoleStream = new PrintStream(console.getOutputStream());
            ch = new CommandHandler(consoleStream, consoleStream);
            JFrame w = new JFrame("ConsoleUI");
            w.add(console);
            w.setBounds(20, 20, 520, 400);
            w.setLocationByPlatform(true);
            String key = "console";
View Full Code Here

        if (listener != null) {
          listener.lineRead(line);
        }
      }});
    PrintStream out = new PrintStream(lout);
    this.commandHandler = new CommandHandler(out, out);
    node.setCommandHandler(commandHandler);

    ConfigManager config = new ConfigManager();
    node.setup(config);
View Full Code Here

   * @param fileELF ELF file
   * @param cpu MSP430 cpu
   * @throws IOException Preparing mote failed
   */
  protected void prepareMote(File fileELF, GenericNode node) throws IOException {
    this.commandHandler = new CommandHandler(System.out, System.err);
   
    this.mspNode = node;
   
    node.setCommandHandler(commandHandler);

View Full Code Here

   * @param fileELF ELF file
   * @param cpu MSP430 cpu
   * @throws IOException Preparing mote failed
   */
  protected void prepareMote(File fileELF, GenericNode node) throws IOException {
    this.commandHandler = new CommandHandler(System.out, System.err);
    node.setCommandHandler(commandHandler);

    ConfigManager config = new ConfigManager();
    node.setup(config);

View Full Code Here

TOP

Related Classes of se.sics.mspsim.cli.CommandHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.