public static Boolean getBooleanFeatureValue(Feature feature) { Boolean result = null; if (feature != null) { result = feature.getValue() > 0; } return result; }
/** * @return the number of ports in the flat model or <code>0</code> if node does not support the flat port model */ protected int getFlatPortModelPortCount() { Feature feature = getFeature(BidibLibrary.FEATURE_CTRL_PORT_FLAT_MODEL); if (feature != null) { int numPorts = feature.getValue(); return numPorts; } return 0; }
public static int getIntFeatureValue(final Collection<Feature> features, final int requestedFeatureId) { int result = 0; Feature feature = Feature.findFeature(features, requestedFeatureId); if (feature != null) { result = feature.getValue(); } return result; }
public static Boolean getBooleanFeatureValue(final Collection<Feature> features, final int requestedFeatureId) { Boolean result = null; Feature feature = Feature.findFeature(features, requestedFeatureId); if (feature != null) { result = feature.getValue() > 0; } return result; }
protected boolean isPortFlatModelAvailable() { Feature feature = getFeature(BidibLibrary.FEATURE_CTRL_PORT_FLAT_MODEL); if (feature != null && feature.getValue() > 0) { return true; } return false; }
/** * Verify if the node supports FW updates. * * @return true if the node has the FW update feature set, false otherwise * @throws ProtocolException */ public boolean isUpdatable(Node node) throws ProtocolException { try { Feature feature = getFeature(BidibLibrary.FEATURE_FW_UPDATE_MODE); if (feature != null) { node.setFeature(feature); return feature.getValue() == 1; } } catch (ProtocolException ex) { LOGGER.warn("Check if node is updatable caused protocol exception.", ex); } return false; }
feature.getValue()); response = featureResponse.getContent();
Feature feature = null; while ((feature = bidibNode.getNextFeature()) != null) { System.out.println("feature.type: " + feature.getType() + ", value: " + feature.getValue() // NOSONAR + ", name: " + feature.getFeatureName());
FeatureResponse featureResponse = new FeatureResponse(featureGetMessage.getAddr(), getNextSendNum(), featureNum, foundFeature.getValue()); response = featureResponse.getContent(); LOGGER.info("Prepared response: {}", ByteUtils.bytesToHex(response));
FeatureResponse featureResponse = new FeatureResponse(featureSetMessage.getAddr(), getNextSendNum(), featureNum, foundFeature.getValue()); response = featureResponse.getContent(); LOGGER.info("Prepared response: {}", ByteUtils.bytesToHex(response));
protected Node findNode() throws ProtocolException { Node result = null; BidibNode rootNode = getBidib().getRootNode(); int count = rootNode.getNodeCount(); for (int index = 1; index <= count; index++) { Node node = rootNode.getNextNode(); if (node != null && (node.getUniqueId() & 0xffffffffffffffL) == nodeId.longValue()) { int magic = getBidib().getNode(node).getMagic(null); LOGGER.info("Node returned magic: {}", magic); // after we fetch the magic we must try to get the FEATURE_RELEVANT_PID_BITS Feature relevantPidBits = getBidib().getNode(node).getFeature(BidibLibrary.FEATURE_RELEVANT_PID_BITS); if (relevantPidBits != null) { node.setFeature(relevantPidBits); node.setRelevantPidBits(relevantPidBits.getValue()); } result = node; break; } } return result; }