com.sewoo.port.android
Class BluetoothPort

java.lang.Object
  extended by com.sewoo.port.android.BluetoothPort
All Implemented Interfaces:
PortInterface

public class BluetoothPort
extends java.lang.Object
implements PortInterface

Bluetooth Interface.

Since:
1.04

Method Summary
 void connect(android.bluetooth.BluetoothDevice device)
          Connect the interface to the destination address.
 void connect(java.lang.String address)
          Connect the interface to the destination address.
 void disconnect()
          Disconnect the current connection.
 java.io.InputStream getInputStream()
          Get a InputStream.
static BluetoothPort getInstance()
          Get a instance of Bluetooth class.
 java.io.OutputStream getOutputStream()
          Get a OutputStream.
 boolean isConnected()
          Get a status that the interface were connected.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static BluetoothPort getInstance()
Get a instance of Bluetooth class.

Returns:
BluetoothPort

connect

public void connect(java.lang.String address)
             throws java.io.IOException
Description copied from interface: PortInterface
Connect the interface to the destination address.

Specified by:
connect in interface PortInterface
Throws:
java.io.IOException

disconnect

public void disconnect()
                throws java.io.IOException
Description copied from interface: PortInterface
Disconnect the current connection.

Specified by:
disconnect in interface PortInterface
Throws:
java.io.IOException

connect

public void connect(android.bluetooth.BluetoothDevice device)
             throws java.io.IOException
Connect the interface to the destination address.

Parameters:
device - BluetoothDevice
Throws:
java.io.IOException

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Description copied from interface: PortInterface
Get a InputStream.

Specified by:
getInputStream in interface PortInterface
Returns:
InputStream, null (if not connected.)
Throws:
java.io.IOException

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Description copied from interface: PortInterface
Get a OutputStream.

Specified by:
getOutputStream in interface PortInterface
Returns:
OutputStream, null (if not connected.)
Throws:
java.io.IOException

isConnected

public boolean isConnected()
Description copied from interface: PortInterface
Get a status that the interface were connected.

Specified by:
isConnected in interface PortInterface
Returns:
Interface whether connected or not.