kelly / node-i2c

Node.js native bindings for i2c-dev. Plays well with Raspberry Pi and Beaglebone.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Read or write raw bytes

joraff opened this issue · comments

Is it possible to read or write raw bytes to a i2c device using this library?

I'm trying to interface with the SL030 RFID module, and it has an atypical command structure.

Instead of the usual sequence of slave address, ack, command register, ack, data(n)*ack, stop for a write, this module wants slave address, ack, length, ack, command, ack, data(n)*ack, stop

Tracing a writeBytes all the way to the ioctl structure, it seems that it's assuming a command register will always be the first byte. Anything else in there that I've overlooked?

commented

Version 0.1.7 has this functionality. There is now a read and write method that doesn't require a command byte.

👏

Thanks. I'll test it out. I can take care of a PR to update the docs. That's easy enough