@Override public LcMacro setMacro(LcMacro macroStep) throws ProtocolException { LOGGER.info("Set the macro point: {}", macroStep); BidibMessage response = delegate.send(new LcMacroSetMessage(macroStep), RECEIVE_TIMEOUT, true, LcMacroResponse.TYPE); LcMacro result = null; if (response instanceof LcMacroResponse) { result = MacroUtils.getMacro(response.getData()); LOGGER.debug("Set macro returned: {}", result); } return result; }
@Override public boolean equals(Object obj) { if (obj instanceof BidibMessage) { BidibMessage other = (BidibMessage) obj; if (other.getType() == getType() && other.getNum() == getNum() && Arrays.equals(other.getAddr(), getAddr()) && Arrays.equals(other.getData(), getData())) { return true; } } return super.equals(obj); }
/** * Get the macro step with the specified step number. * * @param macroNumber * the number of the macro * @param stepNumber * the number of the step * @return the macro step * @throws ProtocolException */ public LcMacro getMacroStep(int macroNumber, int stepNumber) throws ProtocolException { LOGGER.info("Get the macro step, macroNumber: {}, stepNumber: {}", macroNumber, stepNumber); LcMacro result = null; BidibMessage response = delegate.send(new LcMacroGetMessage(macroNumber, stepNumber), RECEIVE_TIMEOUT, true, LcMacroResponse.TYPE); if (response instanceof LcMacroResponse) { result = MacroUtils.getMacro(response.getData()); LOGGER.info("The returned macro step is: {}", result); } return result; }
case BidibLibrary.MSG_ACCESSORY_PARA: result = new AccessoryParaResponse(result.getAddr(), result.getNum(), result.getType(), result.getData()); break; case BidibLibrary.MSG_ACCESSORY_STATE: result = new AccessoryStateResponse(result.getAddr(), result.getNum(), result.getType(), result.getData()); break; case BidibLibrary.MSG_ACCESSORY_NOTIFY: result = new AccessoryNotifyResponse(result.getAddr(), result.getNum(), result.getType(), result.getData()); break; case BidibLibrary.MSG_BM_ADDRESS: result = new FeedbackAddressResponse(result.getAddr(), result.getNum(), result.getType(), result.getData()); break; case BidibLibrary.MSG_BM_CONFIDENCE: result = new FeedbackConfidenceResponse(result.getAddr(), result.getNum(), result.getType(), result.getData()); break; case BidibLibrary.MSG_BM_CURRENT: result = new FeedbackCurrentResponse(result.getAddr(), result.getNum(), result.getType(), result.getData()); break; case BidibLibrary.MSG_BM_FREE: result = new FeedbackFreeResponse(result.getAddr(), result.getNum(), result.getType(), result.getData()); break;