| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
NodeJS binding of LibFreefare. LibFreefare is a library to manipulate Mifare NFC smart cards (Classic, DESFire, Ultralight, etc) over LibNFC. Your reader has to be compatible with LibNFC to work with this Library (Check out the compatibility matrix to know if your device is compatible)
Due to lack of time and testing material, the binding is not complete :
If you need Freefare function which are currently not bound, submit an issue, a pull request or contact me by email.
You need at least NodeJS v6. Go to NodeJs website to know how to get it for your system.
You also need LibFreefare. Under debian you can do
apt-get install libfreefare0 libfreefare-dev
Finally use npm. to install this package
npm install freefare
You can find examples under the examples/ directory
When a Freefare object is created, it automatically initialize LibNFC. Once initialized, you can list available NFC devices.
Give a list of available NFC devices
Returns: Promise.<Array.<Device>>, A promise to the Device list.
A NibNFC compatible device that can read NFC tag. The open() method have to be executed before any other.
Open device for further communication
Returns: Promise, A promise to the end of the action.
Close device to release memory and device
Returns: Promise, A promise to the end of the action.
List of detected tags
Returns: Promise.<Array.<(Tag|MifareUltralightTag|MifareClassicTag|MifareDesfireTag)>>, A promise to the list of Tag
Abort command blocking the device like open().
Returns: Promise, A promise to the end of the action.
A Freefare compatible NFC tag
Get Tag type
Returns: string, The tag type between MIFARE_CLASSIC_1K, MIFARE_CLASSIC_4K, MIFARE_DESFIRE, MIFARE_ULTRALIGHT, MIFARE_ULTRALIGHT_C
Get Tag friendly name
Returns: string, The tag friendly name
Get Tag UID
Returns: string, The tag UID
A MIFARE Ultralight tag
Extends: Tag
Open tag for further communication
Returns: Promise, A promise to the end of the action.
Close tag to release memory and device
Returns: Promise, A promise to the end of the action.
Read a page on the tag
Parameters
Returns: Promise.<Buffer>, A promise to the read data (in a 4 bytes buffer)
Write a page on the tag
Parameters
Returns: Promise, A promise to the end of the action.
A MIFARE Classic tag
Extends: Tag
Open tag for further communication
Returns: Promise, A promise to the end of the action.
Close tag to release memory and device
Returns: Promise, A promise to the end of the action.
After openning the tag, an authentication is required for further operation.
Parameters
Returns: Promise, A promise to the end of the action.
Read the given block
Parameters
Returns: Promise.<Buffer>, A promise to the read data (in a 16 bytes buffer)
Write on the given block
Parameters
Returns: Promise, A promise to the end of the action.
Initialize a value block, with the given value and address
Parameters
Returns: Promise, A promise to the end of the action.
Read a value block
Parameters
Returns: Promise.<Object>, A promise to an object containing value and adr : {adr: 0, value: 0}
Increment the block value by a given amount and store it in the internal data register
Parameters
Returns: Promise, A promise to the end of the action.
Decrement the block value by a given amount and store it in the internal data register
Parameters
Returns: Promise, A promise to the end of the action.
Put a block value from in the internal data register
Parameters
Returns: Promise, A promise to the end of the action.
Restore the internal data register to the given block value
Parameters
Returns: Promise, A promise to the end of the action.
A MIFARE DESFire tag
Extends: Tag
Open tag for further communication
Returns: Promise, A promise to the end of the action.
Close tag to release memory and device
Returns: Promise, A promise to the end of the action.
Authenticate with a DES key
Parameters
Returns: Promise, A promise to the end of the action.
Authenticate with a 3DES key
Parameters
Returns: Promise, A promise to the end of the action.
List application IDs (AID)
Returns: Promise.<Array.<Number>>, A promise to the AID list
Select an application
Parameters
Returns: Promise, A promise to the end of the action.
List file IDs (AID)
Returns: Promise.<Array.<Number>>, A promise to the File ID list
Read the given file
Parameters
Returns: Promise.<Buffer>, A promise to the read data
Write on the given file
Parameters
Returns: Promise, A promise to the end of the action.
| Back | FazBrowse Home | New Git URL |