Paho Asynchronous MQTT C Client Library
MQTTProperties.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2017, 2018 IBM Corp.
3  *
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * and Eclipse Distribution License v1.0 which accompany this distribution.
7  *
8  * The Eclipse Public License is available at
9  * http://www.eclipse.org/legal/epl-v10.html
10  * and the Eclipse Distribution License is available at
11  * http://www.eclipse.org/org/documents/edl-v10.php.
12  *
13  * Contributors:
14  * Ian Craggs - initial API and implementation and/or initial documentation
15  *******************************************************************************/
16 
17 #if !defined(MQTTPROPERTIES_H)
18 #define MQTTPROPERTIES_H
19 
20 #define MQTT_INVALID_PROPERTY_ID -2
21 
51 };
52 
53 #if defined(WIN32) || defined(WIN64)
54  #define DLLImport __declspec(dllimport)
55  #define DLLExport __declspec(dllexport)
56 #else
57  #define DLLImport extern
58  #define DLLExport __attribute__ ((visibility ("default")))
59 #endif
60 
67 DLLExport const char* MQTTPropertyName(enum MQTTPropertyCodes value);
68 
78 };
79 
86 
90 typedef struct
91 {
92  int len;
93  char* data;
95 
96 
100 typedef struct
101 {
102  enum MQTTPropertyCodes identifier;
104  union {
105  char byte;
106  short integer2;
107  int integer4;
108  struct {
111  };
112  } value;
113 } MQTTProperty;
114 
118 typedef struct MQTTProperties
119 {
120  int count;
121  int max_count;
122  int length;
125 
126 #define MQTTProperties_initializer {0, 0, 0, NULL}
127 
134 
142 
149 int MQTTProperties_write(char** pptr, const MQTTProperties* properties);
150 
158 int MQTTProperties_read(MQTTProperties* properties, char** pptr, char* enddata);
159 
165 
172 
180 
189 
197 
207 
215 
224 
225 #endif /* MQTTPROPERTIES_H */
MQTTProperty * array
Definition: MQTTProperties.h:123
int MQTTProperties_read(MQTTProperties *properties, char **pptr, char *enddata)
Definition: MQTTProperties.h:72
char byte
Definition: MQTTProperties.h:105
int MQTTProperties_getNumericValue(MQTTProperties *props, enum MQTTPropertyCodes propid)
MQTTProperty * MQTTProperties_getPropertyAt(MQTTProperties *props, enum MQTTPropertyCodes propid, int index)
Definition: MQTTProperties.h:41
Definition: MQTTProperties.h:77
Definition: MQTTProperties.h:37
Definition: MQTTProperties.h:44
Definition: MQTTProperties.h:31
MQTTProperties MQTTProperties_copy(const MQTTProperties *props)
int MQTTProperties_propertyCount(MQTTProperties *props, enum MQTTPropertyCodes propid)
MQTTLenString value
Definition: MQTTProperties.h:110
Definition: MQTTProperties.h:45
Definition: MQTTProperties.h:25
int MQTTProperties_hasProperty(MQTTProperties *props, enum MQTTPropertyCodes propid)
int length
Definition: MQTTProperties.h:122
Definition: MQTTProperties.h:35
char * data
Definition: MQTTProperties.h:93
int max_count
Definition: MQTTProperties.h:121
#define DLLExport
Definition: MQTTProperties.h:58
Definition: MQTTProperties.h:100
Definition: MQTTProperties.h:40
int len
Definition: MQTTProperties.h:92
Definition: MQTTProperties.h:36
int integer4
Definition: MQTTProperties.h:107
Definition: MQTTProperties.h:29
MQTTLenString data
Definition: MQTTProperties.h:109
MQTTProperty * MQTTProperties_getProperty(MQTTProperties *props, enum MQTTPropertyCodes propid)
Definition: MQTTProperties.h:39
Definition: MQTTProperties.h:90
Definition: MQTTProperties.h:32
Definition: MQTTProperties.h:33
int MQTTProperty_getType(enum MQTTPropertyCodes value)
Definition: MQTTProperties.h:26
Definition: MQTTProperties.h:42
Definition: MQTTProperties.h:28
Definition: MQTTProperties.h:118
int MQTTProperties_getNumericValueAt(MQTTProperties *props, enum MQTTPropertyCodes propid, int index)
const char * MQTTPropertyName(enum MQTTPropertyCodes value)
Definition: MQTTProperties.h:27
MQTTPropertyCodes
Definition: MQTTProperties.h:23
Definition: MQTTProperties.h:76
Definition: MQTTProperties.h:47
Definition: MQTTProperties.h:24
Definition: MQTTProperties.h:43
void MQTTProperties_free(MQTTProperties *properties)
Definition: MQTTProperties.h:34
Definition: MQTTProperties.h:71
Definition: MQTTProperties.h:74
Definition: MQTTProperties.h:75
int MQTTProperties_add(MQTTProperties *props, const MQTTProperty *prop)
struct MQTTProperties MQTTProperties
short integer2
Definition: MQTTProperties.h:106
Definition: MQTTProperties.h:46
int count
Definition: MQTTProperties.h:120
MQTTPropertyTypes
Definition: MQTTProperties.h:70
int MQTTProperties_len(MQTTProperties *props)
Definition: MQTTProperties.h:38
Definition: MQTTProperties.h:30
Definition: MQTTProperties.h:73
int MQTTProperties_write(char **pptr, const MQTTProperties *properties)