INNER CODE UNIT · Java

requestCharacteristics

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

        public void requestCharacteristics(BluetoothGatt gatt) {
            if (!chars.isEmpty()) {
                gatt.readCharacteristic(chars.get(chars.size() - 1));
            }
        }

        @Override
        public void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {
            readCounterCharacteristic(characteristic, gatt);
        }

        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);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…