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);
|
return c.json({ success: false, message: "missing data" }, 400);
|
||||||
}
|
}
|
||||||
//console.log(`Tag: ${Buffer.from(body.idHex, "hex").toString("utf-8")}, ${body[key].data.idHex}`);
|
//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++) {
|
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(
|
// console.log(
|
||||||
// "Raw value:",
|
// "Raw value:",
|
||||||
// body[i].data.peakRssi,
|
// body[i].data.peakRssi,
|
||||||
|
|||||||
Reference in New Issue
Block a user