feat(rfid): more rfid topics while monitoring the system run
This commit is contained in:
@@ -3,7 +3,7 @@ import { z, createRoute, OpenAPIHono } from "@hono/zod-openapi";
|
||||
import { ConsoleLogWriter } from "drizzle-orm";
|
||||
import { tagData } from "../controller/tagData.js";
|
||||
import { responses } from "../../../globalUtils/routeDefs/responses.js";
|
||||
import { noRead } from "../controller/noRead.js";
|
||||
import { clearNoReadTimer, noRead } from "../controller/noRead.js";
|
||||
import { badRead, goodRead } from "../controller/readerControl.js";
|
||||
import { createLog } from "../../logger/logger.js";
|
||||
import { tryCatch } from "../../../globalUtils/tryCatch.js";
|
||||
@@ -51,10 +51,15 @@ app.openapi(
|
||||
const tag = Buffer.from(body[i].data.idHex, "hex").toString(
|
||||
"utf-8"
|
||||
);
|
||||
//console.log("Raw value:", body[i].data.peakRssi, "Parsed:", parseInt(body[i].data.peakRssi));
|
||||
// console.log(
|
||||
// "Raw value:",
|
||||
// body[i].data.peakRssi,
|
||||
// "Parsed:",
|
||||
// parseInt(body[i].data.peakRssi)
|
||||
// );
|
||||
if (
|
||||
tag.includes("ALPLA") &&
|
||||
parseInt(body[i].data.peakRssi) < -40
|
||||
parseInt(body[i].data.peakRssi) < -30
|
||||
) {
|
||||
tagdata = [
|
||||
...tagdata,
|
||||
@@ -71,8 +76,8 @@ app.openapi(
|
||||
}
|
||||
|
||||
if (tagdata.length === 0) {
|
||||
noRead(reader);
|
||||
badRead(reader);
|
||||
// noRead(reader);
|
||||
// badRead(reader);
|
||||
return c.json(
|
||||
{ success: false, message: `There were no tags scanned.` },
|
||||
200
|
||||
@@ -80,6 +85,7 @@ app.openapi(
|
||||
} else {
|
||||
tagData(tagdata);
|
||||
goodRead(reader);
|
||||
clearNoReadTimer();
|
||||
|
||||
return c.json(
|
||||
{ success: true, message: `New info from ${reader}` },
|
||||
|
||||
Reference in New Issue
Block a user