English | Site Directory

Android - An Open Handset Alliance Project

org.bluez
public abstract class

org.bluez.BluetoothServiceNative

java.lang.Object
android.os.Binder IBinder
org.bluez.BluetoothServiceNative IBluetoothService

Summary

Constants

      Value  
String  PUBLISH_NAME    "org.bluez.bluetooth_service" 
Constants inherited from interface org.bluez.IBluetoothService
Constants inherited from interface android.os.IBinder

Fields

protected      EventLoop  mEventLoop   

Public Constructors

          BluetoothServiceNative()

Public Methods

        void  Cancel(Adapter adapter, String address)
This method is called during a bonding procedure with a remote device when the remote device cancels the PIN code entry (akin to the remote device doing the equivalent of cancelPin().
        void  Release()
This method might be obsoleted soon.
        void  Request(Adapter adapter, String address, PasskeyResponse resp)
This method is called during a bonding procedure with a remote device in order to request a PIN code entry from the user on the local device.
        IBinder  asBinder()
Retrieve the Binder object associated with this interface.
      static  IBluetoothService  asInterface(IBinder obj)
        void  cancelPin(String address)
      static  IBluetoothService  getBluetoothService()
        Manager  getManager()
        SDPClient  getSDPClient(Adapter adapter, String address)
        boolean  isBluetoothStarted()
        void  notifyBondingCreated(String address)
This method is called to notify the user of a successful bonding procedure.
        void  notifyBondingRemoved(String address)
This method is called to notify the user when a bonding to a remote device is removed.
        void  notifyDiscoveryCompleted()
        void  notifyDiscoveryStarted()
        void  notifyHeadsetConnected(String address)
        void  notifyHeadsetDisconnected(String address)
        void  notifyModeChanged(String adapter, String mode)
This method is called when the local adapter's mode changes (for example, when the adapter becomes discoverable when it was previously only connectable.) This may occur either in response to the user calling Adapter.setMode(), or in response to a timeout (for example, if the Adapter is set to discoverable mode for 1 minute, then it will revert to connectable mode automatically when a minute goes by, and this method will be called.).
        void  notifyNameChanged(String adapter, String name)
This method is called when the local adapter's name changes, which is always in response to the user calling Adapter.setName().
        void  notifyRemoteAliasChanged(String address, String alias)
This method is called when we change a remote device's alias.
        void  notifyRemoteAliasCleared(String address)
This method is called when we remove a remote device's alias.
        void  notifyRemoteClassUpdated(String address, int nClass)
This method is called when we learn of a new device's class (a 32-bit value encoding major, minor, and service classes of remove device.)
        void  notifyRemoteDeviceConnected(String address)
This method is called when a remote device connects to this device.
        void  notifyRemoteDeviceDisappeared(String address)
        void  notifyRemoteDeviceDisconnectRequested(String address)
This method is called when a remote device is about to disconnect from this device.
        void  notifyRemoteDeviceDisconnected(String address)
This method is called when a remote device disconnects from this device.
        void  notifyRemoteDeviceFound(String address, int nClass, short nRSSI)
        void  notifyRemoteNameFailed(String address)
This method is called during remote-device discovery, when we fail to retrieve a remote-device's user-friendly name.
        void  notifyRemoteNameUpdated(String address, String nClass)
This method is called when we learn of a new device's user-friendly name.
        boolean  onTransact(int code, Parcel data, Parcel reply, int flags)
Default implementation is a stub that returns false.
        void  setPin(String address, String pin)
        boolean  startBluetooth()
        boolean  stopBluetooth(boolean force)

Protected Methods

abstract        void  broadcastIntent(Intent intent)
Methods inherited from class android.os.Binder
Methods inherited from class java.lang.Object
Methods inherited from interface org.bluez.IBluetoothService
Methods inherited from interface android.os.IBinder
Methods inherited from interface android.os.IInterface

Details

Constants

public static final String PUBLISH_NAME

Constant Value: "org.bluez.bluetooth_service"

Fields

protected EventLoop mEventLoop

Public Constructors

public BluetoothServiceNative()

Public Methods

public void Cancel(Adapter adapter, String address)

This method is called during a bonding procedure with a remote device when the remote device cancels the PIN code entry (akin to the remote device doing the equivalent of cancelPin(). It is a signal to this device to not ask the user to enter a PIN.

Parameters

adapter Local-device Bluetooth adapter from which the PIN request is made
address Bluetooth address of remote device with which adapter is pairing

public void Release()

This method might be obsoleted soon. It is called to inform the user when a PasskeyAgent is released, but the definition of "released" is not clearly defined.

public void Request(Adapter adapter, String address, PasskeyResponse resp)

This method is called during a bonding procedure with a remote device in order to request a PIN code entry from the user on the local device. The returned PIN code is communicated through the PasskeyResponse interface, which is an opaque object as far as the user of PasskeyAgent is concerned. The PasskeyResponse object then takes care of sending the PIN code to the remote device.

Parameters

adapter Local-device Bluetooth adapter from which the PIN request is made
address Bluetooth address of remote device with which adapter is pairing
resp Opaque interface through which the user returns the PIN code, or informs the other side that the PIN code entry is canceled.

public IBinder asBinder()

Retrieve the Binder object associated with this interface. You must use this instead of a plain cast, so that proxy objects can return the correct result.

public static IBluetoothService asInterface(IBinder obj)

public void cancelPin(String address)

public static IBluetoothService getBluetoothService()

public Manager getManager()

public SDPClient getSDPClient(Adapter adapter, String address)

public boolean isBluetoothStarted()

public void notifyBondingCreated(String address)

This method is called to notify the user of a successful bonding procedure. Note the similarity with method notifyAuthenticationSucceeded(String). The latter informs the user of a successful authentication, which occurs immediately prior to the completion of bonding.

Parameters

address Bluetooth address of remote device.

public void notifyBondingRemoved(String address)

This method is called to notify the user when a bonding to a remote device is removed.

Parameters

address Bluetooth address of remote device.

public void notifyDiscoveryCompleted()

public void notifyDiscoveryStarted()

public void notifyHeadsetConnected(String address)

public void notifyHeadsetDisconnected(String address)

public void notifyModeChanged(String adapter, String mode)

This method is called when the local adapter's mode changes (for example, when the adapter becomes discoverable when it was previously only connectable.) This may occur either in response to the user calling Adapter.setMode(), or in response to a timeout (for example, if the Adapter is set to discoverable mode for 1 minute, then it will revert to connectable mode automatically when a minute goes by, and this method will be called.).

Parameters

adapter The String representation of the Adapter (e.g., "hci0")
mode The new Adapter mode. It is one of "discoverable", "connectable", or "off".

public void notifyNameChanged(String adapter, String name)

This method is called when the local adapter's name changes, which is always in response to the user calling Adapter.setName().

Parameters

adapter The String representation of the Adapter (e.g., "hci0")
name The new Adapter name.

public void notifyRemoteAliasChanged(String address, String alias)

This method is called when we change a remote device's alias. This is a local operation, so it happens only in response to calling setRemoteAlias(String, String).

Parameters

address Bluetooth address of remote device.
alias remote-device alias.

public void notifyRemoteAliasCleared(String address)

This method is called when we remove a remote device's alias. This is a local operation, so it happens only in response to calling clearRemoteAlias(String).

Parameters

address Bluetooth address of remote device.

public void notifyRemoteClassUpdated(String address, int nClass)

This method is called when we learn of a new device's class (a 32-bit value encoding major, minor, and service classes of remove device.)

Parameters

address Bluetooth address of remote device.
nClass remote-device class.

public void notifyRemoteDeviceConnected(String address)

This method is called when a remote device connects to this device. Note that this method does not tell us which adapter the connection arrived on, which is a limitation of the API, and will be fixed soon.

Parameters

address Bluetooth address of remote device.

public void notifyRemoteDeviceDisappeared(String address)

public void notifyRemoteDeviceDisconnectRequested(String address)

This method is called when a remote device is about to disconnect from this device. The actual disconnect will happen about 2 seconds later; this notification is meant to give higher-level code the ability to react to the coming disconnect.

Parameters

address Bluetooth address of remote device.

public void notifyRemoteDeviceDisconnected(String address)

This method is called when a remote device disconnects from this device. Note that this method does not tell us which adapter the connection arrived on, which is a limitation of the API, and will be fixed soon.

Parameters

address Bluetooth address of remote device.

public void notifyRemoteDeviceFound(String address, int nClass, short nRSSI)

public void notifyRemoteNameFailed(String address)

This method is called during remote-device discovery, when we fail to retrieve a remote-device's user-friendly name.

Parameters

address Bluetooth address of remote device.

public void notifyRemoteNameUpdated(String address, String nClass)

This method is called when we learn of a new device's user-friendly name.

Parameters

address Bluetooth address of remote device.
nClass remote-device name.

public boolean onTransact(int code, Parcel data, Parcel reply, int flags)

Default implementation is a stub that returns false. You will want to override this to do the appropriate unmarshalling of transactions. If you want to call this, call transact().

public void setPin(String address, String pin)

public boolean startBluetooth()

public boolean stopBluetooth(boolean force)

Protected Methods

protected abstract void broadcastIntent(Intent intent)

Build m5-rc15i - 10 Jun 2008 13:54