关于BLE开发的问题
-
关于Qt 开发BLE的资料很少,目前有个问题,已经连上蓝牙设备,但是连接服务总没反应。求解!
connect(discoveryAgent, SIGNAL(deviceDiscovered(QBluetoothDeviceInfo)), this, SLOT(onFindBLEMachine(QBluetoothDeviceInfo)));
连接设备后出发槽函数:
void CBLEService::onFindBLEMachine(const QBluetoothDeviceInfo &info){
m_controller = new QLowEnergyController(m_bleDevInfo,this);
connect(m_controller, SIGNAL(connected()), this, SLOT(onBLEConnected()));
connect(m_controller, SIGNAL(error(QLowEnergyController::Error)), this, SLOT(errorReceived(QLowEnergyController::Error)));
connect(m_controller, SIGNAL(disconnected()), this, SLOT(deviceDisconnected()));
connect(m_controller, SIGNAL(serviceDiscovered(QBluetoothUuid)), this, SLOT(onServiceDiscovered(QBluetoothUuid)));
m_controller->connectToDevice();
}
这里connect调试过程都没有问题,但是不能触发上面任何槽的函数。不知道是为什么!