-
-
Notifications
You must be signed in to change notification settings - Fork 798
Closed
Description
Even if I call readRSSI value every 100ms, it seems like the RSSI value only changes values every half second or so. Is this functionality intended? Code for context
useEffect(() => {
const interval = setInterval(() => {
if (isConnected) {
scanIds.map((item) => retrieveRssi(item));
}
}, 100);
return () => clearInterval(interval);
}, [isConnected, scanIds, diff1, diff2]);
const retrieveRssi = (peripheralId) => {
BleManager.readRSSI(peripheralId)
.then((rssi) => {
index = scanIds.indexOf(peripheralId);
if (index == 0) {
setDiff1(rssi);
} else {
setDiff2(rssi);
}
})
.then(console.log(diff1, diff2))
.catch((error) => {
// Failure code
console.log(error);
});
};Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels