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.security;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
17 import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse;
20 * Class to implement the BlueGiga command <b>encryptStart</b>.
22 * This command starts the encryption for a given connection.
24 * This class provides methods for processing BlueGiga API commands.
26 * Note that this code is autogenerated. Manual changes may be overwritten.
28 * @author Chris Jackson - Initial contribution of Java code generator
31 public class BlueGigaEncryptStartResponse extends BlueGigaResponse {
32 public static final int COMMAND_CLASS = 0x05;
33 public static final int COMMAND_METHOD = 0x00;
38 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
43 * 0 : the encryption was started successfully
45 * BlueGiga API type is <i>BgApiResponse</i> - Java type is {@link BgApiResponse}
47 private BgApiResponse result;
50 * Response constructor
52 public BlueGigaEncryptStartResponse(int[] inputBuffer) {
53 // Super creates deserializer and reads header fields
56 event = (inputBuffer[0] & 0x80) != 0;
58 // Deserialize the fields
59 handle = deserializeUInt8();
60 result = deserializeBgApiResponse();
66 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
68 * @return the current handle as {@link int}
70 public int getHandle() {
75 * 0 : the encryption was started successfully
77 * BlueGiga API type is <i>BgApiResponse</i> - Java type is {@link BgApiResponse}
79 * @return the current result as {@link BgApiResponse}
81 public BgApiResponse getResult() {
86 public String toString() {
87 final StringBuilder builder = new StringBuilder();
88 builder.append("BlueGigaEncryptStartResponse [handle=");
89 builder.append(handle);
90 builder.append(", result=");
91 builder.append(result);
93 return builder.toString();