0

I am using react-native-ble-plx library to connect to Xsens DOT sensors. The sensors transmit data at different data output rates (4Hz, 10Hz,20Hz,60Hz[default]) over Bluetooth.

When I set the Data output rate below 20Hz the application runs fine but when I set it to 60Hz, the application hangs, and all the touch options and components freeze. On the console I am able to see a warning: Please report: Excessive number of pending callbacks: 501. Some pending callbacks that might have leaked by never being called from native code.

I am using the monitorCharacteristics() method which returns a promise object. What should I do so that the application doesn't freeze? Also is there a way where I can monitor the performance of the app?

bleManager.monitorCharacteristicForDevice(props.device.id,serviceUUID,charUUID_N,(err,char)=>{
    if (err){
        console.error(err)
    }
    console.info(char.value)  
})

Console logs

1 Answers1

0

@Seba99 I used scanningOptions?: ScanOptions for handle this. reportDelay should be between 0 and 5000

    BleManager.scan([], 0, true, { reportDelay: 1000, phy: 
    BleScanPhyMode.ALL_SUPPORTED }).then(() => {
    // Success code
    console.log('Scan started');
    });

documentation: https://developer.android.com/reference/android/bluetooth/le/ScanSettings.Builder#setReportDelay(long)