Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
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
class
QtBluetoothGattDescriptor
extends
BluetoothGattDescriptor {
12
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
@SuppressWarnings(
"deprecation"
)
22
boolean setLocalValue(
byte
[]
value
) {
23
if
(Build.VERSION.SDK_INT >= 33) {
24
m_localValue = value;
25
return true;
26
}
else
{
27
return setValue(value);
28
}
29
}
30
31
@SuppressWarnings(
"deprecation"
)
32
byte[] getLocalValue()
33
{
34
if
(Build.VERSION.SDK_INT >= 33)
35
return
m_localValue;
36
else
37
return
getValue();
38
}
39
40
private
byte
[] m_localValue =
null
;
41
}
value
EGLOutputLayerEXT EGLint EGLAttrib value
[3]
Definition
qeglstreamconvenience_p.h:46
qtconnectivity
src
android
bluetooth
src
org
qtproject
qt
android
bluetooth
QtBluetoothGattDescriptor.java
Generated on
for Qt by
1.18.0