这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on May 17, 2021. It is now read-only.

Conversation

@wborn
Copy link
Member

@wborn wborn commented Nov 19, 2016

Improves the binding reliability by:

  • making sure CR is followed by LF when reading incoming packets, which
    should result in less protocol message errors
  • polling max 1 second for AcknowledgeMessages so the SendThread does
    not wait indefinitely when ACKs get lost

The most common scenario for the binding to stop working should now be solved. I.e. a received AcknowledgeMessage results in a protocol message error (e.g. because it is preceded by the LF of a previous message). Especially on Windows this seems to be an issue due to non-blocking reads.

Improves the binding reliability by:
* making sure CR is followed by LF when reading incoming packets, which
should result in less protocol message errors
* polling max 1 second for AcknowledgeMessages so the SendThread does
not wait indefinitely when ACKs get lost

Signed-off-by: Wouter Born <github@maindrain.net>
private final static char LF = '\n';
/** Plugwise protocol trailer code (hex) */
private final static String PROTOCOL_TRAILER = "\r\n";
private final static String PROTOCOL_TRAILER = new String(new char[] { CR, LF });
Copy link
Contributor

Choose a reason for hiding this comment

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

I know you didn't introduce this, and it's very minor, but there is a recommended order of modifiers in Java which improves readability. Here is one place that lists the common order:

  1. Access modifier (public / private / protected)
  2. abstract
  3. static
  4. final
  5. transient
  6. volatile
  7. default
  8. synchronized
  9. native
  10. strictfp

Copy link
Contributor

@watou watou left a comment

Choose a reason for hiding this comment

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

Aside from the small comment, lgtm.

@watou watou added the bug label Nov 19, 2016
@watou watou added this to the 1.9.0 milestone Nov 19, 2016
Signed-off-by: Wouter Born <github@maindrain.net>
@wborn
Copy link
Member Author

wborn commented Nov 19, 2016

Thanks for reviewing @watou! I think it should be fixed now.

@watou watou merged commit c374052 into openhab:master Nov 20, 2016
@watou
Copy link
Contributor

watou commented Nov 20, 2016

Thanks @wborn!

@wborn wborn deleted the plugwise-bugfix branch November 20, 2016 09:27
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.

2 participants