2

Im am trying to discover the services of my ble device. When I use a LG l3 my code works fine ( I see the uuid I'm looking for). When I try a Samsung s4 I get different service uuids. Why am i getting different 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
        }

    }
}
iamkaan
  • 1,495
  • 2
  • 23
  • 43
jhon snow
  • 91
  • 6

0 Answers0