Skip to content

Commit fd55e73

Browse files
committed
Return ID when RFID leave
1 parent 19b7ae8 commit fd55e73

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/module/RFID.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515

1616
/**
1717
* Fires when the RFID entered.
18-
*
18+
*
1919
* @event RFIDEvent.ENTER
2020
*/
2121
ENTER: 'enter',
2222

2323
/**
2424
* Fires when the RFID leaved.
25-
*
25+
*
2626
* @event RFIDEvent.LEAVE
2727
*/
2828
LEAVE: 'leave'
@@ -32,7 +32,7 @@
3232
* The RFID class.
3333
*
3434
* RFID reader is used to track nearby tags by wirelessly reading a tag's unique ID.
35-
*
35+
*
3636
* @namespace webduino.module
3737
* @class RFID
3838
* @constructor
@@ -63,11 +63,11 @@
6363
}
6464

6565
if (msg.length === 1) {
66-
val = 0;
6766
_this._leaveHandlers.forEach(function (fn, idx, ary) {
6867
fn.call(_this, val);
6968
});
7069
_this.emit(RFIDEvent.LEAVE, val);
70+
val = null;
7171
} else {
7272
val = String.fromCharCode.apply(null, msg);
7373
_this._enterHandlers.forEach(function (fn, idx, ary) {
@@ -84,7 +84,7 @@
8484

8585
/**
8686
* The state indicating whether the module is reading.
87-
*
87+
*
8888
* @attribute isReading
8989
* @type {Boolean} isReading
9090
* @readOnly

0 commit comments

Comments
 (0)