I2C.send calls callback with extra argument
Opened this issue · 3 comments
johnnyman727 commented
I expect the callback of I2C.send
to just have an error
attribute but it also has a second argument with the value of new Buffer([0x88])
.
Dr-Emann commented
Looks like I2C.send
calls the callback with _simple_cmd(CMD.STOP)
(which internally sends a one byte echo command to return 0x88), whereas I2C.read
/I2C.transfer
call the callback with port.rx
, and before sending STOP.
rwaldron commented
Send only sends and then stops. Read and transfer must wait for responses before the stop.
Dr-Emann commented
Functions which also pass [0x88]
to their callback parameter:
pin.high()
pin.low()
pin.toggle()
pin.input()
pin.pull()
spi.send()
uart._write()
(which doesn't appear to be used anywhere?)