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
Comments
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. |
Excellent. This is the first time I've done this. Don't know the custom. Do I close the issue now? |
Yes, that's lovely. I prefer to leave it to the reporter to close the bug when they're happy. |
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.
The text was updated successfully, but these errors were encountered: