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.BlueGigaCommand;
19 * Class to implement the BlueGiga command <b>deleteBonding</b>.
21 * This command deletes a bonding from the local security database. There can be a maximum of 8
22 * bonded devices stored at the same time, and one of them must be deleted if you need bonding with
25 * This class provides methods for processing BlueGiga API commands.
27 * Note that this code is autogenerated. Manual changes may be overwritten.
29 * @author Chris Jackson - Initial contribution of Java code generator
32 public class BlueGigaDeleteBondingCommand extends BlueGigaCommand {
33 public static final int COMMAND_CLASS = 0x05;
34 public static final int COMMAND_METHOD = 0x02;
37 * Bonding handle of a device. This handle can be obtained for example from events like: Scan
38 * Response Status - If handle is 0xFF, all bondings will be deleted
40 * BlueGiga API type is <i>uint8</i> - Java type is {@link int}
45 * Bonding handle of a device. This handle can be obtained for example from events like: Scan
46 * Response Status - If handle is 0xFF, all bondings will be deleted
48 * @param handle the handle to set as {@link int}
50 public void setHandle(int handle) {
55 public int[] serialize() {
56 // Serialize the header
57 serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
59 // Serialize the fields
60 serializeUInt8(handle);
66 public String toString() {
67 final StringBuilder builder = new StringBuilder();
68 builder.append("BlueGigaDeleteBondingCommand [handle=");
69 builder.append(handle);
71 return builder.toString();