Exemplo n.º 1
0
  public synchronized void setActivePilot(int pilotMbx) {
    currentSequenceNo++;
    try {
      ChassisSetActivePilotMsg cmdMsg = new ChassisSetActivePilotMsg(pilotMbx);

      TimsMsgRouter.send(
          MSG_CHASSIS_SET_ACTIVE_PILOT, commandMbx, replyMbx, (byte) 0, currentSequenceNo, cmdMsg);

      TimsDataMsg reply;
      do {
        reply = TimsMsgRouter.receive(replyMbx, onTimeout);
      } while (reply.seq_nr != currentSequenceNo);

      if (reply.type == RackMsgType.MSG_OK) {
        System.out.println(
            RackName.nameString(replyMbx)
                + ": "
                + RackName.nameString(commandMbx)
                + ".setActivePilot");
      } else {
        System.out.println(
            RackName.nameString(replyMbx)
                + ": "
                + RackName.nameString(commandMbx)
                + ".setActivePilot replied error");
      }
    } catch (MsgException e) {
      System.out.println(
          RackName.nameString(replyMbx) + ": " + RackName.nameString(commandMbx) + ".on " + e);
    }
  }
Exemplo n.º 2
0
 public ChassisProxy(int id, int replyMbx) {
   super(RackName.create(RackName.CHASSIS, id), replyMbx, 5000, 1000, 1000);
   this.id = id;
 }
Exemplo n.º 3
0
 public int getCommandMbx() {
   return (RackName.create(RackName.CHASSIS, id));
 }