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;
17 import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
20 * Class to implement the BlueGiga command <b>update</b>.
22 * This command updates the connection parameters of a given connection. The parameters have
23 * the same meaning and follow the same rules as for the GAP class command: Connect Direct. If
24 * this command is issued at a master device, it will send parameter update request to the link
25 * layer. Bluetooth On the other hand if this command is issued at a slave device, it will send
26 * L2CAP connection parameter update request to the master, which may either accept or reject
27 * it. It will take an amount of time corresponding to at least six times the current connection
28 * interval before the new connection parameters will become active.
30 * This class provides methods for processing BlueGiga API commands.
32 * Note that this code is autogenerated. Manual changes may be overwritten.
34 * @author Chris Jackson - Initial contribution of Java code generator
37 public class BlueGigaUpdateResponse extends BlueGigaDeviceResponse {
38 public static int COMMAND_CLASS = 0x03;
39 public static int COMMAND_METHOD = 0x02;
42 * 0 : the update was successful. Non-zero: An error occurred.
44 * BlueGiga API type is <i>BgApiResponse</i> - Java type is {@link BgApiResponse}
46 private BgApiResponse result;
49 * Response constructor
51 public BlueGigaUpdateResponse(int[] inputBuffer) {
52 // Super creates deserializer and reads header fields
55 event = (inputBuffer[0] & 0x80) != 0;
57 // Deserialize the fields
58 connection = deserializeUInt8();
59 result = deserializeBgApiResponse();
63 * 0 : the update was successful. Non-zero: An error occurred.
65 * BlueGiga API type is <i>BgApiResponse</i> - Java type is {@link BgApiResponse}
67 * @return the current result as {@link BgApiResponse}
69 public BgApiResponse getResult() {
74 public String toString() {
75 final StringBuilder builder = new StringBuilder();
76 builder.append("BlueGigaUpdateResponse [connection=");
77 builder.append(connection);
78 builder.append(", result=");
79 builder.append(result);
81 return builder.toString();