我正在尝试与Qt5建立蓝牙配对应用程序。我想要对一个HID设备,它有默认的引脚1234(比如说),我想在我的应用程序中输入这个引脚。
QBluetoothLocalDevice localDevice;
localDevice.requestPairing(address, QBluetoothLocalDevice::Paired);
connect(&localDevice, SIGNAL(pairingDisplayPinCode(QBluetoothAddress,QString)),
this, SLOT(displayPinCode(QBluetoothAddress,QString)));
connect(&localDevice, SIGNAL(pairingDisplayConfirmation(QBluetoothAddress,QString)),
this, SLOT(displayParingConfirmation(QBluetoothAddress,QString)));
void BluetoothDevice::displayPinCode(const QBluetoothAddress &address, QString pin)
{
localDevice.pairingConfirmation(true);
}
void BluetoothDevice::displayParingConfirmation(const QBluetoothAddress &address, QString pin)
{
localDevice.pairingConfirmation(true);
}
这段代码发出一些随机的引脚。是否有任何规定,以输入一个针和对设备使用该别针。提前谢谢。(我使用的是Ubuntu 14.10)
发布于 2015-07-23 05:50:09
请参考这里中列出的下列文件
bluetoothagentadaptor.cpp
bluetoothagentadaptor.h
bluetoothbaseagent.cpp
bluetoothbaseagent.h
https://stackoverflow.com/questions/29507453
复制相似问题