* Assembles a text string containing the device's bluetooth information
*
* @return String containing the device's bluetooth information
*/
private String generateBluetoothString() {
LocalDevice lc;
try {
// Get the LocalDevice
lc = LocalDevice.getLocalDevice();
} catch (final Exception ex) {
return "Failed to initialize Bluetooth";
}
final StringBuffer sb = new StringBuffer();
// Get the device's Bluetooth address
sb.append("Bluetooth Address: ");
sb.append(lc.getBluetoothAddress());
sb.append('\n');
// Get the device's Bluetooth friendly name
sb.append("Bluetooth friendly name: ");
sb.append(lc.getFriendlyName());
sb.append('\n');
// Get the device's discovery mode
sb.append("Discovery Mode: ");
switch (lc.getDiscoverable()) {
case DiscoveryAgent.GIAC:
sb.append("General/Unlimited Inquiry Access");
break;
case DiscoveryAgent.LIAC: