Skip to content

Fix USB PRO change-of-state packet handling to allow valid packets, closes #1290 - #1301

Merged
peternewman merged 3 commits into
OpenLightingProject:masterfrom
rewolff:fixenttec
Aug 13, 2017
Merged

Fix USB PRO change-of-state packet handling to allow valid packets, closes #1290#1301
peternewman merged 3 commits into
OpenLightingProject:masterfrom
rewolff:fixenttec

Conversation

@rewolff

@rewolff rewolff commented Aug 13, 2017

Copy link
Copy Markdown
Contributor

seems to have worked... :-)

@peternewman peternewman added this to the 0.11.0 milestone Aug 13, 2017
@peternewman peternewman self-assigned this Aug 13, 2017

@peternewman peternewman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a few minor changes please.


if (length < sizeof(widget_data_changed)) {
OLA_WARN << "Change of state packet was too small: " << length;
if ((length < 7) || (length > sizeof(widget_data_changed))) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we have a comment in the code where the 7 came from please.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Done

Comment thread plugins/usbpro/EnttecUsbProWidget.cpp Outdated
if (length < sizeof(widget_data_changed)) {
OLA_WARN << "Change of state packet was too small: " << length;
if ((length < 7) || (length > sizeof(widget_data_changed))) {
OLA_WARN << "Change of state packet was invalid: " << length;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we change this to "was an invalid size" or similar, we've not actually looked at if the data is valid yet.


if (length < sizeof(widget_data_changed)) {
OLA_WARN << "Change of state packet was too small: " << length;
if ((length < 7) || (length > sizeof(widget_data_changed))) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Likewise for the second implementation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Done

@peternewman peternewman changed the title fixed USB PRO change-of-state packet handling to allow valid packets. Fix USB PRO change-of-state packet handling to allow valid packets, closes #1290 Aug 13, 2017
@peternewman

Copy link
Copy Markdown
Member

@nomis52 it seems rather odd we need to duplicate this code for the Enttec Pro and the Generic USBPro, although I can't see any easy way to resolve it as the inheritance diagrams don't seem to overlap at all. Probably one for another day I guess.

@rewolff

rewolff commented Aug 13, 2017

Copy link
Copy Markdown
Contributor Author

I'm not too famliar with how this works, but pushing to my branch on github caused immediate changes here in this window, so I think the pull is now including the newly added changes as well....

My own compile-test now worked. Thanks for the help.

P.S. apparently some unit tests are failing (in the .3 and .4 tasks), causing the travis-ci test to fail. Anything I can do?

@peternewman peternewman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks

@peternewman

peternewman commented Aug 13, 2017

Copy link
Copy Markdown
Member

Yes, because it's a PR, pushing to your branch does the trick.

Some of the unit tests are a tad flaky so I'll rerun them when the others have finished.

@peternewman
peternewman requested a review from nomis52 August 13, 2017 18:49
@peternewman
peternewman merged commit b781eff into OpenLightingProject:master Aug 13, 2017
@rewolff
rewolff deleted the fixenttec branch August 14, 2017 06:01
@peternewman peternewman mentioned this pull request Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants