Android 获取特定蓝牙设备的UUID

Android 获取特定蓝牙设备的UUID,android,bluetooth,uuid,Android,Bluetooth,Uuid,我使用下面的代码片段获取范围内设备的UUID。现在,我只需要为我选择的设备获取UUID(服务)。我应该如何传递蓝牙设备的名称,以便仅获取该设备的服务 if(BluetoothDevice.ACTION_UUID.equals(action)) { BluetoothDevice device =intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); Parcelable[] uuidExtra = intent.getParcelabl

我使用下面的代码片段获取范围内设备的UUID。现在,我只需要为我选择的设备获取UUID(服务)。我应该如何传递蓝牙设备的名称,以便仅获取该设备的服务

if(BluetoothDevice.ACTION_UUID.equals(action)) 
{
BluetoothDevice device =intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
Parcelable[] uuidExtra = intent.getParcelableArrayExtra(BluetoothDevice.EXTRA_UUID);
for (int i = 0; i < uuidExtra.length; i++) {
String abc=uuidExtra[i].toString());
}
}
else if(BluetoothDevice.ACTION_UUID.equals(action)){
            Iterator<BluetoothDevice> itr = mDeviceList.iterator();
            while (itr.hasNext()) {
                // Get Services for paired devices
                BluetoothDevice device = itr.next();
                showToast("\nGetting Services for " + device.getName() + ", " + device);
                if(!device.fetchUuidsWithSdp()) {
                    showToast("\nSDP Failed for " + device.getName());
                }

            }
        }
if(BluetoothDevice.ACTION_UUID.equals(ACTION))
{
BluetoothDevice=intent.getParcelableExtra(BluetoothDevice.EXTRA\u设备);
Parcelable[]uuidExtra=intent.getParcelableArrayExtra(蓝牙设备.EXTRA\UUID);
for(int i=0;i
当您说要获取服务时,您是指Ble吗?不,我没有使用任何GATT属性或Ble获取服务。这是基本的蓝牙代码。我在使用BLE代码方面没有问题,但我不知道这是否只会发现led灯之类的BLE设备,还是手机之类的普通设备@7383