NordicID / nur_sample_android

Nur Android Samples
MIT License
10 stars 12 forks source link

Get DeviceList #14

Closed yk-e closed 2 years ago

yk-e commented 2 years ago

Hello, I try to use NurSdk for react native application. I need deviceList as an ArrayList. Current structure starts a new activity and shows a UI but a react native application runs in a single activity. I tried to call getDeviceList() method in NurDeviceScanner class but no result returns. I debug into the code and find out that inside the BleScanner.isBleDevice() method, only type 1 and type 3 are coming. That's why, no bluetooth device is found. I init these classes at first: @Override public void initiateRfidIntegration(RfidModule rfidModule) { this.context = rfidModule; mNurApi = new NurApi(); mNurApi.setListener(mNurApiListener); deviceScanner = new NurDeviceScanner(context.getApplicationContext(), 7, (NurDeviceScanner.NurDeviceScannerListener)null, mNurApi); BleScanner.init(context.getApplicationContext()); } The isBleDevice method: public static boolean isBleDevice(BluetoothDevice device) { return device.getType() == 2 || device.getType() == 0; }

How can I get the bluetooth devicelist near?

Thanks in advance.