2 * Copyright (c) 2010-2022 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>bootEvent</b>.
21 * This event is produced when the device boots up and is ready to receive commands. This event is
22 * not sent over USB interface.
24 * This class provides methods for processing BlueGiga API commands.
26 * Note that this code is autogenerated. Manual changes may be overwritten.
28 * @author Chris Jackson - Initial contribution of Java code generator
31 public class BlueGigaBootEvent extends BlueGigaResponse {
32 public static int COMMAND_CLASS = 0x00;
33 public static int COMMAND_METHOD = 0x00;
36 * Major software version
38 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
43 * Minor software version
45 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
52 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
59 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
66 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
68 private int llVersion;
73 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
75 private int protocolVersion;
80 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
87 public BlueGigaBootEvent(int[] inputBuffer) {
88 // Super creates deserializer and reads header fields
91 event = (inputBuffer[0] & 0x80) != 0;
93 // Deserialize the fields
94 major = deserializeUInt16();
95 minor = deserializeUInt16();
96 patch = deserializeUInt16();
97 build = deserializeUInt16();
98 llVersion = deserializeUInt16();
99 protocolVersion = deserializeUInt16();
100 hardware = deserializeUInt16();
104 * Major software version
106 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
108 * @return the current major as {@link int}
110 public int getMajor() {
115 * Minor software version
117 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
119 * @return the current minor as {@link int}
121 public int getMinor() {
128 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
130 * @return the current patch as {@link int}
132 public int getPatch() {
139 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
141 * @return the current build as {@link int}
143 public int getBuild() {
150 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
152 * @return the current ll_version as {@link int}
154 public int getLlVersion() {
161 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
163 * @return the current protocol_version as {@link int}
165 public int getProtocolVersion() {
166 return protocolVersion;
172 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
174 * @return the current hardware as {@link int}
176 public int getHardware() {
181 public String toString() {
182 final StringBuilder builder = new StringBuilder();
183 builder.append("BlueGigaBootEvent [major=");
184 builder.append(major);
185 builder.append(", minor=");
186 builder.append(minor);
187 builder.append(", patch=");
188 builder.append(patch);
189 builder.append(", build=");
190 builder.append(build);
191 builder.append(", llVersion=");
192 builder.append(llVersion);
193 builder.append(", protocolVersion=");
194 builder.append(protocolVersion);
195 builder.append(", hardware=");
196 builder.append(hardware);
198 return builder.toString();