Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
devicediscoverybroadcastreceiver.cpp File Reference

(263134ea87bf39d44e8c082500b54f28a73a84a4)

#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 ,
  ADType16BitUuidIncomplete = 0x02 , ADType16BitUuidComplete = 0x03 , ADType32BitUuidIncomplete = 0x04 , ADType32BitUuidComplete = 0x05 ,
  ADType128BitUuidIncomplete = 0x06 , ADType128BitUuidComplete = 0x07 , ADTypeShortenedLocalName = 0x08 , ADTypeCompleteLocalName = 0x09 ,
  ADTypeServiceData16Bit = 0x16 , ADTypeServiceData32Bit = 0x20 , ADTypeServiceData128Bit = 0x21 , ADTypeManufacturerSpecificData = 0xff
}
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 ,
  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[] = "android/bluetooth/BluetoothDevice"
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 27 of file devicediscoverybroadcastreceiver.cpp.

Enumeration Type Documentation

◆ ADType [1/2]

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

Definition at line 209 of file devicediscoverybroadcastreceiver.cpp.

◆ ADType [2/2]

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

Definition at line 209 of file devicediscoverybroadcastreceiver.cpp.

Function Documentation

◆ initializeMinorCaches()

QBitArray initializeMinorCaches ( )
static

Definition at line 30 of file devicediscoverybroadcastreceiver.cpp.

◆ mappingIndexForMajor()

int mappingIndexForMajor ( QBluetoothDeviceInfo::MajorDeviceClass major)

Definition at line 295 of file devicediscoverybroadcastreceiver.cpp.

◆ Q_GLOBAL_STATIC_WITH_ARGS()

Q_GLOBAL_STATIC_WITH_ARGS ( QBitArray ,
initializedCacheTracker ,
(initializeMinorCaches())  ) const = "android/bluetooth/BluetoothDevice"

◆ qtBtTypeForJavaBtType()

QBluetoothDeviceInfo::CoreConfigurations qtBtTypeForJavaBtType ( jint javaType)

Definition at line 225 of file devicediscoverybroadcastreceiver.cpp.

◆ resolveAndroidMajorClass()

QBluetoothDeviceInfo::MajorDeviceClass resolveAndroidMajorClass ( jint javaType)

◆ resolveAndroidMinorClass()

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

Definition at line 327 of file devicediscoverybroadcastreceiver.cpp.

◆ triggerCachingOfMinorsForMajor()

void triggerCachingOfMinorsForMajor ( QBluetoothDeviceInfo::MajorDeviceClass major)

Definition at line 309 of file devicediscoverybroadcastreceiver.cpp.

References minorMappings.

Variable Documentation

◆ javaBluetoothClassDeviceClassName

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

Definition at line 62 of file devicediscoverybroadcastreceiver.cpp.

◆ javaBluetoothClassDeviceMajorClassName

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

Definition at line 61 of file devicediscoverybroadcastreceiver.cpp.

Referenced by resolveAndroidMajorClass().

◆ javaDeviceTypeClassic

const char javaDeviceTypeClassic = "DEVICE_TYPE_CLASSIC"
static

Definition at line 65 of file devicediscoverybroadcastreceiver.cpp.

◆ javaDeviceTypeDual

const char javaDeviceTypeDual = "DEVICE_TYPE_DUAL"
static

Definition at line 66 of file devicediscoverybroadcastreceiver.cpp.

◆ javaDeviceTypeLE

const char javaDeviceTypeLE = "DEVICE_TYPE_LE"
static

Definition at line 67 of file devicediscoverybroadcastreceiver.cpp.

◆ javaDeviceTypeUnknown

const char javaDeviceTypeUnknown = "DEVICE_TYPE_UNKNOWN"
static

Definition at line 68 of file devicediscoverybroadcastreceiver.cpp.

◆ JCachedBtTypes

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

Definition at line 22 of file devicediscoverybroadcastreceiver.cpp.

◆ majorMappings

constexpr MajorClassJavaToQtMapping majorMappings
staticconstexpr
Initial value:
= {
}

Definition at line 77 of file devicediscoverybroadcastreceiver.cpp.

◆ minorIndexSizes

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

Definition at line 93 of file devicediscoverybroadcastreceiver.cpp.

◆ minorMappings

const MinorClassJavaToQtMapping minorMappings
static