Examples of MspMoteTimeEvent


Examples of org.contikios.cooja.mspmote.MspMoteTimeEvent

 
  public SkyButton(Mote mote) {
    skyMote = (SkyMote) mote;
    sim = mote.getSimulation();
   
    pressButtonEvent = new MspMoteTimeEvent((SkyMote)mote, 0) {
      public void execute(long t) {
        skyMote.skyNode.setButton(true);
      }
    };
    releaseButtonEvent = new MspMoteTimeEvent((SkyMote)mote, 0) {
      public void execute(long t) {
        skyMote.skyNode.setButton(false);
      }
    };
  }
View Full Code Here

Examples of org.contikios.cooja.mspmote.MspMoteTimeEvent

      if (isInterfered()) {
        b = (byte) 0xFF;
      }

      final byte byteToDeliver = b;
      getMote().getSimulation().scheduleEvent(new MspMoteTimeEvent(mote, 0) {
        public void execute(long t) {
          super.execute(t);
          radio.receivedByte(byteToDeliver);
          mote.requestImmediateWakeup();
        }
View Full Code Here

Examples of org.contikios.cooja.mspmote.MspMoteTimeEvent

    if (isInterfered()) {
      inputByte = (byte)0xFF;
    } else {
      inputByte = lastIncomingByte;
    }
    mote.getSimulation().scheduleEvent(new MspMoteTimeEvent(mote, 0) {
      public void execute(long t) {
        super.execute(t);
        radio.receivedByte(inputByte);
        mote.requestImmediateWakeup();
      }
View Full Code Here

Examples of org.contikios.cooja.mspmote.MspMoteTimeEvent

    if (signalStrength == currentSignalStrength) {
      return; /* ignored */
    }
    currentSignalStrength = signalStrength;
    if (rssiLastCounter == 0) {
      getMote().getSimulation().scheduleEvent(new MspMoteTimeEvent(mote, 0) {
        public void execute(long t) {
          super.execute(t);

          /* Update average */
          System.arraycopy(rssiLast, 1, rssiLast, 0, 7);
View Full Code Here

Examples of org.contikios.cooja.mspmote.MspMoteTimeEvent

    if (isInterfered()) {
      inputByte = (byte)0xFF;
    } else {
      inputByte = lastIncomingByte;
    }
    mote.getSimulation().scheduleEvent(new MspMoteTimeEvent(mote, 0) {
      public void execute(long t) {
        super.execute(t);
        radio.receivedByte(inputByte);
        mote.requestImmediateWakeup();
      }
View Full Code Here

Examples of org.contikios.cooja.mspmote.MspMoteTimeEvent

    if (signalStrength == currentSignalStrength) {
      return; /* ignored */
    }
    currentSignalStrength = signalStrength;
    if (rssiLastCounter == 0) {
      getMote().getSimulation().scheduleEvent(new MspMoteTimeEvent(mote, 0) {
        public void execute(long t) {
          super.execute(t);

          /* Update average */
          System.arraycopy(rssiLast, 1, rssiLast, 0, 7);
View Full Code Here

Examples of org.contikios.cooja.mspmote.MspMoteTimeEvent

    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.contikios.cooja.mspmote.MspMoteTimeEvent

    }

    receivedByte = isInterfered ? CORRUPTED_DATA : (Byte) data;

    final byte finalByte = receivedByte;
    mote.getSimulation().scheduleEvent(new MspMoteTimeEvent(mote, 0) {
      public void execute(long t) {
        super.execute(t);

        if (radioUSART.isReceiveFlagCleared()) {
          /*logger.info("----- TR1001 RECEIVED BYTE -----");*/
 
View Full Code Here

Examples of org.contikios.cooja.mspmote.MspMoteTimeEvent

      if (isInterfered()) {
        b = (byte) 0xFF;
      }

      final byte byteToDeliver = b;
      getMote().getSimulation().scheduleEvent(new MspMoteTimeEvent(mote, 0) {
        public void execute(long t) {
          super.execute(t);
          cc1120.receivedByte(byteToDeliver);
          mote.requestImmediateWakeup();
        }
View Full Code Here

Examples of org.contikios.cooja.mspmote.MspMoteTimeEvent

    if (isInterfered()) {
      inputByte = (byte)0xFF;
    } else {
      inputByte = lastIncomingByte;
    }
    mote.getSimulation().scheduleEvent(new MspMoteTimeEvent(mote, 0) {
      public void execute(long t) {
        super.execute(t);
        cc1120.receivedByte(inputByte);
        mote.requestImmediateWakeup();
      }
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.