-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Api js/rfid #1987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Api js/rfid #1987
Conversation
This document provides a comprehensive technical overview of SRIX and ST25TB contactless RFID memory chips, detailing their features, operating conditions, memory organization, command set, and application patterns.
Add custom documentation directory to .gitignore
Added a comprehensive README for the RFID JavaScript API, detailing features, usage, and implementation.
Updated RFID API documentation to reflect new features, including headless operation and enhanced JavaScript bindings.
Updated the README to include author information and credits, and modified the status of supported modules.
Add new commands for JS interpreter
New commands for RFID API JS
Bugfix for SD priority over LittleFS
Added dome headless function for JS API. Implemented in tag-o-matic to maintain standard logic
Bugfix to close loop while writing tag
Bugfix for writing loop (same as PN532)
|
Added new functions and little bugfix for "dialog_js" and "PN532" and "RFID2" Scripts for testing RFID API -already tested- Need some time to implement SRIX TOOL |
added AddMifareKey function
|
Added function to add a mifare key from API (validation system already implemented in Refactoring/mifare keys handling #1990) Scripts for testing RFID API -already tested- Need some time to implement SRIX TOOL |
|
moved this PR to dev, after rebase dev to main (with your SRIX tool implementation), where we are currently working.. Should we wait for SRIX on interpreter in this PR? |
|
ok, I'll put it back in draft, let's wait for SRIX to be implemented in the api too. |
add SRIX headless, review code for PN532 i2C polling mode
|
This PR includes a full review and update of the PN532 handling to ensure compatibility with the I2C polling mode, so SRIX operations work reliably across more boards/configurations. While this approach makes write operations noticeably slower, it provides a working baseline “everywhere” for now (polling is less efficient than using IRQ/RST lines). In the future, once a T-Embed is available for testing, the plan is to validate and improve the faster path for devices that expose IRQ and RST pins (hardware-assisted mode), so performance can be significantly improved where supported. The PR also contains small library improvements and a complete set of additions/updates to RFID_JS (including SRIX bindings), bringing the JS API to a fully usable state for reading, writing, saving/loading, and block-level operations. All changes are ready for merge: the implementation has been tested thoroughly and successfully end-to-end. As usual: |
Proposed Changes
This PR adds RFID JavaScript API bindings to the Bruce firmware JS interpreter, enabling scripts to interact with RFID readers (PN532, RC522/RFID2) programmatically without launching the Tag-O-Matic UI.
Key additions:
require("rfid")module withread()andreadUID()functionsThis feature enables use cases like automated tag scanning, inventory management, access control systems, and custom RFID workflows directly from JavaScript.
Types of Changes
RFID_API_README.mdwith usage examplesVerification
Manual Testing:
const rfid = require("rfid");rfid.readUID(10)- verify UID string returned on tag detectionrfid.read(10)- verify complete object with all tag fields returnednull/ empty string returnedHardware Tested:
Tag Types Tested:
Example Scripts:
Two working example scripts included in testing:
Testing
Manual Testing Performed:
read()andreadUID()functions tested with real hardwareRfid_READ_UID.js) tested successfullyUnit Tests:
Not applicable - this PR adds JS bindings for hardware interaction. Manual hardware testing required.
Linked Issues
N/A - New feature implementation
User-Facing Change