INNER CODE UNIT · Java

readCounterCharacteristic

nic-delhi/AarogyaSetu_Android · app/src/main/java/nic/goi/aarogyasetu/GattClient.java:93

        private void readCounterCharacteristic(BluetoothGattCharacteristic characteristic, BluetoothGatt gatt) {
            if (UUID.fromString(BuildConfig.DID_UUID).equals(characteristic.getUuid())) {
                byte[] data = characteristic.getValue();
                String uniqueId = new String(data, StandardCharsets.UTF_8);
                Logger.d("GattCLient", "Unique ID - " + uniqueId);
                BluetoothModel bluetoothModel = new BluetoothModel(uniqueId,
                        uniqueId, mRssi, txPower, txPowerLevel);
                storeDetectedUserDeviceInDB(bluetoothModel);
            } else if (UUID.fromString(BuildConfig.PINGER_UUID).equals(characteristic.getUuid())) {
                byte[] data = characteristic.getValue();
                String uniqueId = new String(data, StandardCharsets.UTF_8);
                Logger.d("GattCLient", "Pinger ID - " + uniqueId);
            }
            chars.remove(chars.get(chars.size() - 1));

            if (chars.size() > 0) {
                requestCharacteristics(gatt);
            } else {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…