/** * 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 feature = accessoryNode.getBidibNode().getFeature(BidibLibrary.FEATURE_CTRL_MAC_COUNT); int macroCount = feature != null ? feature.getValue() : 0; feature = accessoryNode.getBidibNode().getFeature(BidibLibrary.FEATURE_CTRL_MAC_SIZE);
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; }