Skip to content

Conversation

@yangit
Copy link

@yangit yangit commented Apr 20, 2024

Fix for the #338
The WriteSingleCoilResponseBody constructor declares that it can handle boolen but it can not do that. So I have addled boolean handling into the function.

Manually tested for both true and false input.

I have tried to make commit a oneliner like so
this._value = value === ( true || 0xFF00 ? 0xFF00 : 0x0000)
But did not find it readable enough and did not like being dependent on parenthesis

I have not added any automated test for this fix because unfortunately I'm unable to properly run npm install neither on my mac nor on ubuntu, the SerialPort package fails to install and I have further issues with mocha (I did try to install that globally along with sinon).

Hope that helps!

…omation#338

The WriteSingleCoilResponseBody constructor declares that it can handle `boolen` but it can not do that.
So I have addled  boolean handling into the function.
@stefanpoeter
Copy link
Member

Hi @yangit, thank you for your commitment. This needs to be tested in the unit test. Can you provide a test?

@stefanpoeter
Copy link
Member

Would be great I you provide a test for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants