| Paho MQTT C Client Library

Loading...
Searching...
No Matches
Data Fields
MQTTSubscribe_options Struct Reference

`#include <MQTTSubscribeOpts.h>`

## Data Fields
char | struct_id [4]
int | struct_version
unsigned char | noLocal
unsigned char | retainAsPublished
unsigned char | retainHandling

## Detailed Description

The MQTT V5 subscribe options, apart from QoS which existed before V5.

## Field Documentation

## ◆ struct_id

char struct_id[4]

The eyecatcher for this structure. Must be MQSO.

## ◆ struct_version

int struct_version

The version number of this structure. Must be 0.

## ◆ noLocal

unsigned char noLocal

To not receive our own publications, set to 1. 0 is the original MQTT behaviour - all messages matching the subscription are received.

## ◆ retainAsPublished

unsigned char retainAsPublished

To keep the retain flag as on the original publish message, set to 1. If 0, defaults to the original MQTT behaviour where the retain flag is only set on publications sent by a broker if in response to a subscribe request.

## ◆ retainHandling

unsigned char retainHandling

0 - send retained messages at the time of the subscribe (original MQTT behaviour) 1 - send retained messages on subscribe only if the subscription is new 2 - do not send retained messages at all

The documentation for this struct was generated from the following file:

- MQTTSubscribeOpts.h