Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"include_dirs": [
"<!(node -e \"require('nan')\")",
".",
"/usr/local/include/"
"/usr/local/include/",
"/usr/include/node"
],
} ]
}
39 changes: 39 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,45 @@ exports.nfc.parse = function(data) {
return results;
};

//------------------------------------------------------------------------------
//
// manublk (Buffer): the manufacture block.
//------------------------------------------------------------------------------
exports.nfc.parseManufactureBlk = function(manublk) {
var i, manudata, uid, lock, cc;
manudata = {};
uid = [];
lock= Array(2); // lock bytes
cc = []; // Capability container

for (i=0; i<=2; i++) {
uid.push(manublk[i]);
}
for (i=4; i<=7; i++) {
uid.push(manublk[i]);
}
manudata.uid = uid;

manudata.cb0 = manublk[3]; // Check byte 0: CT(0x88) ^ SN0 ^ SN1 ^ SN2
manudata.cb1 = manublk [8]; // Check byte 1: SN3 ^ SN4 ^ SN5 ^ SN6

manudata.internal = manublk[9];

lock[0] = manublk[10];
lock[1] = manublk[11];
manudata.lock = lock;

for (i=12; i<16; i++) {
cc.push(manublk[i]);
}
manudata.cc = cc;

return manudata;

}



exports.nfc.scan = function() {
var device, devices, i, info, j, k, kv, mod, mods, prop, props, protocol, results, speeds, v, x;

Expand Down
2 changes: 1 addition & 1 deletion src/mifare.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ typedef union {
// Reset struct alignment to default
# pragma pack()

bool nfc_initiator_mifare_cmd(nfc_device *pnd, const mifare_cmd mc, const uint8_t ui8Block, mifare_param *pmp);
///bool nfc_initiator_mifare_cmd(nfc_device *pnd, const mifare_cmd mc, const uint8_t ui8Block, mifare_param *pmp);

// Compiler directive, set struct alignment to 1 uint8_t for compatibility
# pragma pack(1)
Expand Down
Loading