Cloud-Automation / node-modbus

Modbus TCP Client/Server implementation for Node.JS
471 stars 175 forks source link

modbus-serial: fixed crc and response handling #37

Closed iurly closed 8 years ago

iurly commented 8 years ago

the current (probably untested) serial implementation calculates a basic checksum instead of the required CRC-16 in Modbus mode. Also, the reponse handlers do not expect buffers the slave address as the first byte, which therefore needs to be removed. Fixed both.

stefanpoeter commented 8 years ago

Great work. I will check that tomorrow.

stefanpoeter commented 8 years ago

All test are passing. It seems that this pull request does not influence the tcp part. Can anyone with a serial device confirm that this is working? Great work btw.

iurly commented 8 years ago

I tested it on a real device (all the details are in commit 48092fe). Readability of the code is not ideal and it could use some nice rewriting though.

stefanpoeter commented 8 years ago

@iurly how about I make this a new branch and add you as a collaborator?

iurly commented 8 years ago

That would be great, thanks!

stefanpoeter commented 8 years ago

I've created a new branch 1.1-dev. Should be the place to work on the serial stuff from now on.