/** * Send the message via the node without wait for response. * * @param node * the node * @param message * the message to send * @throws ProtocolException */ public static void sendNoWait(final BidibNode node, final BidibCommand message) throws ProtocolException { node.sendNoWait(message); }
/** * Send the ping message to the node. * * @param marker * the marker value * @throws ProtocolException */ public void ping(byte marker) throws ProtocolException { sendNoWait(new SysPingMessage(marker)); }
/** * Get the current 'quality' of the track sensoring. */ public void getConfidence() throws ProtocolException { sendNoWait(new FeedbackGetConfidenceMessage()); }
public void queryOutputState(PortModelEnum portModel, LcOutputType outputType, int outputNumber) throws ProtocolException { LOGGER.info("Query the output state, type: {}, outputNumber: {}", outputType, outputNumber); BidibCommand command = requestFactory.createLcOutputQuery(portModel, outputType, outputNumber); sendNoWait(command); }
/** * Switch off track signal on the booster. * * @param broadcast * broadcast message mode (see {@link BoostOffMessage} ) * @throws ProtocolException */ public void boosterOff(byte broadcast) throws ProtocolException { LOGGER.info("Switch booster off, broadcast: {}", broadcast); delegate.sendNoWait(new BoostOffMessage(broadcast)); }
/** * Query the booster state. We don't wait for the response because the MessageReceiver fires the booster status * callback on receipt. * * @throws ProtocolException */ public void boosterQuery() throws ProtocolException { delegate.sendNoWait(new BoostQueryMessage()); }
/** * Get the status of the track sensoring in the specified range. * * @param begin * the start of Melderbits to be transfered * @param end * the end of Melderbits to be transfered */ public void getFeedbackState(int begin, int end) throws ProtocolException { sendNoWait(new FeedbackGetRangeMessage(begin, end)); }
/** * Sets the identify state of the node. The result is received asynchronously. * * @param state * the identify state to set. * @throws ProtocolException */ public void identify(IdentifyState state) throws ProtocolException { // do not wait for the response sendNoWait(new SysIdentifyMessage(state)); }
/** * Switch on track signal on the booster. * * @param broadcast * broadcast command * @throws ProtocolException */ public void boosterOn(byte broadcast) throws ProtocolException { sendNoWait(new BoostOnMessage(broadcast)); }
/** * Send the system reset message to the node. * * @throws ProtocolException */ public void reset() throws ProtocolException { sendNoWait(new SysResetMessage()); }
/** * Send the system disable message to the node. * * @throws ProtocolException */ public void sysDisable() throws ProtocolException { sendNoWait(requestFactory.createSysDisable()); }
/** * Send the system enable message to the node. * * @throws ProtocolException */ public void sysEnable() throws ProtocolException { sendNoWait(requestFactory.createSysEnable()); }
public void queryPortStatesAll(PortModelEnum portModel, int portTypeMask, int rangeFrom, int rangeTo) throws ProtocolException { LOGGER .info("Query the output state for all ports ,portTypeMask: {}, rangeFrom: {}, rangeTo: {}", portTypeMask, rangeFrom, rangeTo); BidibCommand command = requestFactory.createPortQueryAll(portTypeMask, rangeFrom, rangeTo); sendNoWait(command); }
public void readPt(CommandStationPt opCode, int cvNumber) throws ProtocolException { LOGGER.info("Send PT read command, opCode: {}, cvNumber: {}", opCode, cvNumber); byte data = 0; delegate.sendNoWait(new CommandStationProgMessage(opCode, cvNumber, data)); }
/** * Send the RailCom+ ping once command. * * @param phase * the phase * @throws ProtocolException */ public void sendPingOnce(RcPlusPhase phase) throws ProtocolException { LOGGER.info("Send CommandStationRcPlusMessage(RC_PING_ONCE) to node, phase: {}", phase); delegate.sendNoWait(new CommandStationRcPlusMessage( (phase == RcPlusPhase.P0 ? RcPlusOpCodes.RC_PING_ONCE_P0 : RcPlusOpCodes.RC_PING_ONCE_P1))); }
/** * Send the RailCom+ find command. * * @param bindData * the bind data information * @throws ProtocolException */ public void sendBind(RcPlusBindData bindData) throws ProtocolException { LOGGER.info("Send CommandStationRcPlusMessage(RC_BIND) to node, bindData: {}", bindData); delegate.sendNoWait(new CommandStationRcPlusMessage(bindData)); }
/** * Switch on track signal on the booster. * * @param broadcast * broadcast message mode (see {@link BoostOnMessage} ) * @throws ProtocolException */ public void boosterOn(byte broadcast) throws ProtocolException { LOGGER.info("Switch booster on, broadcast: {}", broadcast); delegate.sendNoWait(new BoostOnMessage(broadcast)); }
/** * Set the state of the specified accessory. * * @param accessoryNumber * the number of the accessory * @param aspect * the aspect to set * @throws ProtocolException */ public void setAccessoryState(int accessoryNumber, int aspect) throws ProtocolException { // response is signaled asynchronously delegate.sendNoWait(new AccessorySetMessage(accessoryNumber, aspect)); }
/** * Get the loco addresses in the specified range from the feedback system. * * @param begin * the start of Melderbits to be transfered * @param end * the end of Melderbits to be transfered */ public void getAddressState(int begin, int end) throws ProtocolException { sendNoWait(new FeedbackGetAddressRangeMessage(begin, end)); }
public void setOutput(PortModelEnum portModel, LcOutputType outputType, int outputNumber, int state) throws ProtocolException { LOGGER .debug("Set the new output state, type: {}, outputNumber: {}, state: {}", outputType, outputNumber, state); // the response MSG_LC_STAT is signaled asynchronously BidibCommand command = requestFactory.createLcOutputMessage(portModel, outputType, outputNumber, state); sendNoWait(command); }