Package se.sics.cooja.mspmote

Examples of se.sics.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


    }

    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

      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

    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

    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

          MspSerial.this.dataReceived(data);
        }
      });
    }

    writeDataEvent = new MspMoteTimeEvent((MspMote) mote, 0) {
      public void execute(long t) {
        super.execute(t);
       
        tryWriteNextByte();
        if (!incomingData.isEmpty()) {
View Full Code Here

 
  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

TOP

Related Classes of se.sics.cooja.mspmote.MspMoteTimeEvent

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.