summaryrefslogtreecommitdiff
path: root/MQTTSubscribeOpts.h
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2024-11-05 21:03:15 +0000
committerDave Hibberd <hibby@debian.org>2024-11-05 21:03:15 +0000
commit424c0bd3e14d3ddda6c2d945b6465d51c462c76b (patch)
tree80b44cbe3f5fc19de1c057e37c761a95a0518a44 /MQTTSubscribeOpts.h
parenteb0d36d3f67be13de74023adb6d30362d47805fe (diff)
New upstream version 6.0.24.49upstream/6.0.24.49
Diffstat (limited to 'MQTTSubscribeOpts.h')
-rw-r--r--MQTTSubscribeOpts.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/MQTTSubscribeOpts.h b/MQTTSubscribeOpts.h
new file mode 100644
index 0000000..264e4d0
--- /dev/null
+++ b/MQTTSubscribeOpts.h
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2018 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution.
+ *
+ * The Eclipse Public License is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Ian Craggs - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+
+#if !defined(SUBOPTS_H)
+#define SUBOPTS_H
+
+/** The MQTT V5 subscribe options, apart from QoS which existed before V5. */
+typedef struct MQTTSubscribe_options
+{
+ /** The eyecatcher for this structure. Must be MQSO. */
+ char struct_id[4];
+ /** The version number of this structure. Must be 0.
+ */
+ int struct_version;
+ /** To not receive our own publications, set to 1.
+ * 0 is the original MQTT behaviour - all messages matching the subscription are received.
+ */
+ unsigned char noLocal;
+ /** 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.
+ */
+ unsigned char retainAsPublished;
+ /** 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
+ */
+ unsigned char retainHandling;
+} MQTTSubscribe_options;
+
+#define MQTTSubscribe_options_initializer { {'M', 'Q', 'S', 'O'}, 0, 0, 0, 0 }
+
+#endif