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.connection;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceResponse;
19 * Class to implement the BlueGiga command <b>versionIndEvent</b>.
21 * This event indicates the remote devices version.
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 BlueGigaVersionIndEvent extends BlueGigaDeviceResponse {
31 public static int COMMAND_CLASS = 0x03;
32 public static int COMMAND_METHOD = 0x01;
35 * Bluetooth controller specification version
37 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
42 * Manufacturer of the controller
44 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
49 * Bluetooth controller version
51 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
53 private int subVersNr;
58 public BlueGigaVersionIndEvent(int[] inputBuffer) {
59 // Super creates deserializer and reads header fields
62 event = (inputBuffer[0] & 0x80) != 0;
64 // Deserialize the fields
65 connection = deserializeUInt8();
66 versNr = deserializeUInt8();
67 compId = deserializeUInt16();
68 subVersNr = deserializeUInt16();
72 * Bluetooth controller specification version
74 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
76 * @return the current vers_nr as {@link int}
78 public int getVersNr() {
83 * Manufacturer of the controller
85 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
87 * @return the current comp_id as {@link int}
89 public int getCompId() {
94 * Bluetooth controller version
96 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
98 * @return the current sub_vers_nr as {@link int}
100 public int getSubVersNr() {
105 public String toString() {
106 final StringBuilder builder = new StringBuilder();
107 builder.append("BlueGigaVersionIndEvent [connection=");
108 builder.append(connection);
109 builder.append(", versNr=");
110 builder.append(versNr);
111 builder.append(", compId=");
112 builder.append(compId);
113 builder.append(", subVersNr=");
114 builder.append(subVersNr);
116 return builder.toString();