]> git.basschouten.com Git - openhab-addons.git/blob
36f3328cff537ceaf2f624c68e539b8258b67922
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.bluetooth.bluegiga.internal.command.attributeclient;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand;
17
18 /**
19  * Class to implement the BlueGiga command <b>indicateConfirm</b>.
20  * <p>
21  * This command can be used to send an acknowledge a received indication from a remote device.
22  * This function allows the application to manually confirm the indicated values instead of
23  * the smart stack Bluetooth automatically doing it. The benefit of this is extra reliability
24  * since the application can for example store the received value on the flash memory before
25  * confirming the indication to the remote device.
26  * <p>
27  * This class provides methods for processing BlueGiga API commands.
28  * <p>
29  * Note that this code is autogenerated. Manual changes may be overwritten.
30  *
31  * @author Chris Jackson - Initial contribution of Java code generator
32  */
33 @NonNullByDefault
34 public class BlueGigaIndicateConfirmCommand extends BlueGigaDeviceCommand {
35     public static final int COMMAND_CLASS = 0x04;
36     public static final int COMMAND_METHOD = 0x07;
37
38     @Override
39     public int[] serialize() {
40         // Serialize the header
41         serializeHeader(COMMAND_CLASS, COMMAND_METHOD);
42
43         // Serialize the fields
44         serializeUInt8(connection);
45
46         return getPayload();
47     }
48
49     @Override
50     public String toString() {
51         final StringBuilder builder = new StringBuilder();
52         builder.append("BlueGigaIndicateConfirmCommand [connection=");
53         builder.append(connection);
54         builder.append(']');
55         return builder.toString();
56     }
57 }