st-one-io / node-open-protocol

This node is an implementation of the Atlas Copco's Open Protocol. This node was created by Smart-Tech as part of the ST-One project.
GNU General Public License v3.0
39 stars 38 forks source link

Fix MID 0002 revision 6 implementation #41

Open ferm10n opened 1 year ago

ferm10n commented 1 year ago

closes https://github.com/st-one-io/node-open-protocol/issues/40

ferm10n commented 1 year ago

I discovered something potentially significant. This PR will cause this test to fail: Should handle error of generic communication with reply of request MID0004 Error ~ 74/76 - Based Test 04/07/2018

It appears that the sample data captured for the mid 0002 is missing the stationID, stationName, and clientID. I'm not sure how this data was captured, but it might make sense that it'd be missing these if node-open-protocol was used to capture the payload (since its parser for mid 0002 seems wrong).

Still, it's cause for concern, and makes me want to confirm what I think is a bug is actually a bug! But this is problematic since it appears this project has been unmaintained for a while now...

ferm10n commented 1 year ago

My earlier theory feels wrong, because the data length in the sessionControlClient test I mentioned isn't long enough to capture the missing keys. I assume that data was captured from a real tool, but that would mean that a power focus 4000 was not correctly implementing the mid. none of this seems to add up...

ferm10n commented 1 year ago

I've modified the test to accept what I believe is a correct mid 0002 payload.