2 * Copyright (c) 2010-2022 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>passkeyDisplayEvent</b>.
21 * This event tells a passkey should be printed to the user for bonding. This passkey must be
22 * entered in the remote device for bonding to be successful.
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 BlueGigaPasskeyDisplayEvent extends BlueGigaResponse {
32 public static int COMMAND_CLASS = 0x05;
33 public static int COMMAND_METHOD = 0x02;
36 * Bluetooth connection handle
38 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
43 * Passkey range: 000000-999999
45 * BlueGiga API type is <i>uint32</i> - Java type is {@link long}
52 public BlueGigaPasskeyDisplayEvent(int[] inputBuffer) {
53 // Super creates deserializer and reads header fields
56 event = (inputBuffer[0] & 0x80) != 0;
58 // Deserialize the fields
59 handle = deserializeUInt8();
60 passkey = deserializeUInt32();
64 * Bluetooth connection handle
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 * Passkey range: 000000-999999
77 * BlueGiga API type is <i>uint32</i> - Java type is {@link long}
79 * @return the current passkey as {@link long}
81 public long getPasskey() {
86 public String toString() {
87 final StringBuilder builder = new StringBuilder();
88 builder.append("BlueGigaPasskeyDisplayEvent [handle=");
89 builder.append(handle);
90 builder.append(", passkey=");
91 builder.append(passkey);
93 return builder.toString();