nesslab-reader-api
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -153,4 +153,5 @@ /* | ||
var tag = dataStr.substring(1); | ||
var size = tag.length; | ||
var result = { | ||
tag: tag.substring(2,30), | ||
tag: tag.substring(size - self.tagSize > 0? size - self.tagSize:0), | ||
antenna: tag.substring(0,1), | ||
@@ -176,3 +177,3 @@ tagId: tag | ||
/** | ||
* action that the reade is executing - This is used if the reponse is not identified | ||
* action that the reader is executing - This is used if the reponse is not identified | ||
*/ | ||
@@ -182,2 +183,7 @@ nesslab_reader.prototype.action; | ||
/** | ||
* tagID size | ||
*/ | ||
nesslab_reader.prototype.tagSize = 28; | ||
/** | ||
* node version of the current machine | ||
@@ -717,3 +723,3 @@ */ | ||
| | | ||
| ===================== SETS ==================== | | ||
| ==================== SETTERS ================== | | ||
| | | ||
@@ -724,2 +730,11 @@ --------------------------------------------------- | ||
/** | ||
* set tag size | ||
* @param {int} size | ||
* @author Jayr Alencar (@jayralencar) | ||
*/ | ||
nesslab_reader.prototype.setTagSize = function(size){ | ||
this.tagSize = size; | ||
} | ||
/** | ||
* set buzzer enable value | ||
@@ -726,0 +741,0 @@ * @param {Bool} bool |
@@ -18,3 +18,3 @@ { | ||
], | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"author": { | ||
@@ -21,0 +21,0 @@ "name": "Jayr Alencar", |
@@ -0,0 +0,0 @@ # nesslab-reader-api.js |
var ness = require('../nesslab_reader'); | ||
ness.connect('192.168.0.100',5578); | ||
ness.connect('localhost',5578); | ||
ness.setTagSize(10); | ||
ness.on('connect', function(res) { | ||
}); | ||
ness.init(); | ||
}); | ||
ness.on('tag', function(re){ | ||
console.log(re) | ||
}) |
Sorry, the diff of this file is not supported yet
6
950
29255
2