|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.intel.bluetooth.RemoteDeviceHelper
public abstract class RemoteDeviceHelper
Implementation of RemoteDevice. Instance of RemoteDevice can be created by User. BlueCove internaly should use only RemoteDeviceHelper class to create RemoteDevice instances.
Your application should not use this class directly to be JSR-82 compatible. The exceptions are authenticate(RemoteDevice device, String passkey) and removeAuthentication(RemoteDevice device).
Method Summary | |
---|---|
static boolean |
authenticate(RemoteDevice device)
Attempts to authenticate RemoteDevice. |
static boolean |
authenticate(RemoteDevice device,
String passkey)
Sends an authentication request to a remote Bluetooth device. |
static int |
connectedDevices()
Count number of device that have open connections to or from them. |
static String |
formatBluetoothAddress(String address)
|
static long |
getAddress(String bluetoothAddress)
Convert Bluetooth address String representation to long. |
static String |
getBluetoothAddress(long address)
Convert Bluetooth address long representation to String presentation. |
static boolean |
implAuthorize(RemoteDevice device,
Connection conn)
Determines if this RemoteDevice should be allowed to continue to access the local service provided by the Connection. |
static boolean |
implEncrypt(RemoteDevice device,
Connection conn,
boolean on)
Attempts to turn encryption on or off for an existing connection. |
static String |
implGetFriendlyName(RemoteDevice device,
long address,
boolean alwaysAsk)
Returns the name of the device. |
static RemoteDevice |
implGetRemoteDevice(Connection conn)
Retrieves the Bluetooth device that is at the other end of the Bluetooth connection. |
static boolean |
implIsAuthenticated(RemoteDevice device)
Determines if this RemoteDevice has been authenticated. |
static boolean |
implIsAuthorized(RemoteDevice device,
Connection conn)
Determines if this RemoteDevice has been authorized. |
static boolean |
implIsEncrypted(RemoteDevice device)
Determines if data exchanges with this RemoteDevice are
currently being encrypted. |
static boolean |
implIsTrustedDevice(RemoteDevice device)
Determines if this is a trusted device according to the BCC. |
static RemoteDevice[] |
implRetrieveDevices(BluetoothStack bluetoothStack,
int option)
Returns an array of Bluetooth devices. |
static int |
openConnections()
Count total number of open connections to all devices. |
static int |
openConnections(long address)
Count number of open connections to or from specific device. |
static int |
readRSSI(RemoteDevice device)
Gets the RSSI (Receive Signal Strength Indicator) value for a remote Bluetooth device. |
static void |
removeAuthentication(RemoteDevice device)
Removes authentication between local and remote bluetooth devices. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int openConnections()
public static int openConnections(long address)
public static int connectedDevices()
public static String formatBluetoothAddress(String address)
public static String getBluetoothAddress(long address)
address
-
public static long getAddress(String bluetoothAddress)
bluetoothAddress
-
public static int readRSSI(RemoteDevice device) throws IOException
PUBLIC JSR-82 extension
Bluetooth connection with the peer device should exist to receive a value.
Value 0 indicates that the connected Bluetooth devices are at optimal separation, the golden zone.
Increasingly positive values are reported as the devices are moved closer to each other. Increasingly negative values are reported as the devices are moved apart.
RSSI ranges from -128 to 127.
device
- Remote Device
IOException
- if there are error reading value.public static boolean authenticate(RemoteDevice device) throws IOException
false
if the
stack does not support authentication.
Internal BlueCove function. Use javax.bluetooth.RemoteDevice.authenticate().
IOException
RemoteDevice.authenticate()
public static boolean authenticate(RemoteDevice device, String passkey) throws IOException
false
if the stack does not support authentication.
PUBLIC JSR-82 extension On BlueZ will throw exception when authentication already exists.
device
- Remote Devicepasskey
- A Personal Identification Number (PIN) to be used for device
authentication.
true
if authentication is successful; otherwise
false
IOException
- if there are error during authentication.public static void removeAuthentication(RemoteDevice device) throws IOException
PUBLIC JSR-82 extension
device
- Remote Device
IOException
- if there are errors or not implemented.public static String implGetFriendlyName(RemoteDevice device, long address, boolean alwaysAsk) throws IOException
null
if the Bluetooth system does not support this
feature; If the remote device does not have a name then an empty string.
Internal BlueCove function. Use javax.bluetooth.RemoteDevice.getFriendlyName(...).
IOException
public static RemoteDevice implGetRemoteDevice(Connection conn) throws IOException
Internal BlueCove function. Use javax.bluetooth.RemoteDevice.getRemoteDevice(...).
IOException
RemoteDevice.getRemoteDevice(Connection)
public static RemoteDevice[] implRetrieveDevices(BluetoothStack bluetoothStack, int option)
Internal BlueCove function. Use javax.bluetooth.RemoteDevice.retrieveDevices(...).
DiscoveryAgent.retrieveDevices(int)
public static boolean implAuthorize(RemoteDevice device, Connection conn) throws IOException
Internal BlueCove function. Use javax.bluetooth.RemoteDevice.authorize(...).
IOException
RemoteDevice.authorize(javax.microedition.io.Connection)
public static boolean implEncrypt(RemoteDevice device, Connection conn, boolean on) throws IOException
Internal BlueCove function. Use javax.bluetooth.RemoteDevice.encrypt(...).
IOException
RemoteDevice.encrypt(javax.microedition.io.Connection,
boolean)
public static boolean implIsAuthenticated(RemoteDevice device)
RemoteDevice
has been authenticated.
Internal BlueCove function. Use javax.bluetooth.RemoteDevice.isAuthenticated().
A device may have been authenticated by this application or another
application. Authentication applies to an ACL link between devices and
not on a specific L2CAP, RFCOMM, or OBEX connection. Therefore, if
authenticate()
is performed when an L2CAP connection is made
to device A, then isAuthenticated()
may return
true
when tested as part of making an RFCOMM connection to
device A.
true
if this RemoteDevice
has
previously been authenticated; false
if it has not
been authenticated or there are no open connections between the
local device and this RemoteDevice
public static boolean implIsAuthorized(RemoteDevice device, Connection conn) throws IOException
RemoteDevice
has been authorized.
Internal BlueCove function. Use javax.bluetooth.RemoteDevice.isAuthorized( javax.microedition.io.Connection).
IOException
public static boolean implIsEncrypted(RemoteDevice device)
RemoteDevice
are
currently being encrypted.
Internal BlueCove function. Use javax.bluetooth.RemoteDevice.isEncrypted().
Encryption may have been previously turned on by this or another
application. Encryption applies to an ACL link between devices and not on
a specific L2CAP, RFCOMM, or OBEX connection. Therefore, if
encrypt()
is performed with the on
parameter
set to true
when an L2CAP connection is made to device A,
then isEncrypted()
may return true
when tested
as part of making an RFCOMM connection to device A.
true
if data exchanges with this
RemoteDevice
are being encrypted; false
if they are not being encrypted, or there are no open connections
between the local device and this RemoteDevice
public static boolean implIsTrustedDevice(RemoteDevice device)
Internal BlueCove function. Use javax.bluetooth.RemoteDevice.isTrustedDevice().
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |