new FeatureResponse(bidibMessage.getAddr(), getNextSendNum(), feature.getType(), feature.getValue()); response = featureResponse.getContent();
public Feature getFeature() { byte[] data = getData(); return new Feature(ByteUtils.getInt(data[0]), ByteUtils.getInt(data[1])); } }
FeatureNotAvailableResponse.TYPE); if (response instanceof FeatureResponse) { return ((FeatureResponse) response).getFeature();
break; case BidibLibrary.MSG_FEATURE: result = new FeatureResponse(result.getAddr(), result.getNum(), result.getType(), result.getData()); break; case BidibLibrary.MSG_FEATURE_COUNT:
new FeatureResponse(featureGetMessage.getAddr(), getNextSendNum(), featureNum, foundFeature.getValue()); response = featureResponse.getContent(); LOGGER.info("Prepared response: {}", ByteUtils.bytesToHex(response));
for (BidibMessage response : responses) { if (response instanceof FeatureResponse) { Feature feature = ((FeatureResponse) response).getFeature(); features.add(feature);
new FeatureResponse(featureSetMessage.getAddr(), getNextSendNum(), featureNum, foundFeature.getValue()); response = featureResponse.getContent(); LOGGER.info("Prepared response: {}", ByteUtils.bytesToHex(response));
Feature feature = ((FeatureResponse) response).getFeature();
/** * Sets the feature value on the node. * * @param number * the feature number * @param value * the feature value * @throws ProtocolException */ public Feature setFeature(int number, int value) throws ProtocolException { BidibMessage response = send(requestFactory.createFeatureSet(number, value), null, true, FeatureResponse.TYPE, FeatureNotAvailableResponse.TYPE); if (response instanceof FeatureResponse) { Feature result = ((FeatureResponse) response).getFeature(); return result; } else if (response instanceof FeatureNotAvailableResponse) { FeatureNotAvailableResponse result = (FeatureNotAvailableResponse) response; throw new ProtocolException( "The requested feature is not available, featureNumber: " + result.getFeatureNumber()); } if (ignoreWaitTimeout) { LOGGER.warn("No response received but ignoreWaitTimeout ist set! Current node: {}", this); return null; } throw createNoResponseAvailable("feature set"); }