Examples of TimeEvent


Examples of org.contikios.cooja.TimeEvent

    for (Byte b : arr) {
      data.addLast(b);
    }

    /* Feed incoming bytes to radio "slowly" via time events */
    TimeEvent receiveCrosslevelDataEvent = new MspMoteTimeEvent(mote, 0) {
      public void execute(long t) {
        super.execute(t);
       
        /* Stop receiving data when buffer is empty */
        if (data.isEmpty()) {
          return;
        }

        byte b = data.pop();
        if (isInterfered) {
          radioUSART.byteReceived(0xFF); /* Corrupted data */
        } else {
          radioUSART.byteReceived(b);
        }
        mote.requestImmediateWakeup();

        mote.getSimulation().scheduleEvent(this, t + DELAY_BETWEEN_BYTES);
      }
    };
    receiveCrosslevelDataEvent.execute(mote.getSimulation().getSimulationTime());
  }
View Full Code Here

Examples of org.w3c.dom.smil.TimeEvent

    /**
     * Handles an event fired on the eventbase element.
     */
    public void handleEvent(Event e) {
        TimeEvent evt = (TimeEvent) e;
        if (!repeatIterationSpecified || evt.getDetail() == repeatIteration) {
            super.handleEvent(e);
        }
    }
View Full Code Here

Examples of se.sics.cooja.TimeEvent

    for (Byte b : arr) {
      data.addLast(b);
    }

    /* Feed incoming bytes to radio "slowly" via time events */
    TimeEvent receiveCrosslevelDataEvent = new MspMoteTimeEvent(mote, 0) {
      public void execute(long t) {
        super.execute(t);
       
        /* Stop receiving data when buffer is empty */
        if (data.isEmpty()) {
          return;
        }

        byte b = data.pop();
        if (isInterfered) {
          radioUSART.byteReceived(0xFF); /* Corrupted data */
        } else {
          radioUSART.byteReceived(b);
        }
        mote.requestImmediateWakeup();

        mote.getSimulation().scheduleEvent(this, t + DELAY_BETWEEN_BYTES);
      }
    };
    receiveCrosslevelDataEvent.execute(mote.getSimulation().getSimulationTime());
  }
View Full Code Here

Examples of se.sics.mspsim.core.TimeEvent

                buf[i] = (byte) (f1);
            }
            buffer = buf;
        }
        if (soundEvent == null) {
            soundEvent = new TimeEvent(0, "Beeper") {
                public void execute(long t) {
                    if (isSoundEnabled) {
                        ioTick(t);
                        cpu.scheduleCycleEvent(this, cpu.cycles + 1000);
                    }
View Full Code Here

Examples of se.sics.mspsim.core.TimeEvent

    packet.prependBytes(PREAMBLE);
    packet.appendBytes(crc);
    byte[] data = packet.getBytes();
    System.out.println("Should send packet to radio!!!! " + packet.getTotalLength());
    // Stuff to send to radio!!!
    TimeEvent te = new TimeEvent(0) {
      public void execute(long t) {
        System.out.println("CC2420: Packet to send: ");
        byte[] buffer = sendPacket.getBytes();
        for (int i = 0; i < buffer.length; i++) {
          System.out.print(Utils.hex8(buffer[i]));
View Full Code Here

Examples of se.sics.mspsim.core.TimeEvent

        if (cpu == null) {
          context.err.println("could not access the CPU.");
          return 1;
        }

        cpu.scheduleTimeEventMillis(new TimeEvent(0) {

          @Override
          public void execute(long t) {
            if (isRunning) {
              count++;
View Full Code Here

Examples of se.sics.mspsim.core.TimeEvent

          }
        });
        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

Examples of se.sics.mspsim.core.TimeEvent

            }
          }
        }
        this.out = context.out;

        cpu.scheduleTimeEventMillis(new TimeEvent(0) {

          @Override
          public void execute(long t) {
            if (isRunning) {
              cpu.scheduleTimeEventMillis(this, 1000.0 / frequency);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.