protected byte[] processNodeTabGetNextRequest(BidibCommand bidibMessage) { // 01.01.2014 20:35:29.917: receive NodeTabResponse[[0],num=2,type=137,data=[1, 0, 210, 0, 13, 104, 0, 0, 54]] : // 0C 00 02 89 01 00 D2 00 0D 68 00 00 36 byte[] response = null; byte nodeTabVersion = 1; byte localAddr = 0; try { NodeTabResponse nodeTabResponse = new NodeTabResponse(bidibMessage.getAddr(), getNextSendNum(), nodeTabVersion, localAddr, uniqueId); response = nodeTabResponse.getContent(); LOGGER.info("Prepared nodeTab response: {}", ByteUtils.bytesToHex(response)); } catch (ProtocolException ex) { LOGGER.warn("Create nodeTab response failed.", ex); } return response; }
/** * @return the node tab version */ public int getNodeTabVersion() { return ByteUtils.getInt(getData()[0]); }
break; case BidibLibrary.MSG_NODETAB: result = new NodeTabResponse(result.getAddr(), result.getNum(), result.getType(), result.getData()); break; case BidibLibrary.MSG_NODE_LOST:
/** * Get the next node from the system. * * @return the node * @throws ProtocolException */ public Node getNextNode() throws ProtocolException { BidibMessage response = send(requestFactory.createNodeTabGetNext(), null, true, NodeTabResponse.TYPE); if (response instanceof NodeTabResponse) { // create a new node from the received data LOGGER.debug("Get next tab returned: {}, own addr: {}", response, addr); // create the new Node instance Node childNode = ((NodeTabResponse) response).getNode(addr); LOGGER.debug("Fetched child node: {}", childNode); return childNode; } if (ignoreWaitTimeout) { LOGGER.warn("No response received but ignoreWaitTimeout ist set! Current node: {}", this); return null; } throw createNoResponseAvailable("get next node"); }
byte[] data = getData(); byte[] addr = new byte[parentAddress.length + 1]; byte[] uniqueId = new byte[7];