fix(rfid): changes to log all reads and also replace some trailing text from a hex

This commit is contained in:
2025-12-11 14:42:51 -06:00
parent 7a9ea16f48
commit 90ddbca2e7

View File

@@ -46,9 +46,17 @@ app.openapi(
return c.json({ success: false, message: "missing data" }, 400);
}
//console.log(`Tag: ${Buffer.from(body.idHex, "hex").toString("utf-8")}, ${body[key].data.idHex}`);
createLog(
"info",
"rfid-tag",
"rfid",
`Tag Data from ${reader}: ${JSON.stringify(body)}`,
);
for (let i = 0; i < body.length; i++) {
const tag = Buffer.from(body[i].data.idHex, "hex").toString("utf-8");
const tag = Buffer.from(body[i].data.idHex, "hex")
.toString("utf-8")
.replace("\x00\x00", "");
// console.log(
// "Raw value:",
// body[i].data.peakRssi,