IT. Expert System.

Android Reference

BluetoothHealth


android.bluetooth

Class BluetoothHealth

    • Field Detail

      • SOURCE_ROLE

        public static final int SOURCE_ROLE
        Health Profile Source Role - the health device.
        See Also:
        Constant Field Values
      • SINK_ROLE

        public static final int SINK_ROLE
        Health Profile Sink Role the device talking to the health device.
        See Also:
        Constant Field Values
      • CHANNEL_TYPE_RELIABLE

        public static final int CHANNEL_TYPE_RELIABLE
        Health Profile - Channel Type used - Reliable
        See Also:
        Constant Field Values
      • CHANNEL_TYPE_STREAMING

        public static final int CHANNEL_TYPE_STREAMING
        Health Profile - Channel Type used - Streaming
        See Also:
        Constant Field Values
      • HEALTH_OPERATION_SUCCESS

        public static final int HEALTH_OPERATION_SUCCESS
        See Also:
        Constant Field Values
      • HEALTH_OPERATION_INVALID_ARGS

        public static final int HEALTH_OPERATION_INVALID_ARGS
        See Also:
        Constant Field Values
      • HEALTH_OPERATION_GENERIC_FAILURE

        public static final int HEALTH_OPERATION_GENERIC_FAILURE
        See Also:
        Constant Field Values
      • HEALTH_OPERATION_NOT_FOUND

        public static final int HEALTH_OPERATION_NOT_FOUND
        See Also:
        Constant Field Values
      • HEALTH_OPERATION_NOT_ALLOWED

        public static final int HEALTH_OPERATION_NOT_ALLOWED
        See Also:
        Constant Field Values
      • STATE_CHANNEL_DISCONNECTED

        public static final int STATE_CHANNEL_DISCONNECTED
        Health Channel Connection State - Disconnected
        See Also:
        Constant Field Values
      • STATE_CHANNEL_CONNECTING

        public static final int STATE_CHANNEL_CONNECTING
        Health Channel Connection State - Connecting
        See Also:
        Constant Field Values
      • STATE_CHANNEL_CONNECTED

        public static final int STATE_CHANNEL_CONNECTED
        Health Channel Connection State - Connected
        See Also:
        Constant Field Values
      • STATE_CHANNEL_DISCONNECTING

        public static final int STATE_CHANNEL_DISCONNECTING
        Health Channel Connection State - Disconnecting
        See Also:
        Constant Field Values
      • APP_CONFIG_REGISTRATION_SUCCESS

        public static final int APP_CONFIG_REGISTRATION_SUCCESS
        Health App Configuration registration success
        See Also:
        Constant Field Values
      • APP_CONFIG_REGISTRATION_FAILURE

        public static final int APP_CONFIG_REGISTRATION_FAILURE
        Health App Configuration registration failure
        See Also:
        Constant Field Values
      • APP_CONFIG_UNREGISTRATION_SUCCESS

        public static final int APP_CONFIG_UNREGISTRATION_SUCCESS
        Health App Configuration un-registration success
        See Also:
        Constant Field Values
      • APP_CONFIG_UNREGISTRATION_FAILURE

        public static final int APP_CONFIG_UNREGISTRATION_FAILURE
        Health App Configuration un-registration failure
        See Also:
        Constant Field Values
    • Method Detail

      • registerSinkAppConfiguration

        public boolean registerSinkAppConfiguration(String name,
                                           int dataType,
                                           BluetoothHealthCallback callback)
        Register an application configuration that acts as a Health SINK. This is the configuration that will be used to communicate with health devices which will act as the SOURCE_ROLE. This is an asynchronous call and so the callback is used to notify success or failure if the function returns true.

        Requires android.Manifest.permission#BLUETOOTH permission.

        Parameters:
        name - The friendly name associated with the application or configuration.
        dataType - The dataType of the Source role of Health Profile to which the sink wants to connect to.
        callback - A callback to indicate success or failure of the registration and all operations done on this application configuration.
        Returns:
        If true, callback will be called.
      • registerAppConfiguration

        public boolean registerAppConfiguration(String name,
                                       int dataType,
                                       int role,
                                       int channelType,
                                       BluetoothHealthCallback callback)
        Register an application configuration that acts as a Health SINK or in a Health SOURCE role.This is an asynchronous call and so the callback is used to notify success or failure if the function returns true.

        Requires android.Manifest.permission#BLUETOOTH permission.

        Parameters:
        name - The friendly name associated with the application or configuration.
        dataType - The dataType of the Source role of Health Profile.
        channelType - The channel type. Will be one of CHANNEL_TYPE_RELIABLE or CHANNEL_TYPE_STREAMING
        callback - - A callback to indicate success or failure.
        Returns:
        If true, callback will be called.
      • connectChannelToSource

        public boolean connectChannelToSource(BluetoothDevice device,
                                     BluetoothHealthAppConfiguration config)
        Connect to a health device which has the SOURCE_ROLE. This is an asynchronous call. If this function returns true, the callback associated with the application configuration will be called.

        Requires android.Manifest.permission#BLUETOOTH permission.

        Parameters:
        device - The remote Bluetooth device.
        config - The application configuration which has been registered using registerSinkAppConfiguration(String, int, BluetoothHealthCallback)
        Returns:
        If true, the callback associated with the application config will be called.
      • connectChannelToSink

        public boolean connectChannelToSink(BluetoothDevice device,
                                   BluetoothHealthAppConfiguration config,
                                   int channelType)
        Connect to a health device which has the SINK_ROLE. This is an asynchronous call. If this function returns true, the callback associated with the application configuration will be called.

        Requires android.Manifest.permission#BLUETOOTH permission.

        Parameters:
        device - The remote Bluetooth device.
        config - The application configuration which has been registered using registerSinkAppConfiguration(String, int, BluetoothHealthCallback)
        Returns:
        If true, the callback associated with the application config will be called.
      • disconnectChannel

        public boolean disconnectChannel(BluetoothDevice device,
                                BluetoothHealthAppConfiguration config,
                                int channelId)
        Disconnect a connected health channel. This is an asynchronous call. If this function returns true, the callback associated with the application configuration will be called.

        Requires android.Manifest.permission#BLUETOOTH permission.

        Parameters:
        device - The remote Bluetooth device.
        config - The application configuration which has been registered using registerSinkAppConfiguration(String, int, BluetoothHealthCallback)
        channelId - The channel id associated with the channel
        Returns:
        If true, the callback associated with the application config will be called.
      • getMainChannelFd

        public ParcelFileDescriptor getMainChannelFd(BluetoothDevice device,
                                            BluetoothHealthAppConfiguration config)
        Get the file descriptor of the main channel associated with the remote device and application configuration.

        Requires android.Manifest.permission#BLUETOOTH permission.

        Its the responsibility of the caller to close the ParcelFileDescriptor when done.

        Parameters:
        device - The remote Bluetooth health device
        config - The application configuration
        Returns:
        null on failure, ParcelFileDescriptor on success.
      • getConnectedDevices

        public List<BluetoothDevice> getConnectedDevices()
        Get connected devices for the health profile.

        Return the set of devices which are in state BluetoothProfile.STATE_CONNECTED

        Requires android.Manifest.permission#BLUETOOTH permission. This is not specific to any application configuration but represents the connection state of the local Bluetooth adapter for this profile. This can be used by applications like status bar which would just like to know the state of the local adapter.

        Specified by:
        getConnectedDevices in interface BluetoothProfile
        Returns:
        List of devices. The list will be empty on error.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 520 / . Delta: 0.03871 с