Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QtBluetoothGattDescriptor.java
Go to the documentation of this file.
1
// Copyright (C) 2023 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
package
org.qtproject.qt.android.bluetooth;
5
6
import
android.bluetooth.BluetoothGattDescriptor;
7
import
android.os.Build;
8
9
import
java.util.UUID;
10
11
public
class
QtBluetoothGattDescriptor
extends
BluetoothGattDescriptor {
12
public
QtBluetoothGattDescriptor
(UUID uuid,
int
permissions) {
13
super(uuid, permissions);
14
}
15
// Starting from API 33 Android Bluetooth deprecates descriptor local value caching by
16
// deprecating the getValue() and setValue() accessors. For peripheral role we store the value
17
// locally in the descriptor as a convenience - looking up the value on the C++ side would
18
// be somewhat complicated. This should be safe as all accesses to this class are synchronized.
19
// For clarity: For API levels below 33 we still need to use the setValue() of the base class
20
// because Android internally uses getValue() with APIs below 33.
21
public
boolean
setLocalValue
(
byte
[]
value
) {
22
if
(Build.VERSION.SDK_INT >= 33) {
23
m_localValue =
value
;
24
return
true
;
25
}
else
{
26
return
setValue
(
value
);
27
}
28
}
29
30
public
byte
[]
getLocalValue
()
31
{
32
if
(Build.VERSION.SDK_INT >= 33)
33
return
m_localValue;
34
else
35
return
getValue();
36
}
37
38
private
byte
[] m_localValue =
null
;
39
}
org.qtproject.qt.android.bluetooth.QtBluetoothGattDescriptor
Definition
QtBluetoothGattDescriptor.java:11
org.qtproject.qt.android.bluetooth.QtBluetoothGattDescriptor.setLocalValue
boolean setLocalValue(byte[] value)
Definition
QtBluetoothGattDescriptor.java:21
org.qtproject.qt.android.bluetooth.QtBluetoothGattDescriptor.QtBluetoothGattDescriptor
QtBluetoothGattDescriptor(UUID uuid, int permissions)
Definition
QtBluetoothGattDescriptor.java:12
org.qtproject.qt.android.bluetooth.QtBluetoothGattDescriptor.getLocalValue
byte[] getLocalValue()
Definition
QtBluetoothGattDescriptor.java:30
value
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
Definition
qeglstreamconvenience_p.h:46
setValue
settings setValue("DataPump/bgcolor", color)
qtconnectivity
src
android
bluetooth
src
org
qtproject
qt
android
bluetooth
QtBluetoothGattDescriptor.java
Generated by
1.10.0