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.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>featureIndEvent</b>.
21 * This event indicates the remote devices features.
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 BlueGigaFeatureIndEvent extends BlueGigaDeviceResponse {
31 public static final int COMMAND_CLASS = 0x03;
32 public static final int COMMAND_METHOD = 0x02;
35 * CtrData field from LL_FEATURE_RSP - packet
37 * BlueGiga API type is <i>uint8array</i> - Java type is {@link int[]}
39 private int[] features;
44 public BlueGigaFeatureIndEvent(int[] inputBuffer) {
45 // Super creates deserializer and reads header fields
48 event = (inputBuffer[0] & 0x80) != 0;
50 // Deserialize the fields
51 connection = deserializeUInt8();
52 features = deserializeUInt8Array();
56 * CtrData field from LL_FEATURE_RSP - packet
58 * BlueGiga API type is <i>uint8array</i> - Java type is {@link int[]}
60 * @return the current features as {@link int[]}
62 public int[] getFeatures() {
67 public String toString() {
68 final StringBuilder builder = new StringBuilder();
69 builder.append("BlueGigaFeatureIndEvent [connection=");
70 builder.append(connection);
71 builder.append(", features=");
72 for (int c = 0; c < features.length; c++) {
76 builder.append(String.format("%02X", features[c]));
79 return builder.toString();