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;
19 * Class to implement the BlueGiga command <b>bondStatusEvent</b>.
21 * This event outputs bonding status information.
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 BlueGigaBondStatusEvent extends BlueGigaResponse {
31 public static int COMMAND_CLASS = 0x05;
32 public static int COMMAND_METHOD = 0x04;
37 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
42 * Encryption key size used in long-term key
44 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
49 * Was Man-in-the-Middle mode was used in pairing. 0: No MITM used. 1: MITM was used
51 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
56 * Keys stored for bonding. See: Bonding Keys
58 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
65 public BlueGigaBondStatusEvent(int[] inputBuffer) {
66 // Super creates deserializer and reads header fields
69 event = (inputBuffer[0] & 0x80) != 0;
71 // Deserialize the fields
72 bond = deserializeUInt8();
73 keysize = deserializeUInt8();
74 mitm = deserializeUInt8();
75 keys = deserializeUInt8();
81 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
83 * @return the current bond as {@link int}
85 public int getBond() {
90 * Encryption key size used in long-term key
92 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
94 * @return the current keysize as {@link int}
96 public int getKeysize() {
101 * Was Man-in-the-Middle mode was used in pairing. 0: No MITM used. 1: MITM was used
103 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
105 * @return the current mitm as {@link int}
107 public int getMitm() {
112 * Keys stored for bonding. See: Bonding Keys
114 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
116 * @return the current keys as {@link int}
118 public int getKeys() {
123 public String toString() {
124 final StringBuilder builder = new StringBuilder();
125 builder.append("BlueGigaBondStatusEvent [bond=");
126 builder.append(bond);
127 builder.append(", keysize=");
128 builder.append(keysize);
129 builder.append(", mitm=");
130 builder.append(mitm);
131 builder.append(", keys=");
132 builder.append(keys);
134 return builder.toString();