]> git.basschouten.com Git - openhab-addons.git/blob
917dd407b7391de9ddd8566af67508e6135d581a
[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.attributedb;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse;
17
18 /**
19  * Class to implement the BlueGiga command <b>userReadResponse</b>.
20  * <p>
21  * This command is used to respond to an attribute Read request by a remote device, but only for
22  * attributes which have been configured with the user property. Attributes which have the
23  * user property enabled allow the attribute value to be requested from the application
24  * instead of the Smart stack automatically responding with Bluetooth the data in it's local
25  * GATT database. This command is normally used in response to a User Read Request event, which
26  * is generated when a remote device tries to read an attribute with a user property enabled. The
27  * response to User Read Request events must happen within 30 seconds or otherwise a timeout
28  * will occur.
29  * <p>
30  * This class provides methods for processing BlueGiga API commands.
31  * <p>
32  * Note that this code is autogenerated. Manual changes may be overwritten.
33  *
34  * @author Chris Jackson - Initial contribution of Java code generator
35  */
36 @NonNullByDefault
37 public class BlueGigaUserReadResponseResponse extends BlueGigaResponse {
38     public static int COMMAND_CLASS = 0x02;
39     public static int COMMAND_METHOD = 0x03;
40
41     /**
42      * Response constructor
43      */
44     public BlueGigaUserReadResponseResponse(int[] inputBuffer) {
45         // Super creates deserializer and reads header fields
46         super(inputBuffer);
47
48         event = (inputBuffer[0] & 0x80) != 0;
49
50         // Deserialize the fields
51     }
52
53     @Override
54     public String toString() {
55         return "BlueGigaUserReadResponseResponse []";
56     }
57 }