Cloud-Automation / node-modbus

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

Fixed reqId calculation #107

Closed psorowka closed 7 years ago

psorowka commented 7 years ago

Previously the reqId was incremented without modulo and could exceed the value of 0xffff which would eventually throw an out of range error when executing Buffer.writeUInt16BE.

Now, the reqId is incremented with a modulus on 0xffff and thus should always fit into the word without and error. A test was added to verify (and fix) the behavior.

psorowka commented 7 years ago

@BauchBeinePoe can you give me a hint when you can merge this?

stefanpoeter commented 7 years ago

Can you increase the Version number? Should be 2.0.2 if i am right. I am currently sick at Home so i will simply merge this from my cellphone.

psorowka commented 7 years ago

done. can you also push to npm from your cellphone? get well soon!

stefanpoeter commented 7 years ago

I'll find a way :-)