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

error codes for mosquitto_connect_callback_set ommited in documentation #1730

Closed
coffeeaddict19 opened this issue Jun 22, 2020 · 3 comments
Closed

Comments

@coffeeaddict19
Copy link

Regarding mosquitto_connect_callback_set:

During testing, mosquitto_connect_callback_set threw error 4. mosquitto.h mentions no such code. It is instead, marked 'for future use'.

Some searching revealed error codes 4 and 5 here:
https://github.com/eclipse/mosquitto/blob/386f3cc188cde0b896175c0c844cfdf8dd7ea220/lib/mqtt_protocol.h

enum mqtt311_connack_codes {
CONNACK_ACCEPTED = 0,
CONNACK_REFUSED_PROTOCOL_VERSION = 1,
CONNACK_REFUSED_IDENTIFIER_REJECTED = 2,
CONNACK_REFUSED_SERVER_UNAVAILABLE = 3,
CONNACK_REFUSED_BAD_USERNAME_PASSWORD = 4,
CONNACK_REFUSED_NOT_AUTHORIZED = 5,
};

The issue is that the documentation and the comments in the header are misleading. Request that it be updated to include the omitted error codes.

ralight added a commit that referenced this issue Jun 22, 2020
@ralight
Copy link
Contributor

ralight commented Jun 22, 2020

Those comments haven't been changed since before MQTT had usernames and passwords... You're right they're way out of date. It's not sufficiently clear that they are MQTT return codes, not Mosquitto return codes. That should be fixed now, let me know if you think it's still not clear.

@coffeeaddict19
Copy link
Author

Excellent.

This is the first time I've done this. Don't know the custom. Do I close the issue now?

@ralight
Copy link
Contributor

ralight commented Jun 22, 2020

Yes, that's lovely. I prefer to leave it to the reporter to close the bug when they're happy.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants