New transport protocol -> s-bus g4

Hi Guys,

I’m trying to add a new binding to openhab. It is derived from modbus binding. The only difference is that instead of TCP, this one is using UDP and all the protocol queries have a subnetId byte in addition to the deviceId and functionId.

For this, I opened the following two pull requests:

Thank you,
Ciprian

First of all i’m not familiair with modbus or sbus, so maybe these questions don’t make sense. Are these small differences worthwhile to create a seperate binding over a addition to modbus? Or maybe a sub binding org.openhab.binding.modbus.sbus and dervive/override from there?

Anyway, the current PR is a copy paste for many files and will need a readme.md with sbus specifics. Also filenames should be adapted.

Hey @lsiepel ,

These amendments were brought in three places:

  1. The Modbus library: GitHub - cipianpascu/j2sbus: Enhanced Modbus library implemented in the Java programming language
  2. The Modbus transport wrapper library for openhab
  3. The Modbus binding

I duplicated the Modbus protocol because I couldn’t see a way to enhance the existing implementation.
If you have a better approach/proposal, let’s schedule a call to see what can be done.
As for the readme, yes, I will update it with S-Bus specific information.

Thank you,
Ciprian

Hi Sami ( @ssalonen ),

You are the specialist for the modbus binding, and the openhab core team asked you to review my changes related to the s-bus g4 protocol.

Please have a look and let me know if there are any additional action points that I should take. It is time-consuming for me to keep the branch in sync with the latest changes.

lsiepel suggested in the post above, to merge my changes directly into the modbus binding. What is your opinion? Would it be possible?

Kind regards,
Ciprian