Class RemoteDevice


  • public class RemoteDevice
    extends java.lang.Object
    The RemoteDevice class represents a remote Bluetooth device. It provides basic information about a remote device including the device's Bluetooth address and its friendly name.
    Since:
    TotalCross 1.15
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected RemoteDevice​(java.lang.String address)
      Creates a Bluetooth device based upon its address.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getBluetoothAddress()
      Retrieves the Bluetooth address of this device.
      java.lang.String getFriendlyName()
      Returns the name of this device.
      java.lang.String toString()
      Returns a string representation of the object in the format "address - friendlyName".
      • Methods inherited from class java.lang.Object

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

      • RemoteDevice

        protected RemoteDevice​(java.lang.String address)
        Creates a Bluetooth device based upon its address. The Bluetooth address must be 12 hex characters long. Valid characters are 0-9, a-f, and A-F. There is no preceding "0x" in the string. For example, valid Bluetooth addresses include but are not limited to:
        008037144297
        00af8300cd0b
        014bd91DA8FC
        Parameters:
        address - the address of the Bluetooth device as a 12 character hex string
        Since:
        TotalCross 1.15
    • Method Detail

      • getFriendlyName

        public java.lang.String getFriendlyName()
                                         throws IOException
        Returns the name of this device. The Bluetooth specification calls this name the "Bluetooth device name" or the "user-friendly name".
        Returns:
        the name of the device, or null if the Bluetooth system does not support this feature; if the local device is able to contact the remote device, the result will never be null; if the remote device does not have a name then an empty string will be returned
        Throws:
        IOException
        Since:
        TotalCross 1.15
      • getBluetoothAddress

        public java.lang.String getBluetoothAddress()
        Retrieves the Bluetooth address of this device. The Bluetooth address will be 12 characters long. Valid characters are 0-9 and A-F. This method will never return null.
        Returns:
        the Bluetooth address of the remote device
        Since:
        TotalCross 1.15
      • toString

        public java.lang.String toString()
        Returns a string representation of the object in the format "address - friendlyName".
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of the object in the format "address - friendlyName"
        Since:
        TotalCross 1.30