1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
LibQQt/examples/qqtnetworkexample/quserbluetoothprotocol.cpp
tianduanrui 2eb2179196 update
2017-11-27 20:15:23 +08:00

25 lines
679 B
C++

#include "quserbluetoothprotocol.h"
#include "qqtsocketbluetoothclient.h"
#include "qqtbluetoothmanager.h"
QUserBluetoothProtocol::QUserBluetoothProtocol ( QObject* parent ) : QObject ( parent )
{
}
QQtSocketBluetoothClient* QQtUserBluetoothClientInstance ( QObject* parent )
{
static QQtSocketBluetoothClient* cli = nullptr;
if ( !cli )
{
QQtBluetoothManager* inst = QQtBluetoothManager::Instance ( parent );
inst->getDeviceList().first().address();
cli = new QQtSocketBluetoothClient ( QBluetoothServiceInfo::RfcommProtocol, parent );
cli->setServiceAddress ( inst->getDeviceList().first().address() );
}
return cli;
}