Class LocalBTDevice


  • public class LocalBTDevice
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      LocalBTDevice()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void authenticate​(java.lang.String deviceAddress, java.lang.String pin)
      Authenticate/pair the local device with the specified device
      void disconnect()  
      java.lang.String getBluetoothAddress()
      Return the address of the local device
      lejos.internal.io.NativeHCI.DeviceInfo getDeviceInfo()
      Return a structure providing information about the local device
      java.lang.String getFriendlyName()
      Return the name of the local device
      lejos.internal.io.NativeHCI.LocalVersion getLocalVersion()
      return a structure providing local version information
      java.util.Collection<RemoteBTDevice> getPairedDevices()
      Return a list of the devices we are paired with
      boolean getVisibility()
      return the current visibility of the device
      static boolean isPowerOn()
      Check to see if the device is currently powered on
      void removeDevice​(java.lang.String deviceAddress)
      Remove the specified device from the known/paired list
      java.util.Collection<RemoteBTDevice> search()
      Search for and return a list of Bluetooth devices.
      void setVisibility​(boolean visible)
      Set the visibility state of the device
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LocalBTDevice

        public LocalBTDevice()
    • Method Detail

      • search

        public java.util.Collection<RemoteBTDevice> search()
        Search for and return a list of Bluetooth devices.
        Returns:
        The found devices.
        Throws:
        java.io.IOException
      • getPairedDevices

        public java.util.Collection<RemoteBTDevice> getPairedDevices()
        Return a list of the devices we are paired with
        Returns:
        the list of paired devices
      • setVisibility

        public void setVisibility​(boolean visible)
        Set the visibility state of the device
        Parameters:
        visible - new visibility state
      • getVisibility

        public boolean getVisibility()
        return the current visibility of the device
        Returns:
        true if the device is visible
      • isPowerOn

        public static boolean isPowerOn()
        Check to see if the device is currently powered on
        Returns:
        true if the device is on
      • getBluetoothAddress

        public java.lang.String getBluetoothAddress()
        Return the address of the local device
        Returns:
        A string version of the Bluetooth device address
      • getFriendlyName

        public java.lang.String getFriendlyName()
        Return the name of the local device
        Returns:
        A string containing the device name
      • getDeviceInfo

        public lejos.internal.io.NativeHCI.DeviceInfo getDeviceInfo()
        Return a structure providing information about the local device
        Returns:
        local device information
      • getLocalVersion

        public lejos.internal.io.NativeHCI.LocalVersion getLocalVersion()
        return a structure providing local version information
        Returns:
        local version information
      • authenticate

        public void authenticate​(java.lang.String deviceAddress,
                                 java.lang.String pin)
        Authenticate/pair the local device with the specified device
        Parameters:
        deviceAddress - address of the device to pair with
        pin - Pin to use for pairing with the device
      • removeDevice

        public void removeDevice​(java.lang.String deviceAddress)
        Remove the specified device from the known/paired list
        Parameters:
        deviceAddress - address of the device to remove
      • disconnect

        public void disconnect()