Examples of MoteMsg


Examples of remote.protocol.motecontrol.MoteMsg

    }
  }

  protected void confirm(long mote_id, MsgPayload moteMsg)
  {
    MoteMsg msg = new MoteMsg();
    try
    {
      msg.setBytes(moteMsg.getData());
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
    SimpleMote mote;
    mote = (SimpleMote)moteList.get(mote_id);
    if (mote != null)
    {
      switch (msg.getType().getValue())
      {
        case MoteMsgType.CONFIRM:
          mote.getStatus().update(msg.getConfirm());
          break;
        case MoteMsgType.DATA:
          mote.dataOut(msg.getData());
          break;
        default:
          // TODO:take corrective action here
          //throw new Exception("Invalid mote message!");
      }
View Full Code Here

Examples of remote.protocol.motecontrol.MoteMsg

  public void reset(long[] moteids) {
    requestCommand(MsgCommand.RESET, moteids);
  }

  public void program(long[] moteids, byte[] flashImage) {
    MoteMsg msg = new MoteMsg();
    msg.getType().setValue(MoteMsgType.REQUEST);
    msg.getRequest().getCommand().setValue(MsgCommand.PROGRAM);
    msg.getRequest().getFlashImage().setData(flashImage);
    session.sendMoteMsg(msg,filterReady(moteids,msg));
  }
View Full Code Here

Examples of remote.protocol.motecontrol.MoteMsg

    msg.getRequest().getFlashImage().setData(flashImage);
    session.sendMoteMsg(msg,filterReady(moteids,msg));
  }

  protected void sendData(long moteid, byte[] data) {
    MoteMsg msg = new MoteMsg();
    msg.getType().setValue(MoteMsgType.DATA);
    msg.getData().setData(data);
    session.sendMoteMsg(msg,toArray(moteid));
  }
View Full Code Here

Examples of remote.protocol.motecontrol.MoteMsg

    return res;
  }

  private void requestCommand(short command,long[] moteids)
  {
    MoteMsg msg = new MoteMsg();
    msg.getType().setValue(MoteMsgType.REQUEST);
    msg.getRequest().getCommand().setValue(command);
    session.sendMoteMsg(msg,filterReady(moteids,msg));
  }
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.