<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Unable to connect to bluetooth device]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I am using btscanner qt example to connect to other bluetooth device to transfer data.<br />
Currently the example contains only displaying of bluetooth device and upon selecting the device we will get all the services provided by the remote device.<br />
I added my code to create an rfcomm connection inside addService function of service.cpp</p>
<p dir="auto">Code is as follows:</p>
<p dir="auto">socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol);<br />
qDebug() &lt;&lt; serviceInfo.serviceUuid();<br />
if(socket != NULL)<br />
{<br />
qDebug() &lt;&lt; "Create socket" &lt;&lt; serviceInfo.device().address().toString();<br />
socket-&gt;connectToService(serviceInfo.device().address(), QBluetoothUuid(QBluetoothUuid::ObexObjectPush));<br />
qDebug() &lt;&lt; "ConnectToService done";</p>
<pre><code>   connect(socket, SIGNAL(readyRead()), this, SLOT(readSocket()));
</code></pre>
<p dir="auto">connect(socket, SIGNAL(connected()), this, SLOT(connected()));<br />
connect(socket, SIGNAL(disconnected()), this, SLOT(disconnected()));<br />
with this code i am getting proper selected bluetooth device name but the serviceUUid is all zeros.</p>
<p dir="auto">and also i get the error saying qt.bluetooth.android: device is offline.</p>
<p dir="auto">later i change serviceDiscoveryAgent.start() function to serviceDiscoveryAgent.start(QBluetoothServiceDiiscoveryAgent::DiscoveryMode::FullDiscovery)</p>
<p dir="auto">this time i get the same result but the error is " qt.bluetooth.android: unknown host state "</p>
<p dir="auto">I am running the code in qt 5.5.<br />
I am flashing the apk on nexus 7 tablet and samsung mobile. am getting same result.<br />
I am assuming that i am missing to add certain code but unable to find</p>
<p dir="auto">Any solutions ?<br />
Thank you.</p>
]]></description><link>https://forum.qt.io/topic/59916/unable-to-connect-to-bluetooth-device</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 08:02:44 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/59916.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 21 Oct 2015 05:55:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Unable to connect to bluetooth device on Wed, 21 Oct 2015 22:43:32 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Please don't post the same question in multiple sub-forums, one is enough.</p>
<p dir="auto"><a href="https://forum.qt.io/topic/59917">Duplicate</a></p>
<p dir="auto">Closing this one.</p>
]]></description><link>https://forum.qt.io/post/294698</link><guid isPermaLink="true">https://forum.qt.io/post/294698</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Wed, 21 Oct 2015 22:43:32 GMT</pubDate></item></channel></rss>