Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the packer methods #65

Closed
wants to merge 2 commits into from
Closed

Added the packer methods #65

wants to merge 2 commits into from

Conversation

rtu-dataframe
Copy link

@rtu-dataframe rtu-dataframe commented Jan 13, 2019

Added the packer methods to keep simple the data reading and writing, as requested in the issue #61 , i've created three functions in the utils.py in order to simplify the data packing and unpacking while reading/writing some different data types like Float, Double, etc... (Data Types Here)

In everyday use, you can simply use those methods importing the utils.py module and read (for example) a float value like shown below:

f = data_unpacker(response, '>', 'f')

instead of:

f = struct.unpack('>f', struct.pack('>H', high_byte) + struct.pack('>H', low_byte)[0]

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.3%) to 95.039% when pulling fd08bd9 on Simonefardella:master into 0560a42 on AdvancedClimateSystems:master.

@coveralls
Copy link

coveralls commented Jan 13, 2019

Coverage Status

Coverage decreased (-0.4%) to 95.921% when pulling dc1d82c on Simonefardella:master into 0560a42 on AdvancedClimateSystems:master.

@rtu-dataframe
Copy link
Author

A new pull request will be submitted after some fix

hmaerki pushed a commit to hmaerki/fork-uModbus-obsolete that referenced this pull request Dec 31, 2023
hmaerki pushed a commit to hmaerki/fork-uModbus-obsolete that referenced this pull request Dec 31, 2023
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.

None yet

2 participants