Samsung Galaxy Tab を Bluetooth で ArduinoBT に接続しようとしています。
私のコード:
public void run()
{
if (adapter == null)
{
return;
}
device = adapter.getRemoteDevice(macAddress);
try {
socket = device.createRfcommSocketToServiceRecord(UUID.fromString("00001101-0000-1000-8000-00805F9B34FB"));
socket.connect();
} catch (Exception e) {
e.printStackTrace();
}
}
アプリケーションを起動すると、次のウィンドウが表示されます: http://i.stack.imgur.com/tlc3x.png
パスワードを書きます:0000
そして日食では、私は見ることができます:
02-05 19:14:36.828: V/BluetoothSocket.cpp(4952): connectNative
02-05 19:14:41.296: V/BluetoothSocket.cpp(4952): ...connect(52, RFCOMM) = 111 (errno 111)
02-05 19:14:41.296: W/System.err(4952): java.io.IOException: Connection refused
02-05 19:14:41.296: W/System.err(4952): at android.bluetooth.BluetoothSocket.connectNative(Native Method)
02-05 19:14:41.296: W/System.err(4952): at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:236)
02-05 19:14:41.296: W/System.err(4952): at iut.robot.BluetoothThread.run(BluetoothThread.java:38)
このアプリケーションを使用したときはわかりません: https://play.google.com/store/apps/details?id=mobi.dzs.android.BluetoothSPP&hl=fr 完全に機能しました。