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
devicediscoverybroadcastreceiver.cpp File Reference

(7cdef8fa3b370dab0c7ec27262c7aa28f28c11a4)

#include "android/devicediscoverybroadcastreceiver_p.h"
#include <QCoreApplication>
#include <QtCore/QtEndian>
#include <QtCore/QLoggingCategory>
#include <QtBluetooth/QBluetoothAddress>
#include <QtBluetooth/QBluetoothDeviceInfo>
#include <QtBluetooth/QBluetoothUuid>
#include "android/jni_android_p.h"
#include <QtCore/QHash>
#include <QtCore/qbitarray.h>
#include <algorithm>
+ Include dependency graph for devicediscoverybroadcastreceiver.cpp:

Go to the source code of this file.

Classes

struct  MajorClassJavaToQtMapping
 
struct  MinorClassJavaToQtMapping
 

Typedefs

typedef QHash< jint, QBluetoothDeviceInfo::MajorDeviceClassJCachedMajorTypes
 
typedef QHash< jint, quint8JCachedMinorTypes
 

Enumerations

enum  ADType {
  ADType16BitUuidIncomplete = 0x02 , ADType16BitUuidComplete = 0x03 , ADType32BitUuidIncomplete = 0x04 , ADType32BitUuidComplete = 0x05 ,
  ADType128BitUuidIncomplete = 0x06 , ADType128BitUuidComplete = 0x07 , ADTypeShortenedLocalName = 0x08 , ADTypeCompleteLocalName = 0x09 ,
  ADTypeServiceData16Bit = 0x16 , ADTypeServiceData32Bit = 0x20 , ADTypeServiceData128Bit = 0x21 , ADTypeManufacturerSpecificData = 0xff
}
 

Functions

static QBitArray initializeMinorCaches ()
 
 Q_GLOBAL_STATIC_WITH_ARGS (QBitArray, initializedCacheTracker,(initializeMinorCaches())) static const char javaBluetoothDeviceClassName[]
 
QBluetoothDeviceInfo::CoreConfigurations qtBtTypeForJavaBtType (jint javaType)
 
QBluetoothDeviceInfo::MajorDeviceClass resolveAndroidMajorClass (jint javaType)
 
int mappingIndexForMajor (QBluetoothDeviceInfo::MajorDeviceClass major)
 
void triggerCachingOfMinorsForMajor (QBluetoothDeviceInfo::MajorDeviceClass major)
 
quint8 resolveAndroidMinorClass (QBluetoothDeviceInfo::MajorDeviceClass major, jint javaMinor)
 

Variables

QT_BEGIN_NAMESPACE typedef QHash< jint, QBluetoothDeviceInfo::CoreConfigurations > JCachedBtTypes
 
static const char javaBluetoothClassDeviceMajorClassName [] = "android/bluetooth/BluetoothClass$Device$Major"
 
static const char javaBluetoothClassDeviceClassName [] = "android/bluetooth/BluetoothClass$Device"
 
static const char javaDeviceTypeClassic [] = "DEVICE_TYPE_CLASSIC"
 
static const char javaDeviceTypeDual [] = "DEVICE_TYPE_DUAL"
 
static const char javaDeviceTypeLE [] = "DEVICE_TYPE_LE"
 
static const char javaDeviceTypeUnknown [] = "DEVICE_TYPE_UNKNOWN"
 
static constexpr MajorClassJavaToQtMapping majorMappings []
 
static constexpr quint8 minorIndexSizes []
 
static const MinorClassJavaToQtMapping minorMappings []
 

Typedef Documentation

◆ JCachedMajorTypes

◆ JCachedMinorTypes

typedef QHash<jint, quint8> JCachedMinorTypes

Definition at line 26 of file devicediscoverybroadcastreceiver.cpp.

Enumeration Type Documentation

◆ ADType

enum ADType
Enumerator
ADType16BitUuidIncomplete 
ADType16BitUuidComplete 
ADType32BitUuidIncomplete 
ADType32BitUuidComplete 
ADType128BitUuidIncomplete 
ADType128BitUuidComplete 
ADTypeShortenedLocalName 
ADTypeCompleteLocalName 
ADTypeServiceData16Bit 
ADTypeServiceData32Bit 
ADTypeServiceData128Bit 
ADTypeManufacturerSpecificData 

Definition at line 208 of file devicediscoverybroadcastreceiver.cpp.

Function Documentation

◆ initializeMinorCaches()

◆ mappingIndexForMajor()

int mappingIndexForMajor ( QBluetoothDeviceInfo::MajorDeviceClass major)

