Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

[ComfoAir] Optimize serial connection #5049

Merged
merged 2 commits into from
Jan 31, 2017
Merged

[ComfoAir] Optimize serial connection #5049

merged 2 commits into from
Jan 31, 2017

Conversation

csowada
Copy link
Contributor

@csowada 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
@csowada csowada changed the title Optimize serial connection [ComfoAir] Optimize serial connection Jan 29, 2017
@@ -390,7 +404,7 @@ private boolean send(byte[] request) {

try {
outputStream.write(request);
outputStream.flush();
// remove outputStream.flush(), can hang forever
Copy link
Contributor

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

Copy link
Contributor Author

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) {
}
}
}
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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. 😄

@watou watou added this to the 1.9.1 milestone Jan 29, 2017
@watou watou merged commit 5956bf2 into openhab:master Jan 31, 2017
watou pushed a commit to watou/openhab that referenced this pull request Jan 31, 2017
* Optimize serial connection

- Add RXTX CPU workaround
- Change Thread to SchedulerExecutorService
- Remove flush() on send, can cause blocking forever

* Removed commented out code
@watou
Copy link
Contributor

watou commented Jan 31, 2017

cherry picked onto 1.9.x branch

@kaikreuzer kaikreuzer modified the milestones: 1.9.1, 1.10.0 Jun 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants