fix(rfid): changes to log all reads and also replace some trailing text from a hex
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user