Bluetooth Service Discovery



  • Hi,

    I am trying to discover a custom service from Bluetooth of Android phone but I am unable to discover it.
    However I am able to discover it by running QT app as Desktop Application on Linux(Ubuntu)

        QList<QBluetoothHostInfo> localAdapters;
    
        QBluetoothAddress adapter = QBluetoothAddress();
        //m_ServiceInfo=new QBluetoothServiceInfo();
        m_hBandDisAgent=new QBluetoothServiceDiscoveryAgent();
        m_bluetoothSocket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol);
    
      Q_ASSUME(connect(m_hBandDisAgent, SIGNAL(serviceDiscovered(QBluetoothServiceInfo)),this, SLOT(serviceDiscovered(QBluetoothServiceInfo))));
     m_hBandDisAgent->setRemoteAddress(QBluetoothAddress("B8:27:EB:54:81:BE"));
        m_hBandDisAgent->start(m_hBandDisAgent->DiscoveryMode::FullDiscovery);
    

    Regards,
    Avtansh Sharma


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.