// SPDX-License-Identifier: GPL-2.0 #ifndef BTDISCOVERY_H #define BTDISCOVERY_H #include #include #include #if defined(BT_SUPPORT) #include #include #include struct btVendorProduct { QBluetoothDeviceInfo btdi; int vendorIdx; int productIdx; }; #endif #if defined(Q_OS_ANDROID) #include #include #endif class BTDiscovery : public QObject { Q_OBJECT public: BTDiscovery(QObject *parent = NULL); ~BTDiscovery(); static BTDiscovery *instance(); #if defined(BT_SUPPORT) struct btPairedDevice { QBluetoothAddress address; QString name; }; void btDeviceDiscovered(const QBluetoothDeviceInfo &device); #if defined(Q_OS_ANDROID) void getBluetoothDevices(); #endif QList getBtDcs(); #endif private: static BTDiscovery *m_instance; #if defined(BT_SUPPORT) QList btDCs; #endif #if defined(Q_OS_ANDROID) bool checkException(const char* method, const QAndroidJniObject* obj); #endif #if defined(BT_SUPPORT) QList btPairedDevices; QBluetoothLocalDevice localBtDevice; QBluetoothDeviceDiscoveryAgent *discoveryAgent; #endif signals: void dcVendorChanged(); void dcProductChanged(); void dcBtChanged(); }; #endif // BTDISCOVERY_H