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

[feature request]: default implementations in the ModbusContext trait #38

Open
Eisverygoodletter opened this issue Nov 29, 2024 · 2 comments

Comments

@Eisverygoodletter
Copy link
Contributor

Currently, the get/set_holdings_from_* and get/set_inputs_from_* functions need to be implemented manually for every one of the supported types if you want a custom ModbusContext. I think default implementations can be provided directly in the trait for the functions handling u8, f32, u64 and u32 since they are repeated usages of the get/set functions for u16.

Additionally, the set/get bulk functions could also have default implementations because they only need to repeatedly call the single read/write functions.

Adding the default implementations will make creating a custom ModbusContext implementation easier. Would you be interested in adding this if I implement the default implementations and made a PR? I can do that if you are.

@divi255
Copy link
Member

divi255 commented Dec 7, 2024

sorry for the delay. yep that's a good idea. send PR please if you can

@Eisverygoodletter
Copy link
Contributor Author

Eisverygoodletter commented Jan 1, 2025

PR made here #39

There's still a few unresolved issues I've listed there. Sorry for the late reply.

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

No branches or pull requests

2 participants