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.attributeclient;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceResponse;
17 import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
20 * Class to implement the BlueGiga command <b>procedureCompletedEvent</b>.
22 * This event is produced at the GATT client when an attribute protocol event is completed and a
23 * new operation can be issued
25 * This class provides methods for processing BlueGiga API commands.
27 * Note that this code is autogenerated. Manual changes may be overwritten.
29 * @author Chris Jackson - Initial contribution of Java code generator
32 public class BlueGigaProcedureCompletedEvent extends BlueGigaDeviceResponse {
33 public static int COMMAND_CLASS = 0x04;
34 public static int COMMAND_METHOD = 0x01;
37 * 0: The operation was successful. Otherwise: attribute protocol error code returned by
40 * BlueGiga API type is <i>BgApiResponse</i> - Java type is {@link BgApiResponse}
42 private BgApiResponse result;
45 * Characteristic handle at which the event ended
47 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
49 private int chrHandle;
54 public BlueGigaProcedureCompletedEvent(int[] inputBuffer) {
55 // Super creates deserializer and reads header fields
58 event = (inputBuffer[0] & 0x80) != 0;
60 // Deserialize the fields
61 connection = deserializeUInt8();
62 result = deserializeBgApiResponse();
63 chrHandle = deserializeUInt16();
67 * 0: The operation was successful. Otherwise: attribute protocol error code returned by
70 * BlueGiga API type is <i>BgApiResponse</i> - Java type is {@link BgApiResponse}
72 * @return the current result as {@link BgApiResponse}
74 public BgApiResponse getResult() {
79 * Characteristic handle at which the event ended
81 * BlueGiga API type is <i>uint16</i> - Java type is {@link int}
83 * @return the current chr_handle as {@link int}
85 public int getChrHandle() {
90 public String toString() {
91 final StringBuilder builder = new StringBuilder();
92 builder.append("BlueGigaProcedureCompletedEvent [connection=");
93 builder.append(connection);
94 builder.append(", result=");
95 builder.append(result);
96 builder.append(", chrHandle=");
97 builder.append(chrHandle);
99 return builder.toString();