You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The command is successfully sent and executed but afterwards .available() returns zero and .read() returns nothing. It blocks my device because the device itself keeps the output in the buffer and doesn't accept new commands until is cleared. So I have to use another 3rd party program that reads the output buffer and then I can send commands with this plugin again. I tried both with .read() and .onDataReceived()
Here is a sample of my code
Reading method:
const performRead = async (device) => {
try {
console.log("Polling for available messages");
let available = await device.available();
console.log('There is data available [${available}], attempting read');
if (available > 0) {
for (let i = 0; i < available; i++) {
console.log(`reading ${i}th time`);
let data = await device.read();
console.log(`Read data ${data}`);
console.log(data);
}
} else {
console.log("No read data available");
}
} catch (err) {
console.log(err);
}
};
"react-native": "0.76.5",
"react-native-bluetooth-classic": "^1.73.0-rc.12",
Device Arduino bluetooth HC-06
The command is successfully sent and executed but afterwards .available() returns zero and .read() returns nothing. It blocks my device because the device itself keeps the output in the buffer and doesn't accept new commands until is cleared. So I have to use another 3rd party program that reads the output buffer and then I can send commands with this plugin again. I tried both with .read() and .onDataReceived()
Here is a sample of my code
Reading method:
Main method:
The text was updated successfully, but these errors were encountered: