From 2e32a78eadfe8b98d89a376b8ccbea52e32a749c Mon Sep 17 00:00:00 2001 From: Katie McCormick Date: Tue, 3 Jan 2012 16:32:34 -0800 Subject: Doc change: Adding Bluetooth HDP info. Change-Id: Icdc19ed9ea09422ac2ea01c03b4a569d8ae94121 --- docs/html/guide/topics/wireless/bluetooth.jd | 119 ++++++++++++++++++++++++++- 1 file changed, 115 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/html/guide/topics/wireless/bluetooth.jd b/docs/html/guide/topics/wireless/bluetooth.jd index 0af1d2c..067cd30 100644 --- a/docs/html/guide/topics/wireless/bluetooth.jd +++ b/docs/html/guide/topics/wireless/bluetooth.jd @@ -29,6 +29,7 @@ other devices
  • Working with Profiles
    1. Vendor-specific AT commands +
    2. Health Device Profile
  • @@ -43,6 +44,7 @@ other devices

    Related samples

    1. Bluetooth Chat
    2. +
    3. Bluetooth HDP (Health Device Profile)
    @@ -132,11 +134,27 @@ Headset and Hands-Free (v1.5) profiles. audio can be streamed from one device to another over a Bluetooth connection. "A2DP" stands for Advanced Audio Distribution Profile. -
    {@link android.bluetooth.BluetoothProfile.ServiceListener}
    +
    {@link android.bluetooth.BluetoothHealth}
    +
    Represents a Health Device Profile proxy that controls the Bluetooth service.
    + +
    {@link android.bluetooth.BluetoothHealthCallback}
    + +
    An abstract class that you use to implement {@link +android.bluetooth.BluetoothHealth} callbacks. You must extend this class and +implement the callback methods to receive updates about changes in the +application’s registration state and Bluetooth channel state.
    + +
    {@link android.bluetooth.BluetoothHealthAppConfiguration}
    + +
    Represents an application configuration that the Bluetooth Health third-party +application registers to communicate with a remote Bluetooth health +device.
    + +
    {@link android.bluetooth.BluetoothProfile.ServiceListener}
    An interface that notifies {@link android.bluetooth.BluetoothProfile} IPC clients when they have been connected to or disconnected from the service (that -is, the internal service that runs a particular profile).
    +is, the internal service that runs a particular profile). @@ -889,7 +907,7 @@ Bluetooth Headset Service via interprocess communication (IPC). This includes both Bluetooth Headset and Hands-Free (v1.5) profiles. The {@link android.bluetooth.BluetoothHeadset} class includes support for AT commands. -For more discussion of this topic, see Vendor-specific AT commands +For more discussion of this topic, see Vendor-specific AT commands
  • A2DP. The Advanced Audio Distribution Profile (A2DP) profile defines how high quality audio can be streamed from one device to @@ -897,6 +915,17 @@ another over a Bluetooth connection. Android provides the {@link android.bluetooth.BluetoothA2dp} class, which is a proxy for controlling the Bluetooth A2DP Service via IPC.
  • +
  • Health Device. Android 4.0 (API level 14) introduces +support for the Bluetooth Health Device Profile (HDP). This lets you create +applications that use Bluetooth to communicate with health devices that support +Bluetooth, such as heart-rate monitors, blood meters, thermometers, scales, and +so on. For a list of supported devices and their corresponding device data +specialization codes, refer to Bluetooth Assigned Numbers at www.bluetooth.org. Note that these values +are also referenced in the ISO/IEEE 11073-20601 [7] specification as +MDC_DEV_SPEC_PROFILE_* in the Nomenclature Codes Annex. For more discussion of +HDP, see Health Device Profile.
  • +

    Here are the basic steps for working with a profile:

    @@ -925,7 +954,9 @@ to the profile proxy object. state of the connection and perform other operations that are relevant to that profile. -

    For example, this code snippet shows how to connect to a {@link android.bluetooth.BluetoothHeadset} proxy object so that you can control the + +

    For example, this code snippet shows how to connect to a {@link +android.bluetooth.BluetoothHeadset} proxy object so that you can control the Headset profile:

    BluetoothHeadset mBluetoothHeadset;
    @@ -955,6 +986,8 @@ private BluetoothProfile.ServiceListener mProfileListener = new BluetoothProfile
     mBluetoothAdapter.closeProfileProxy(mBluetoothHeadset);
     
    + +

    Vendor-specific AT commands

    Starting in Android 3.0, applications can register to receive system @@ -964,3 +997,81 @@ broadcasts that indicate a connected device's battery level and could notify the user or take other action as needed. Create a broadcast receiver for the {@link android.bluetooth.BluetoothHeadset#ACTION_VENDOR_SPECIFIC_HEADSET_EVENT} intent to handle vendor-specific AT commands for the headset.

    + +

    Health Device Profile

    + +

    Android 4.0 (API level 14) introduces support for the Bluetooth Health Device +Profile (HDP). This lets you create applications that use Bluetooth to +communicate with health devices that support Bluetooth, such as heart-rate +monitors, blood meters, thermometers, and scales. The Bluetooth Health API +includes the classes {@link android.bluetooth.BluetoothHealth}, {@link +android.bluetooth.BluetoothHealthCallback}, and {@link +android.bluetooth.BluetoothHealthAppConfiguration}, which are described in The Basics.

    + +

    In using the Bluetooth Health API, it's helpful to understand these key HDP concepts:

    + + + + + + + + + + + + + + + + + + + + + + + + +
    ConceptDescription
    SourceA role defined in HDP. A source is a health device that +transmits medical data (weight scale, glucose meter, thermometer, etc.) to a +smart device such as an Android phone or tablet.
    SinkA role defined in HDP. In HDP, a sink is the smart device that +receives the medical data. In an Android HDP application, the sink is +represented by a {@link android.bluetooth.BluetoothHealthAppConfiguration} +object.
    RegistrationRefers to registering a sink for a particular health device.
    ConnectionRefers to opening a channel between a health device and a smart device +such as an Android phone or tablet.
    + +

    Creating an HDP Application

    + +

    Here are the basic steps involved in creating an Android HDP application:

    +
      + +
    1. Get a reference to the {@link android.bluetooth.BluetoothHealth} proxy +object.

      Similar to regular headset and A2DP profile devices, you must call +{@link android.bluetooth.BluetoothAdapter#getProfileProxy getProfileProxy()} +with a {@link android.bluetooth.BluetoothProfile.ServiceListener} and the {@link +android.bluetooth.BluetoothProfile.ServiceListener#HEALTH} profile type to +establish a connection with the profile proxy object.

    2. + +
    3. Create a {@link android.bluetooth.BluetoothHealthCallback} and register an +application configuration +({@link android.bluetooth.BluetoothHealthAppConfiguration}) +that acts as a health +sink.
    4. + +
    5. Establish a connection to a health device. Some devices will initiate the +connection. It is unnecessary to carry out this step for those devices.
    6. + +
    7. When connected successfully to a health device, read/write to the health +device using the file descriptor.

      The received data needs to be interpreted +using a health manager which implements the IEEE 11073-xxxxx +specifications.

    8. + +
    9. When done, close the health channel and unregister the application. The +channel also closes when there is extended inactivity.
    10. +
    + +

    For a complete code sample that illustrates these steps, see Bluetooth HDP (Health +Device Profile).

    \ No newline at end of file -- cgit v1.1