Android App Read Extended Advertising Data

64 Views Asked by At

I'm using ESP32 for bluetooth 5 periodic extended advertising. I am trying to receive the extended advertising data on an android app. I cannot log the advertisement data on the android app code end. The data I do receive with Log.d("MainActivity", "scanRec " + new String(scanRecord, StandardCharsets.UTF_8)); is the name of the advertisment which is configured in advertisement fields, but no sight of the advertisement data.

Here is a similar issue from a year ago Android app read extended advertising from Nordic nrf52840 nrf connect v2.0.0 periodic_adv

I am testing on a bluetooth 5 android device. Does android not support logging extended advertising data? Is there an app I can use to verify extended advertisement data being received?

        @Override
        public void onScanResult(int callbackType, android.bluetooth.le.ScanResult result) {
            BluetoothDevice device = result.getDevice();

                Log.d("MainActivity", "result.device " + device.getAddress());

                byte[] scanRecord = result.getScanRecord().getBytes();
                Log.d("MainActivity", "scanRec " + new String(scanRecord, StandardCharsets.UTF_8));
                Log.d("len", "len " + result.getScanRecord().getBytes().length);
        

        }```

I am trying to log extended advertisement data. When I use scanRecord.getBytes(), I only get the advertisement name. I expect to see the extended advertisement data.
0

There are 0 best solutions below