btscanner example does not work, cannot find BLE host device
-
wrote on 15 Nov 2015, 02:32 last edited by
Hi,
I am a newbie working on BLE examples; however none of the BLE examples work on both of my desktop with CyPress BLE dongle and my laptop.
Could anyone help me and tell what is happening?
I did a little modification on the btscanner example, and here is my own codes:
QString localDeviceName;
QBluetoothAddress dongleAddress;
QBluetoothHostInfo dongleHostInfo;// Check if Bluetooth is available on this device QList<QBluetoothHostInfo> dongleHostInfoList = QBluetoothLocalDevice::allDevices(); if (dongleHostInfoList.count() > 1){ QStringList dongleNameStringList; for (int n=0; n<dongleHostInfoList.count(); n++){ dongleNameStringList << dongleHostInfoList.at(n).name(); } QString dongleNameString = QInputDialog::getItem(0, QString("Sen Dongle Select"), QString("Please select your BLE Dongle."), dongleNameStringList, 0, false); dongleAddress = dongleHostInfoList.at(dongleNameStringList.indexOf(dongleNameString)).address(); } else if(dongleHostInfoList.count() == 1){ dongleAddress = dongleHostInfoList.at(0).address(); }else { qDebug() << QString ("No Device Detected"); } localDevice = new QBluetoothLocalDevice(dongleAddress);
Unfortunately, I never find my BLE host device.
Please help me.
Thank you!
-
wrote on 15 Nov 2015, 17:21 last edited by
Hi Sen,
What is the OS you are running your code? Does the BT device work (in Linux commands like $hcitool dev; $hcitool scan). -
wrote on 15 Nov 2015, 18:24 last edited by mrdebug
Me too. I use the linux command line tools to scan and than Qt to manage the ble.
-
Hi Sen,
What is the OS you are running your code? Does the BT device work (in Linux commands like $hcitool dev; $hcitool scan). -
wrote on 16 Nov 2015, 07:56 last edited by
Yep It's not supported on Windows. Easiest is to use Ubuntu. You should be able to install it in for example VirtualBox and share the USB device there.
4/5