Definition at line 294 of file devicediscoverybroadcastreceiver.cpp.

References QBluetoothDeviceInfo::HealthDevice, Q_ASSERT, and QBluetoothDeviceInfo::UncategorizedDevice.

Referenced by resolveAndroidMinorClass(), and triggerCachingOfMinorsForMajor().

+ Here is the caller graph for this function:

◆ Q_GLOBAL_STATIC_WITH_ARGS()

Q_GLOBAL_STATIC_WITH_ARGS ( QBitArray ,
initializedCacheTracker ,
(initializeMinorCaches())  ) const

◆ qtBtTypeForJavaBtType()

QBluetoothDeviceInfo::CoreConfigurations qtBtTypeForJavaBtType ( jint javaType)

◆ resolveAndroidMajorClass()

QBluetoothDeviceInfo::MajorDeviceClass resolveAndroidMajorClass ( jint javaType)

Definition at line 258 of file devicediscoverybroadcastreceiver.cpp.

References QSet< T >::find(), it, javaBluetoothClassDeviceMajorClassName, majorMappings, qCWarning, and QBluetoothDeviceInfo::UncategorizedDevice.

+ Here is the call graph for this function:

◆ resolveAndroidMinorClass()

quint8 resolveAndroidMinorClass ( QBluetoothDeviceInfo::MajorDeviceClass major,
jint javaMinor )

Definition at line 326 of file devicediscoverybroadcastreceiver.cpp.

References at, QSet< T >::find(), it, mappingIndexForMajor(), and triggerCachingOfMinorsForMajor().

+ Here is the call graph for this function:

◆ triggerCachingOfMinorsForMajor()

void triggerCachingOfMinorsForMajor ( QBluetoothDeviceInfo::MajorDeviceClass major)

Definition at line 308 of file devicediscoverybroadcastreceiver.cpp.

References javaBluetoothClassDeviceClassName, mappingIndexForMajor(), minorIndexSizes, minorMappings, and Q_ASSERT.

Referenced by resolveAndroidMinorClass().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ javaBluetoothClassDeviceClassName

const char javaBluetoothClassDeviceClassName[] = "android/bluetooth/BluetoothClass$Device"
static

Definition at line 61 of file devicediscoverybroadcastreceiver.cpp.

Referenced by triggerCachingOfMinorsForMajor().

◆ javaBluetoothClassDeviceMajorClassName

const char javaBluetoothClassDeviceMajorClassName[] = "android/bluetooth/BluetoothClass$Device$Major"
static

Definition at line 60 of file devicediscoverybroadcastreceiver.cpp.

Referenced by resolveAndroidMajorClass().

◆ javaDeviceTypeClassic

const char javaDeviceTypeClassic[] = "DEVICE_TYPE_CLASSIC"
static

Definition at line 64 of file devicediscoverybroadcastreceiver.cpp.

Referenced by qtBtTypeForJavaBtType().

◆ javaDeviceTypeDual

const char javaDeviceTypeDual[] = "DEVICE_TYPE_DUAL"
static

Definition at line 65 of file devicediscoverybroadcastreceiver.cpp.

Referenced by qtBtTypeForJavaBtType().

◆ javaDeviceTypeLE

const char javaDeviceTypeLE[] = "DEVICE_TYPE_LE"
static

Definition at line 66 of file devicediscoverybroadcastreceiver.cpp.

Referenced by qtBtTypeForJavaBtType().

◆ javaDeviceTypeUnknown

const char javaDeviceTypeUnknown[] = "DEVICE_TYPE_UNKNOWN"
static

Definition at line 67 of file devicediscoverybroadcastreceiver.cpp.

Referenced by qtBtTypeForJavaBtType().

◆ JCachedBtTypes

QT_BEGIN_NAMESPACE typedef QHash<jint, QBluetoothDeviceInfo::CoreConfigurations> JCachedBtTypes

Definition at line 21 of file devicediscoverybroadcastreceiver.cpp.

◆ majorMappings

constexpr MajorClassJavaToQtMapping majorMappings[]
staticconstexpr
Initial value:
= {
}

Definition at line 76 of file devicediscoverybroadcastreceiver.cpp.

Referenced by resolveAndroidMajorClass().

◆ minorIndexSizes

constexpr quint8 minorIndexSizes[]
staticconstexpr
Initial value:
= {
64,
61,
18,
35,
62,
0,
56,
63,
49,
42,
26,
}

Definition at line 92 of file devicediscoverybroadcastreceiver.cpp.

Referenced by triggerCachingOfMinorsForMajor().

◆ minorMappings

const MinorClassJavaToQtMapping minorMappings[]
static