it.gerdavax.android.bluetooth
Interface BluetoothSocket


public interface BluetoothSocket

This interfaces models a RFComm connection to an assigned port to to a remote device. BluetoothSocket instances are obtained invoking public BluetoothSocket openSocket(int port) method on RemoteBluetoothDevice

Author:
Stefano Sanna - gerdavax@gmail.com - http://www.gerdavax.it

Method Summary
 void closeSocket()
          Closes this socket.
 java.io.InputStream getInputStream()
          Gets the InputStream
 java.io.OutputStream getOutputStream()
          Gets the OutputStream
 int getPort()
          Gets the remote port (channel) connected through this socket
 RemoteBluetoothDevice getRemoteBluetoothDevice()
          Gets the RemoteBluetoothDevice instance that owns this socket
 

Method Detail

getRemoteBluetoothDevice

RemoteBluetoothDevice getRemoteBluetoothDevice()
Gets the RemoteBluetoothDevice instance that owns this socket

Returns:
the RemoteBluetoothDevice which opened this socket

getPort

int getPort()
Gets the remote port (channel) connected through this socket

Returns:
the port to which this socket is connected

getInputStream

java.io.InputStream getInputStream()
                                   throws java.lang.Exception
Gets the InputStream

Returns:
the InputStream of this socket
Throws:
java.lang.Exception

getOutputStream

java.io.OutputStream getOutputStream()
                                     throws java.lang.Exception
Gets the OutputStream

Returns:
Throws:
java.lang.Exception

closeSocket

void closeSocket()
Closes this socket. Input and output stream will be no longer available.