Java Reference
In-Depth Information
DiscoveryAgent (covered in the next section, “Discovering Devices”). getFriendlyName() will
return a string that contains a human readable (and understandable) name for your device.
You can determine if your device is discoverable by other Bluetooth devices with a call to
the following:
int getDiscoverable() ;
To make your device discoverable, or disable its visibility in the network, call
boolean setDiscoverable(int mode)
Before you can call any of the information methods, you will need an instance of a
LocalDevice . This singleton instance is often called the local Bluetooth manager. It can be
obtained using this factory method:
static LocalDevice getLocalDevice() ;
To obtain the singleton instance of your local Bluetooth manager, use code similar to
the following:
LocalDevice myDevice = LocalDevice.getLocalDevice();
Each Bluetooth software stack must have a set of properties that you can query; use this
static method on the LocalDevice :
static String getProperty(String property) ;
Table 12-1 shows some properties for which you can query.
Table 12-1. Properties That Must Be Available on a Bluetooth Device
Property
Description
bluetooth.api.version
API version supported. Currently “1.0”.
bluetooth.master.switch
Indicates whether a switch between master and slave
Bluetooth role is allowed on this device. Not all devices
support role switching between master and slave.
bluetooth.sd.attr.retrievable.max
The maximum number of service record attributes that can
be retrieved. Service records and attributes are described
later in this chapter.
bluetooth.connected.devices.max
The maximum number of connected devices in this imple-
mentation. Bluetooth supports the concept of a “parked
connection,” which can increase the maximum number of
connected devices.
bluetooth.l2cap.receiveMTU.max
The maximum transmission unit size in bytes supported
in the L2CAP low-level protocol. The L2CAP protocol is
described later in this chapter.
bluetooth.sd.trans.max
The maximum number of concurrent service discovery
transactions allowed.
Search WWH ::




Custom Search