Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong logic for initializing _err_sub and _throttle_sub #113

Open
kintel opened this issue Apr 3, 2020 · 0 comments
Open

Wrong logic for initializing _err_sub and _throttle_sub #113

kintel opened this issue Apr 3, 2020 · 0 comments

Comments

@kintel
Copy link
Contributor

kintel commented Apr 3, 2020

See this code fragment:

if (_err_sub) {
// setup error sub
_err_sub = new Adafruit_MQTT_Subscribe(_mqtt, _err_topic);
_mqtt->subscribe(_err_sub);
_err_sub->setCallback(errorCallback);
}

_err_sub is only initialized if it's non-NULL, which is the opposite of what I'd expect.
Same for _throttle_sub.

As an aside, this will never actually be executed, as both are initialized to 0.
It doesn't look like this is the intended behavior of this code.

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

No branches or pull requests

1 participant