IT. Expert System.

Android Reference

BluetoothTestUtils


android.bluetooth

Class BluetoothTestUtils



  • public class BluetoothTestUtils
    extends Assert
    • Constructor Detail

      • BluetoothTestUtils

        public BluetoothTestUtils(Context context,
                          String tag)
        Creates a utility instance for testing Bluetooth.
        Parameters:
        context - The context of the application using the utility.
        tag - The log tag of the application using the utility.
      • BluetoothTestUtils

        public BluetoothTestUtils(Context context,
                          String tag,
                          String outputFile)
        Creates a utility instance for testing Bluetooth.
        Parameters:
        context - The context of the application using the utility.
        tag - The log tag of the application using the utility.
        outputFile - The path to an output file if the utility is to write results to a separate file.
    • Method Detail

      • close

        public void close()
        Closes the utility instance and unregisters any BroadcastReceivers.
      • enable

        public void enable(BluetoothAdapter adapter)
        Enables Bluetooth and checks to make sure that Bluetooth was turned on and that the correct actions were broadcast.
        Parameters:
        adapter - The BT adapter.
      • disable

        public void disable(BluetoothAdapter adapter)
        Disables Bluetooth and checks to make sure that Bluetooth was turned off and that the correct actions were broadcast.
        Parameters:
        adapter - The BT adapter.
      • discoverable

        public void discoverable(BluetoothAdapter adapter)
        Puts the local device into discoverable mode and checks to make sure that the local device is in discoverable mode and that the correct actions were broadcast.
        Parameters:
        adapter - The BT adapter.
      • undiscoverable

        public void undiscoverable(BluetoothAdapter adapter)
        Puts the local device into connectable only mode and checks to make sure that the local device is in in connectable mode and that the correct actions were broadcast.
        Parameters:
        adapter - The BT adapter.
      • startScan

        public void startScan(BluetoothAdapter adapter)
        Starts a scan for remote devices and checks to make sure that the local device is scanning and that the correct actions were broadcast.
        Parameters:
        adapter - The BT adapter.
      • stopScan

        public void stopScan(BluetoothAdapter adapter)
        Stops a scan for remote devices and checks to make sure that the local device is not scanning and that the correct actions were broadcast.
        Parameters:
        adapter - The BT adapter.
      • enablePan

        public void enablePan(BluetoothAdapter adapter)
        Enables PAN tethering on the local device and checks to make sure that tethering is enabled.
        Parameters:
        adapter - The BT adapter.
      • disablePan

        public void disablePan(BluetoothAdapter adapter)
        Disables PAN tethering on the local device and checks to make sure that tethering is disabled.
        Parameters:
        adapter - The BT adapter.
      • pair

        public void pair(BluetoothAdapter adapter,
                BluetoothDevice device,
                int passkey,
                byte[] pin)
        Initiates a pairing with a remote device and checks to make sure that the devices are paired and that the correct actions were broadcast.
        Parameters:
        adapter - The BT adapter.
        device - The remote device.
        passkey - The pairing passkey if pairing requires a passkey. Any value if not.
        pin - The pairing pin if pairing requires a pin. Any value if not.
      • acceptPair

        public void acceptPair(BluetoothAdapter adapter,
                      BluetoothDevice device,
                      int passkey,
                      byte[] pin)
        Accepts a pairing with a remote device and checks to make sure that the devices are paired and that the correct actions were broadcast.
        Parameters:
        adapter - The BT adapter.
        device - The remote device.
        passkey - The pairing passkey if pairing requires a passkey. Any value if not.
        pin - The pairing pin if pairing requires a pin. Any value if not.
      • unpair

        public void unpair(BluetoothAdapter adapter,
                  BluetoothDevice device)
        Deletes a pairing with a remote device and checks to make sure that the devices are unpaired and that the correct actions were broadcast.
        Parameters:
        adapter - The BT adapter.
        device - The remote device.
      • connectProfile

        public void connectProfile(BluetoothAdapter adapter,
                          BluetoothDevice device,
                          int profile,
                          String methodName)
        Connects a profile from the local device to a remote device and checks to make sure that the profile is connected and that the correct actions were broadcast.
        Parameters:
        adapter - The BT adapter.
        device - The remote device.
        profile - The profile to connect. One of BluetoothProfile.A2DP, BluetoothProfile.HEADSET, or BluetoothProfile.INPUT_DEVICE.
        methodName - The method name to printed in the logs. If null, will be "connectProfile(profile=<profile>, device=<device>)"
      • disconnectProfile

        public void disconnectProfile(BluetoothAdapter adapter,
                             BluetoothDevice device,
                             int profile,
                             String methodName)
        Disconnects a profile between the local device and a remote device and checks to make sure that the profile is disconnected and that the correct actions were broadcast.
        Parameters:
        adapter - The BT adapter.
        device - The remote device.
        profile - The profile to disconnect. One of BluetoothProfile.A2DP, BluetoothProfile.HEADSET, or BluetoothProfile.INPUT_DEVICE.
        methodName - The method name to printed in the logs. If null, will be "connectProfile(profile=<profile>, device=<device>)"
      • connectPan

        public void connectPan(BluetoothAdapter adapter,
                      BluetoothDevice device)
        Connects the PANU to a remote NAP and checks to make sure that the PANU is connected and that the correct actions were broadcast.
        Parameters:
        adapter - The BT adapter.
        device - The remote device.
      • incomingPanConnection

        public void incomingPanConnection(BluetoothAdapter adapter,
                                 BluetoothDevice device)
        Checks that a remote PANU connects to the local NAP correctly and that the correct actions were broadcast.
        Parameters:
        adapter - The BT adapter.
        device - The remote device.
      • disconnectPan

        public void disconnectPan(BluetoothAdapter adapter,
                         BluetoothDevice device)
        Disconnects the PANU from a remote NAP and checks to make sure that the PANU is disconnected and that the correct actions were broadcast.
        Parameters:
        adapter - The BT adapter.
        device - The remote device.
      • incomingPanDisconnection

        public void incomingPanDisconnection(BluetoothAdapter adapter,
                                    BluetoothDevice device)
        Checks that a remote PANU disconnects from the local NAP correctly and that the correct actions were broadcast.
        Parameters:
        adapter - The BT adapter.
        device - The remote device.
      • writeOutput

        public void writeOutput(String s)
        Writes a string to the logcat and a file if a file has been specified in the constructor.
        Parameters:
        s - The string to be written.


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: 244 / 159176748. Delta: 0.04681 с