Package se.sics.mspsim.core

Examples of se.sics.mspsim.core.EmulationException


          cpu.generateTrace(out);
          break;
      case EXCEPTION:
          out.println(source.getID() + ": " + message);
          cpu.generateTrace(out);
          throw new EmulationException(message);
      }

      LogListener[] listeners = this.logListeners;
      if (listeners != null) {
          for (LogListener l : listeners) {
View Full Code Here


            radio.setGPIO(2, port1, CC2520_FIFOP);
            radio.setGPIO(4, port2, CC2520_SFD);

            ((USARTSource) usart0).addUSARTListener(this);
        } else {
            throw new EmulationException("Could not setup wismote mote - missing USCI B0");
        }
        leds = new Leds(cpu, LEDS);
        button = new Button("Button", cpu, port1, BUTTON_PIN, true);

        IOUnit usart = cpu.getIOUnit("USCI A1");
View Full Code Here

            radio.setFIFOPort(port8, CC2420_FIFO);

            ((USARTSource) usart0).addUSARTListener(this);
            radio.setSFDPort(port8, CC2420_SFD);
        } else {
            throw new EmulationException("Could not setup tyndall mote - missing USCI B0");
        }

        IOUnit usart = cpu.getIOUnit("USCI A0");
        if (usart instanceof USARTSource) {
            registry.registerComponent("serialio", usart);
View Full Code Here

        ch.registerCommand("throw", new BasicCommand("throw an Emulation Exception", "[message]") {
            public int executeCommand(CommandContext context) {
                final String msg = context.getArgumentCount() > 0 ? context.getArgument(0) : "by request";
                cpu.scheduleCycleEvent(new TimeEvent(0, "EmulationException") {
                    @Override public void execute(long t) {
                        throw new EmulationException(msg);
                    }}, cpu.cycles);
                return 0;
            }
        });
View Full Code Here

    }
   
    public int read() {
        if (len <= 0) {
            if (STRICT) {
                throw new EmulationException("Reading from empty FIFO");
            } else {
                /*System.out.println("Reading from empty FIFO");*/
                return 0;
            }
        }
View Full Code Here

            radio.setFIFOPort(port1, CC2420_FIFO);

            ((USARTSource) usart0).addUSARTListener(this);
            radio.setSFDPort(port1, CC2420_SFD);
        } else {
            throw new EmulationException("Could not setup exp5438 mote - missing USCI B0");
        }

        IOUnit usart = cpu.getIOUnit("USCI A1");
        if (usart instanceof USARTSource) {
            registry.registerComponent("serialio", usart);
View Full Code Here

            radio.setFIFOPort(port1, CC2420_FIFO);

            usart0.addUSARTListener(this);
            radio.setSFDPort(port4, CC2420_SFD);
        } else {
            throw new EmulationException("Could not setup mote - missing USCI B0");
        }

        leds = new Leds(cpu, LEDS);
        button = new Button("Button", cpu, port2, BUTTON_PIN, true);
View Full Code Here

    port5 = cpu.getIOUnit(IOPort.class, "P5");
    port5.addPortListener(this);

    USART usart0 = cpu.getIOUnit(USART.class, "USART0");
    if (usart0 == null) {
        throw new EmulationException("Could not setup mote - missing USART0");
    }
    radio = new TR1001(cpu, usart0);

    leds = new Leds(cpu, LEDS);
    button = new Button("Button", cpu, port2, BUTTON_PIN, true);
View Full Code Here

TOP

Related Classes of se.sics.mspsim.core.EmulationException

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.