From 2e385c7869ca48e8dd3296483ddf616fc44229ff Mon Sep 17 00:00:00 2001 From: Craig Thayer Date: Sun, 3 Sep 2017 15:45:34 -0700 Subject: [PATCH] Pass required callback function for i2c write `i2c` library requires a callback function when calling the `write` function. Passing a `noop` function to avoid the following error when initializing the i2c reader: ``` .../node_modules/i2c/lib/i2c.coffee:88 return callback(err); ^ TypeError: callback is not a function at Immediate. (.../node_modules/i2c/lib/i2c.coffee:54:9) at runCallback (timers.js:672:20) at tryOnImmediate (timers.js:645:5) at processImmediate [as _immediateCallback] (timers.js:617:5) ``` --- src/pn532_i2c.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pn532_i2c.js b/src/pn532_i2c.js index fbd5ae9..dc2123d 100644 --- a/src/pn532_i2c.js +++ b/src/pn532_i2c.js @@ -24,7 +24,7 @@ class PN532_I2C extends EventEmitter { } write(buffer) { - this.wire.write(buffer); + this.wire.write(buffer, () => {}); } }