/** * Check if the protocol version is supported. * * @param version * the version to test * @return the protocol version is supported */ public static boolean isSupportedProtocolVersion(ProtocolVersion version) { return version != null && version.isHigherThan(VERSION_0_8); }
@Override public int hashCode() { return toInt(); } }
@Override public void setProtocolVersion(String protocolVersion) { LOGGER.info("Set the protocol version: {}", protocolVersion); String[] splited = protocolVersion.split("\\."); if (splited.length == 2) { this.protocolVersion = new ProtocolVersion(Integer.parseInt(splited[0]), ByteUtils.getLowByte(Integer.parseInt(splited[1]))); } else { LOGGER.error("Invalid protocol version provided: {}", protocolVersion); } }
protected byte[] processSysGetPVersionRequest(BidibCommand bidibMessage) { LOGGER.info("Process the SysGetPVersion request: {}, do nothing ...", bidibMessage); byte[] response = null; try { LOGGER.info("Current protocolVersion: {}", protocolVersion); SysPVersionResponse sysPVersionResponse = new SysPVersionResponse(bidibMessage.getAddr(), getNextSendNum(), protocolVersion.getMajorVersion(), protocolVersion.getMinorVersion()); response = sysPVersionResponse.getContent(); } catch (ProtocolException ex) { LOGGER.warn("Create sysPVersion response failed.", ex); } return response; }
.withProductName(node.getStoredString(StringData.INDEX_PRODUCTNAME)) .withUserName(node.getStoredString(StringData.INDEX_USERNAME)) .withProtocolVersion(node.getProtocolVersion().toString()) .withSoftwareVersion(node.getSoftwareVersion().toString()); .withProductName(node.getStoredString(StringData.INDEX_PRODUCTNAME)) .withUserName(node.getStoredString(StringData.INDEX_USERNAME)) .withProtocolVersion(node.getProtocolVersion().toString()) .withSoftwareVersion(node.getSoftwareVersion().toString());
public ProtocolVersion getVersion() { byte[] data = getData(); return new ProtocolVersion(ByteUtils.getInt(data[1]), ByteUtils.getInt(data[0])); } }