slowtec / tokio-modbus

A tokio-based modbus library
Apache License 2.0
379 stars 117 forks source link

More possibilities with Modbus-Exceptions #226

Closed emcell closed 5 months ago

emcell commented 8 months ago

This got a little bigger than I initially expected. I hope you're ok with my changes.

What I've done so far

I started this because I didn't find ways to specify Modbus-Exception and didn't find a way to extract those in the clients.

I Think this PR should fix #169 and #98.

What could be better here?

I think It would be better to be able to Just return a Result<Response, Exception> from the Service and figure the correct function_code out after the service handler and automatically convert the Exception into ExceptionResult. But I didn't want to make an even bigger change without speaking to to you in the first place.

uklotzde commented 8 months ago

Thanks for contributing!

IMHO this PR contains too many unrelated changes. The FunctionCode newtype should be introduced by a separate PR.

emcell commented 8 months ago

any chance this is getting merged soon?

uklotzde commented 8 months ago

Please give this PR a concise title that later becomes the Git commit message.

We also need a changelog entry that summarizes the changes and consequences for users of this crate. Ideally a single sentence for every notable API change. As short as possible.

Everyone is invited to do a review. We are managing this crate in our spare time without any monetary compensation. Please understand that paid projects might be prioritized. Thank you.

uklotzde commented 5 months ago

Should be rebased and updated once #246 has been merged.

uklotzde commented 5 months ago

I will close this PR after seeing no progress lately and because merge conflicts are pending.

Please open a new PR whenever you have something ready. Thank you.