android.bluetooth
Class HeadsetBase
java.lang.Object
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.
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
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)
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)
Please submit a feedback, bug or feature