IoT::MQTT

struct SubscribeOptions

File Information

Library: IoT/MQTT
Package: MQTTClient
Header: IoT/MQTT/Types.h

Description

MQTT V5 Subscribe Options

Variables

noLocal

bool noLocal = false;

Set to true to not receive own publications. Set to false for original MQTT behaviour - all messages matching the subscription are received.

retainAsPublished

bool retainAsPublished = false;

To keep the retain flag as on the original publish message, set to true. If false, 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

int retainHandling = 0;

  • 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
Securely control IoT edge devices from anywhere   Connect a Device