Package lejos.hardware
Class LocalBTDevice
- java.lang.Object
-
- lejos.hardware.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 voidauthenticate(java.lang.String deviceAddress, java.lang.String pin)Authenticate/pair the local device with the specified devicevoiddisconnect()java.lang.StringgetBluetoothAddress()Return the address of the local devicelejos.internal.io.NativeHCI.DeviceInfogetDeviceInfo()Return a structure providing information about the local devicejava.lang.StringgetFriendlyName()Return the name of the local devicelejos.internal.io.NativeHCI.LocalVersiongetLocalVersion()return a structure providing local version informationjava.util.Collection<RemoteBTDevice>getPairedDevices()Return a list of the devices we are paired withbooleangetVisibility()return the current visibility of the devicestatic booleanisPowerOn()Check to see if the device is currently powered onvoidremoveDevice(java.lang.String deviceAddress)Remove the specified device from the known/paired listjava.util.Collection<RemoteBTDevice>search()Search for and return a list of Bluetooth devices.voidsetVisibility(boolean visible)Set the visibility state of the device
-
-
-
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 withpin- 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()
-
-