Package se.sics.cooja

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

TOP

Related Classes of se.sics.cooja.TimeEvent

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.