Use MQTT 5 reason strings where appropriate in clients.

pull/1072/head
Roger Light 7 years ago
parent 9560c5bac7
commit a9d19d0911

@ -90,7 +90,11 @@ void my_connect_callback(struct mosquitto *mosq, void *obj, int result)
}
}else{
if(result && !cfg.quiet){
fprintf(stderr, "%s\n", mosquitto_connack_string(result));
if(cfg.protocol_version == MQTT_PROTOCOL_V5){
fprintf(stderr, "%s\n", mosquitto_reason_string(result));
}else{
fprintf(stderr, "%s\n", mosquitto_connack_string(result));
}
}
}
}

@ -97,7 +97,11 @@ void my_connect_callback(struct mosquitto *mosq, void *obj, int result, int flag
}
}else{
if(result && !cfg.quiet){
fprintf(stderr, "%s\n", mosquitto_connack_string(result));
if(cfg.protocol_version == MQTT_PROTOCOL_V5){
fprintf(stderr, "%s\n", mosquitto_reason_string(result));
}else{
fprintf(stderr, "%s\n", mosquitto_connack_string(result));
}
}
mosquitto_disconnect_with_properties(mosq, 0, cfg.disconnect_props);
}

Loading…
Cancel
Save