diff options
Diffstat (limited to 'android')
3 files changed, 11 insertions, 0 deletions
diff --git a/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java b/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java index 207aef7613ec..1b8c044fcc06 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java +++ b/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java @@ -183,6 +183,8 @@ public class SelectorActivity extends SherlockActivity { } void doBindService() { + // This is what creates the first (only?) CommunicationService instance + // and calls its run() method (in another thread). Intent aIntent = new Intent(this, CommunicationService.class); startService(aIntent); bindService(aIntent, mConnection, Context.BIND_IMPORTANT); diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothClient.java b/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothClient.java index 49be8a3deaab..07a626f3803e 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothClient.java +++ b/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothClient.java @@ -36,6 +36,9 @@ public class BluetoothClient extends Client { Receiver aReceiver, boolean aBluetoothWasEnabled) throws IOException { super(aServer, aCommunicationService, aReceiver); + + Log.i(Globals.TAG, "BluetoothClient(" + aServer + ")"); + mAdapter = BluetoothAdapter.getDefaultAdapter(); mBluetoothWasEnabled = aBluetoothWasEnabled; if (!mBluetoothWasEnabled) { @@ -45,18 +48,21 @@ public class BluetoothClient extends Client { BluetoothDevice aDevice = mAdapter .getRemoteDevice(aServer.getAddress()); mAdapter.cancelDiscovery(); + // This is the "standard UUID for the Serial Port Profile". // I.e. the 16-bit SerialPort UUID 0x1101 inserted into the // Bluetooth BASE_UUID. See // https://www.bluetooth.org/Technical/AssignedNumbers/service_discovery.htm mSocket = aDevice.createRfcommSocketToServiceRecord(UUID .fromString("00001101-0000-1000-8000-00805F9B34FB")); + mSocket.connect(); Log.i(Globals.TAG, "BluetoothClient: connected"); mInputStream = mSocket.getInputStream(); mReader = new BufferedReader(new InputStreamReader(mInputStream, CHARSET)); + mOutputStream = mSocket.getOutputStream(); String aTemp = mReader.readLine(); diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/Server.java b/android/sdremote/src/org/libreoffice/impressremote/communication/Server.java index a09cc6ae2e1e..82172beb427b 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/communication/Server.java +++ b/android/sdremote/src/org/libreoffice/impressremote/communication/Server.java @@ -53,6 +53,9 @@ public class Server { return mTimeDiscovered; } + public String toString() { + return getClass().getName() + '@' + Integer.toHexString(hashCode()) + ":{" + mAddress + "," + mName + "}"; + } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |