PDA

View Full Version : BLUETTOTH some problem



mohapatrasandeep60
12th October 2017, 16:50
why rssi value is 0 in serviceInfo.device().rssi() where serviceInfo is of type QBluetoothServiceInfo &?

I had developed part of my application earlier. After virus in my windows partition, I formatted the system.
I had a part of earlier codebase.
But i doubt my new installation is behaving differently.
I am testing with BTChat example downloaded from QTDocs. But it is behaving differently.
I am using same app in 2 systems. In 1system it finds the other BT device. But in the other device it does not find the 1st one.Earlier both systems could find each other.

1 more problem,in the app that i developed- 1system is not showing the updation of screen containing rssi distance. It is the same system that does not find the other device in BTchat example. But I tried debugging my app. While debugging it shows rssi updates but not while in run mode.
2nd problem- In the other device rssi is always zero while therssi obtainedin 1st device in debug mode has a value and shows some distance

I debugged more to find that QBluetoothServiceDiscoveryAgent::serviceDiscovered (QBluetoothServiceInfo)(signal) is not called. So, rssi updation does not happen. Why does serviceDiscovered not called?any idea?

May be

localAdapters = QBluetoothLocalDevice::allDevices();
const QBluetoothAddress adapter2 = localAdapters.isEmpty() ? QBluetoothAddress() :localAdapters.at(currentAdapterIndex).address();

localAdapters.at(currentAdapterIndex).address();

m_discoveryAgent = new QBluetoothServiceDiscoveryAgent(adapter2);
connect(m_discoveryAgent, SIGNAL(serviceDiscovered(QBluetoothServiceInfo)),
this, SLOT(serviceDiscovered(QBluetoothServiceInfo)));

where currentAdapterIndex=0. failed.Is there any h/w issue related to bt adapter

summarising: 1>In both cases(my app and BTChat app) in laptop1 serviceDiscovered signal is not fired 2>in laptop 2 rssi=0; in laptop1 rssi is valid