我正在尝试发现我的设备的服务。当我使用LG l3我的代码工作正常(我看到我正在寻找的uuid)。当我尝试三星s4时,我得到了不同的服务uuids。为什么我会得到不同的uuids?
private final BluetoothGattCallback gattCallback = new BluetoothGattCallback() {
@Override
public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
switch (newState) {
case BluetoothProfile.STATE_CONNECTED:
if (gatt != null) {
mGatt.discoverServices();
}
break;
case BluetoothProfile.STATE_DISCONNECTED:
break;
default:
}
}
public void onServicesDiscovered(BluetoothGatt gatt, int status) {
List<BluetoothGattService> services = gatt.getServices();
for (BluetoothGattService service : services) {
Log.d("DEBUG", "Found service uuid:" + service.getUuid());
/// not getting the UUID im looking for
}
}
}