Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
BTGattDesc.java
Go to the documentation of this file.
1/**
2 * Author: Sven Gothel <sgothel@jausoft.com>
3 * Copyright (c) 2020 Gothel Software e.K.
4 * Copyright (c) 2020 ZAFENA AB
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sublicense, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be
15 * included in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 */
25
26package org.direct_bt;
27
28/**
29 * Representing a Gatt Characteristic Descriptor object from the GATT client perspective.
30 *
31 * A list of shared BTGattDesc instances is available from BTGattChar
32 * via BTGattChar::getDescriptors().
33 *
34 * See [Direct-BT Overview](namespaceorg_1_1direct__bt.html#details).
35 *
36 * BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.3 Characteristic Descriptor
37 *
38 * See {@link DBGattDesc.UUID16} for selected standard GATT descriptor numbers in UUID16 format
39 * and {@link BTUtils#toUUID128(String)} for their conversion to UUID128.
40 */
41public interface BTGattDesc extends BTObject
42{
43 /** Reads the value of this descriptor
44 * @return A vector<uchar> containing data from this descriptor
45 */
46 byte[] readValue();
47
48 /** Writes the value of this descriptor.
49 * @param[in] arg_value The data as vector<uchar>
50 * to be written packed in a GBytes struct
51 * @return TRUE if value was written succesfully
52 */
53 boolean writeValue(byte[] argValue) throws BTException;
54
55 /** Get the UUID of this descriptor.
56 * @return The 128 byte UUID of this descriptor, NULL if an error occurred
57 */
58 String getUUID();
59
60 /** Returns the characteristic to which this descriptor belongs to.
61 * @return The characteristic.
62 */
64
65 /** Returns the cached value of this descriptor, if any.
66 * @return The cached value of this descriptor.
67 */
68 byte[] getValue();
69
70 @Override
71 String toString();
72}
Representing a Gatt Characteristic object from the GATT client perspective.
Definition: BTGattChar.java:49
Representing a Gatt Characteristic Descriptor object from the GATT client perspective.
Definition: BTGattDesc.java:42
byte[] readValue()
Reads the value of this descriptor.
BTGattChar getCharacteristic()
Returns the characteristic to which this descriptor belongs to.
boolean writeValue(byte[] argValue)
Writes the value of this descriptor.
byte[] getValue()
Returns the cached value of this descriptor, if any.
String getUUID()
Get the UUID of this descriptor.