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
4package org.qtproject.qt.android.bluetooth;
5
6import android.bluetooth.BluetoothGattDescriptor;
7import android.os.Build;
8
9import java.util.UUID;
10
11public 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}
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
settings setValue("DataPump/bgcolor", color)