/**
  * Get the Bluetooth class of the remote device.
  *
  * <p>Requires {@link android.Manifest.permission#BLUETOOTH}.
  *
  * @return Bluetooth class object, or null on error
  */
 public BluetoothClass getBluetoothClass() {
   try {
     int classInt = sService.getRemoteClass(mAddress);
     if (classInt == BluetoothClass.ERROR) return null;
     return new BluetoothClass(classInt);
   } catch (RemoteException e) {
     Log.e(TAG, "", e);
   }
   return null;
 }
Example #2
0
 /**
  * Get the Bluetooth class of the remote device.
  *
  * <p>Requires {@link android.Manifest.permission#BLUETOOTH}.
  *
  * @return Bluetooth class object, or null on error
  */
 public BluetoothClass getBluetoothClass() {
   if (sService == null) {
     Log.e(TAG, "BT not enabled. Cannot get Bluetooth Class");
     return null;
   }
   try {
     int classInt = sService.getRemoteClass(this);
     if (classInt == BluetoothClass.ERROR) return null;
     return new BluetoothClass(classInt);
   } catch (RemoteException e) {
     Log.e(TAG, "", e);
   }
   return null;
 }