tlaukkan / zigbee4java

Zigbee API for Java provides simple Java interface to ZigBee network.
Apache License 2.0
144 stars 68 forks source link

Move serial port from common library to cc2531 dongle project #98

Closed cdjackson closed 7 years ago

cdjackson commented 8 years ago

The common library should be protocol agnostic - we should be able to use com ports, or IP or whatever. This is handled through the dongle interface and the serial port should not be included in the common library. Signed-off-by: Chris Jackson chris@cd-jackson.com

tlaukkan commented 8 years ago

Hi

Serial port interface is used by most of the dongles connected to computer so moving it to specific dongle implementation might not be best. You can have reusable pieces in common package even if all dongles would not use them.

Br, Tommi

On Mon, Aug 29, 2016 at 6:23 PM, Chris Jackson notifications@github.com wrote:

The common library should be protocol agnostic - we should be able to use com ports, or IP or whatever. This is handled through the dongle interface and the serial port should not be included in the common library.

Signed-off-by: Chris Jackson chris@cd-jackson.com

You can view, comment on, or merge this pull request online at:

https://github.com/tlaukkan/zigbee4java/pull/98 Commit Summary

  • Move serial port from common library to cc2531 dongle project

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tlaukkan/zigbee4java/pull/98, or mute the thread https://github.com/notifications/unsubscribe-auth/AAONRqJlPwI6GOrgKYYHBGPEUhiYcojmks5qkvmBgaJpZM4JvliM .

Best regards, Tommi Laukkanen

cdjackson commented 8 years ago

I’m not sure I agree. I also have an IP interface here. Additionally, I don’t want to, and see little point in using this SerialPort definition - it really adds little value other than to add an extra interface.

We have defined an interface between the common library and the dongles, we should use that and let people use whatever serial ports, parallel ports, IP ports, whatever that they like and not to enforce this interface which is not used at all in the common library.

tlaukkan commented 8 years ago

There are two sides to these things. One thing if of course fundamental limitation of code lines in the common library and another is the ability to reuse code with minimal project structure. The amount of code needed to support the serial interface is minimal and you can always make any external dependecies to be included explicitly by client projects. We can and should abstract the common classes so that we can support different kind of interfaces like IP and serial. I propose we still allow code sharing the serial interface classes through common which do not take may kilobytes :). This of course applies to other similar code sharing needs between dongles.

cdjackson commented 8 years ago

Of course I agree we should provide code sharing- no argument. However this interface is not a standard interface and it’s not used in the common library at all (only in the old dongle code). If you want to share code, and you think the com port implementation is useful, then you should share the implementation - not the SerialPort interface which is not used at all.

There are many reasons implementations will want to use other interfaces and a common library should not (IMHO) dictate an implemantation. We have already an interface for exchanging data between the two parts of the code - we shouldn’t force, or imply anything further.

In my opinion, it doesn’t benefit at all for code sharing - it enforces an implementation of how the serial port can be implemented, and I think that is wrong. This interface really adds no value.

tlaukkan commented 8 years ago

Lets sleep on this one and see how time mutates this dilemma. :+1: