2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.bluetooth.bluegiga.internal.command.system;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
19 * Class to implement the BlueGiga command <b>getInfo</b>.
21 * This command reads the local devices software and hardware versions.
23 * This class provides methods for processing BlueGiga API commands.
25 * Note that this code is autogenerated. Manual changes may be overwritten.
27 * @author Chris Jackson - Initial contribution of Java code generator
30 public class BlueGigaGetInfoResponse extends BlueGigaResponse {
31 public static int COMMAND_CLASS = 0x00;
32 public static int COMMAND_METHOD = 0x08;
35 * Major software version
37 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
42 * Minor software version
44 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
51 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
58 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
65 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
67 private int llVersion;
72 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
74 private int protocolVersion;
79 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
84 * Response constructor
86 public BlueGigaGetInfoResponse(int[] inputBuffer) {
87 // Super creates deserializer and reads header fields
90 event = (inputBuffer[0] & 0x80) != 0;
92 // Deserialize the fields
93 major = deserializeUInt16();
94 minor = deserializeUInt16();
95 patch = deserializeUInt16();
96 build = deserializeUInt16();
97 llVersion = deserializeUInt16();
98 protocolVersion = deserializeUInt16();
99 hardware = deserializeUInt16();
103 * Major software version
105 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
107 * @return the current major as {@link int}
109 public int getMajor() {
114 * Minor software version
116 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
118 * @return the current minor as {@link int}
120 public int getMinor() {
127 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
129 * @return the current patch as {@link int}
131 public int getPatch() {
138 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
140 * @return the current build as {@link int}
142 public int getBuild() {
149 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
151 * @return the current ll_version as {@link int}
153 public int getLlVersion() {
160 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
162 * @return the current protocol_version as {@link int}
164 public int getProtocolVersion() {
165 return protocolVersion;
171 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
173 * @return the current hardware as {@link int}
175 public int getHardware() {
180 public String toString() {
181 final StringBuilder builder = new StringBuilder();
182 builder.append("BlueGigaGetInfoResponse [major=");
183 builder.append(major);
184 builder.append(", minor=");
185 builder.append(minor);
186 builder.append(", patch=");
187 builder.append(patch);
188 builder.append(", build=");
189 builder.append(build);
190 builder.append(", llVersion=");
191 builder.append(llVersion);
192 builder.append(", protocolVersion=");
193 builder.append(protocolVersion);
194 builder.append(", hardware=");
195 builder.append(hardware);
197 return builder.toString();