Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

BUG scanByService failed #50

Open
Dorbmon opened this issue Feb 19, 2023 · 0 comments
Open

BUG scanByService failed #50

Dorbmon opened this issue Feb 19, 2023 · 0 comments

Comments

@Dorbmon
Copy link

Dorbmon commented Feb 19, 2023

in BLEAdvertiserModule.java,
We have code :

if (manufacturerPayload == null)
            filters = null;
if (manufacturerPayload != null)
            filters.add(new ScanFilter.Builder().setManufacturerData(companyId, toByteArray(manufacturerPayload)).build());
if (uid != null) 
            filters.add(new ScanFilter.Builder().setServiceUuid(ParcelUuid.fromString(uid)).build());

And in

public void scanByService(String uid, ReadableMap options, Promise promise) {
        scan(uid, null, options, promise);
}

The manufacturerPayload is passed as null, this will cause filters to be null and filters.add(new ScanFilter.Builder().setServiceUuid(ParcelUuid.fromString(uid)).build()); will still run causing a runtime error of invalid address visit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant