title: Use Qt Bluetooth on android to connect to an arduino
body: <p>I work on a project where I need to connect both arduino Uno and tablet Android via Bluetooth.</p>
  
  <p>I search for two weeks now how to do it with the Qt library. 
  For the moment I use a custom library ( <a href="http://qt-project.org/forums/viewreply/193094/" rel="nofollow">http://qt-project.org/forums/viewreply/193094/</a> ) but this library doesn't have any signal, so I must use a timer to check if data are on the serial buffer.</p>
  
  <p>I'd like to use the "official" Qt library to get access to the signals/slots system.</p>
  
  <p>For the moment I try to set-up my arduino as master and slave, and android according, but nothing work.
  What I want to achieve on android :</p>
  
  <p>Start app</p>
  
  <p>Connect to an already paired arduino (know adress)</p>
  
  <p>Get a signal when message is received from the arduino board</p>
  
  <p>A thing I wanted to do is to use a QBluetoothSocket to connect to the arduino (arduino as slave, android as server) but QBluetoothSocket seem to work only on slave mode for android. And the QBluetoothServer can't let me connect to the arduino from my Qt app.</p>
  
  <p>Thanks for help !</p>
  
  <p>EDIT : I try this :</p>
  
  <pre><code>    socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol);
  qDebug() &lt;&lt; "Socket créé";
  socket-&gt;connectToService(QBluetoothAddress("00:13:EF:00:06:4F"), QBluetoothUuid(serviceUuid), QIODevice::ReadWrite);
  qDebug() &lt;&lt; "Tentative de connection";
  </code></pre>
  
  <p>But I got this : </p>
  
  <blockquote>
    <p>W/System.err( 4861): java.io.IOException: Service discovery failed
    W/System.err( 4861):    at android.bluetooth.BluetoothSocket$SdpHelper.doSdp(BluetoothSocket.java:462)
    W/System.err( 4861):    at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:240)
    W/System.err( 4861):    at dalvik.system.NativeStart.run(Native Method)
    W/Qt      ( 4861): (null):0 ((null)): qt.bluetooth.android: Falling back to workaround.
    W/Qt      ( 4861): (null):0 ((null)): qt.bluetooth.android: Using found rfcomm channel -1
    W/Qt      ( 4861): (null):0 ((null)): qt.bluetooth.android: Invoke Resulted with error.</p>
  </blockquote>