Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Options not sent with mosquitto_subscribe_v5 (v. 1.6.8)

And again correcting my own misconceptions ... MQTT_SUB_OPT_NO_LOCAL is sent directly to mosquitto_subscribe_v5 as below, but first you must request the v5 protocol before connecting:

    mosquitto_int_option(mosq, MOSQ_OPT_PROTOCOL_VERSION, MQTT_PROTOCOL_V5);



On Friday, 22 January 2021, 12:05:15 GMT, David Gurr <davidgu@xxxxxxxxx> wrote:


Resolved my own problem ... realised that you don't pass the option value directly, but by adding them to the struct mosquitto via the options functions.

Sorry for the dumb question!

On Friday, 22 January 2021, 11:55:06 GMT, David Gurr <davidgu@xxxxxxxxx> wrote:


The following code doesn't seem to be sending the requested option:

            retval = mosquitto_subscribe_v5(mosq, NULL, buf, 1, MQTT_SUB_OPT_NO_LOCAL, NULL);

I still get my own published messages received by this client. The log callback seems to show that the options are sent as 0x00:

Client mosq-evfqJnVOdLsQZ900sL sending SUBSCRIBE (Mid: 2, Topic: cmnd/office_heater/POWER, QoS: 1, Options: 0x00)

Am I doing something wrong, or is this a bug?


Back to the top