Build 1.0_r1(from source)

android.bluetooth
Class HeadsetBase

java.lang.Object
  extended by android.bluetooth.HeadsetBase

public class HeadsetBase
extends Object

The Android Bluetooth API is not finalized, and *will* change. Use at your own risk. The base RFCOMM (service) connection for a headset or handsfree device. In the future this class will be removed.


Field Summary
static int DIRECTION_INCOMING
           
static int DIRECTION_OUTGOING
           
protected  AtParser mAtParser
           
static int RFCOMM_DISCONNECTED
           
 
Constructor Summary
HeadsetBase(PowerManager pm, BluetoothDevice bluetooth, String address, int rfcommChannel)
           
HeadsetBase(PowerManager pm, BluetoothDevice bluetooth, String address, int socketFd, int rfcommChannel, Handler handler)
           
 
Method Summary
 boolean connect(Handler handler)
           
 boolean connectAsync()
           
 void disconnect()
           
protected  void finalize()
          Called by the virtual machine when there are no longer any (non-weak) references to the receiver.
 String getAddress()
           
 AtParser getAtParser()
           
 long getConnectTimestamp()
           
 int getDirection()
           
 String getName()
           
 int getRemainingAsyncConnectWaitingTimeMs()
           
protected  void handleInput(String input)
           
protected  void initializeAtParser()
          Register AT commands that are common to all Headset / Handsets.
 boolean isConnected()
           
 boolean sendURC(String urc)
           
 void startEventThread()
           
 int waitForAsyncConnect(int timeout_ms, Handler handler)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RFCOMM_DISCONNECTED

public static final int RFCOMM_DISCONNECTED
See Also:
Constant Field Values

DIRECTION_INCOMING

public static final int DIRECTION_INCOMING
See Also:
Constant Field Values

DIRECTION_OUTGOING

public static final int DIRECTION_OUTGOING
See Also:
Constant Field Values

mAtParser

protected AtParser mAtParser
Constructor Detail

HeadsetBase

public HeadsetBase(PowerManager pm,
                   BluetoothDevice bluetooth,
                   String address,
                   int rfcommChannel)

HeadsetBase

public HeadsetBase(PowerManager pm,
                   BluetoothDevice bluetooth,
                   String address,
                   int socketFd,
                   int rfcommChannel,
                   Handler handler)
Method Detail

finalize

protected void finalize()
                 throws Throwable
Description copied from class: Object
Called by the virtual machine when there are no longer any (non-weak) references to the receiver. Subclasses can use this facility to guarantee that any associated resources are cleaned up before the receiver is garbage collected. Uncaught exceptions which are thrown during the running of the method cause it to terminate immediately, but are otherwise ignored.

Note: The virtual machine assumes that the implementation in class Object is empty.

Overrides:
finalize in class Object
Throws:
Throwable - The virtual machine ignores any exceptions which are thrown during finalization.

handleInput

protected void handleInput(String input)

initializeAtParser

protected void initializeAtParser()
Register AT commands that are common to all Headset / Handsets. This function is called by the HeadsetBase constructor.


getAtParser

public AtParser getAtParser()

startEventThread

public void startEventThread()

connect

public boolean connect(Handler handler)

connectAsync

public boolean connectAsync()

getRemainingAsyncConnectWaitingTimeMs

public int getRemainingAsyncConnectWaitingTimeMs()

waitForAsyncConnect

public int waitForAsyncConnect(int timeout_ms,
                               Handler handler)

disconnect

public void disconnect()

isConnected

public boolean isConnected()

getAddress

public String getAddress()

getName

public String getName()

getDirection

public int getDirection()

getConnectTimestamp

public long getConnectTimestamp()

sendURC

public boolean sendURC(String urc)

Build 1.0_r1(from source)

Please submit a feedback, bug or feature