kelly / node-i2c

Node.js native bindings for i2c-dev. Plays well with Raspberry Pi and Beaglebone.
Other
216 stars 91 forks source link

Read or write raw bytes #51

Closed joraff closed 9 years ago

joraff commented 9 years ago

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?

kelly commented 9 years ago

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

joraff commented 9 years ago

:clap:

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