-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[ComfoAir] Optimize serial connection #5049
Conversation
csowada
commented
Jan 29, 2017
- Add RXTX CPU workaround
- Change Thread to SchedulerExecutorService
- Remove flush() on send, can cause blocking forever
- Add RXTX CPU workaround - Change Thread to SchedulerExecutorService - Remove flush() on send, can cause blocking forever
@@ -390,7 +404,7 @@ private boolean send(byte[] request) { | |||
|
|||
try { | |||
outputStream.write(request); | |||
outputStream.flush(); | |||
// remove outputStream.flush(), can hang forever |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove commented out code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, I will remove the commented out code.
} catch (InterruptedException e) { | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned about this workaround, only because I'm unaware of other bindings that use the serial port having to implement a workaround of this sort. Can you offer how this binding's use of the serial port is necessarily different from, say, how the Z-Wave binding uses it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is common workaround for the buggy rxtx library. Zwave and eBUS binding uses the same workaround. I've attached the source in zwave binding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@csowada do you think my issue https://github.com/openhab/openhab2-addons/issues/1777 could be related to the problem you are fixing here? my issue is around Powermax binding, but it sounds similar to me?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I don't think so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is common workaround. See more details from #1868.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much for educating me about the workaround. 😄
* Optimize serial connection - Add RXTX CPU workaround - Change Thread to SchedulerExecutorService - Remove flush() on send, can cause blocking forever * Removed commented out code
cherry picked onto 1.9.x branch |