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>readLong</b>.
22 * This command can be used to read long attribute values, which are longer than 22 bytes and
23 * cannot be read with a simple Read by Handle command. The command starts a procedure, where the
24 * client first sends a normal read command to the server and if the returned attribute value
25 * length is equal to MTU, the client will send further read long read requests until rest of the
28 * This class provides methods for processing BlueGiga API commands.
30 * Note that this code is autogenerated. Manual changes may be overwritten.
32 * @author Chris Jackson - Initial contribution of Java code generator
35 public class BlueGigaReadLongResponse extends BlueGigaDeviceResponse {
36 public static final int COMMAND_CLASS = 0x04;
37 public static final int COMMAND_METHOD = 0x08;
40 * 0 : the command was successful. Otherwise an error occurred
42 * BlueGiga API type is <i>BgApiResponse</i> - Java type is {@link BgApiResponse}
44 private BgApiResponse result;
47 * Response constructor
49 public BlueGigaReadLongResponse(int[] inputBuffer) {
50 // Super creates deserializer and reads header fields
53 event = (inputBuffer[0] & 0x80) != 0;
55 // Deserialize the fields
56 connection = deserializeUInt8();
57 result = deserializeBgApiResponse();
61 * 0 : the command was successful. Otherwise an error occurred
63 * BlueGiga API type is <i>BgApiResponse</i> - Java type is {@link BgApiResponse}
65 * @return the current result as {@link BgApiResponse}
67 public BgApiResponse getResult() {
72 public String toString() {
73 final StringBuilder builder = new StringBuilder();
74 builder.append("BlueGigaReadLongResponse [connection=");
75 builder.append(connection);
76 builder.append(", result=");
77 builder.append(result);
79 return builder.toString();