Skip to content

Commit

Permalink
feat: trim data from picocom
Browse files Browse the repository at this point in the history
Signed-off-by: Raphael Arce <[email protected]>
  • Loading branch information
raphael-arce committed Oct 23, 2024
1 parent 1d80429 commit d05c058
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions services/bluetooth/bluetooth.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ function createBluetoothSerialMonitor({ diceId, diceMacAddress, rfcomm }) {
);

picocom.stdout.on("data", (data) => {
// console.log("data", data.toString());
const trimmedData = data.toString().trim();
// console.log("data", trimmedData);

if (data.toString().length > 2) {
if (trimmedData.length > 2) {
// console.log("data is bigger than 2, ignoring for setting dice");
return;
}
Expand Down

0 comments on commit d05c058

Please sign in to comment.