version 1.3.4.5, 2022/09/12 23:15:37
|
version 1.3.4.6, 2022/09/13 20:12:15
|
Line 72 struct mqtthdr {
|
Line 72 struct mqtthdr {
|
} mqtt_msg; |
} mqtt_msg; |
unsigned char mqtt_len[1]; /* may be grow to 4 bytes */ |
unsigned char mqtt_len[1]; /* may be grow to 4 bytes */ |
} __attribute__((packed)); |
} __attribute__((packed)); |
#define MQTTHDR_MSGINIT(x) (assert((x)), (x)->mqtt_msg.val ^= (x)->mqtt_msg.val, *mqtt_len = 0) | #define MQTTHDR_MSGINIT(x) (assert((x)), (x)->mqtt_msg.val ^= (x)->mqtt_msg.val, *(x)->mqtt_len = 0) |
#define MQTTHDR_DATA_SIZEOF(x) (assert((x)), mqtt_decodeLen((x)->mqtt_len, NULL)) |
#define MQTTHDR_DATA_SIZEOF(x) (assert((x)), mqtt_decodeLen((x)->mqtt_len, NULL)) |
|
|
#define MQTT_TYPE_UNKNOWN 0 /* reserved */ |
#define MQTT_TYPE_UNKNOWN 0 /* reserved */ |
Line 200 struct mqtthdr {
|
Line 200 struct mqtthdr {
|
|
|
typedef struct { |
typedef struct { |
void *msg_base; |
void *msg_base; |
unsigned short msg_len; | unsigned int msg_len; |
} mqtt_msg_t; |
} mqtt_msg_t; |
|
|
/* MQTT structures */ |
/* MQTT structures */ |
Line 260 const char *mqtt_GetError();
|
Line 260 const char *mqtt_GetError();
|
* @len = >0 Allocate buffer with length |
* @len = >0 Allocate buffer with length |
* return: NULL error or Message, after use must call mqtt_msgFree() with all!=0 |
* return: NULL error or Message, after use must call mqtt_msgFree() with all!=0 |
*/ |
*/ |
mqtt_msg_t *mqtt_msgAlloc(unsigned short len); | mqtt_msg_t *mqtt_msgAlloc(unsigned int len); |
/* |
/* |
* mqtt_msgFree() Free MQTT message |
* mqtt_msgFree() Free MQTT message |
* |
* |
Line 276 void mqtt_msgFree(mqtt_msg_t ** __restrict msg, int al
|
Line 276 void mqtt_msgFree(mqtt_msg_t ** __restrict msg, int al
|
* @len = new length |
* @len = new length |
* return: -1 error or >-1 old buffer length |
* return: -1 error or >-1 old buffer length |
*/ |
*/ |
int mqtt_msgRealloc(mqtt_msg_t * __restrict msg, unsigned short len); | int mqtt_msgRealloc(mqtt_msg_t * __restrict msg, unsigned int len); |
/* |
/* |
* mqtt_msgDup() - Duplicate message buffer |
* mqtt_msgDup() - Duplicate message buffer |
* |
* |
Line 337 char mqtt_sizeLen(unsigned int len);
|
Line 337 char mqtt_sizeLen(unsigned int len);
|
*/ |
*/ |
unsigned int mqtt_pktLen(struct mqtthdr * __restrict hdr); |
unsigned int mqtt_pktLen(struct mqtthdr * __restrict hdr); |
/* |
/* |
* mqtt_str2subs Create MQTT subscribe variable from string(s) | * mqtt_strs2subs Create MQTT subscribe variable from string(s) |
* |
* |
* @csStr = null terminated string array |
* @csStr = null terminated string array |
* @strnum = copy at most number of strings elements | * @strnum = copy at most number of strings elements, ==0 till NULL element |
* @qoses = QoS elements applied to subscribe variable, |
* @qoses = QoS elements applied to subscribe variable, |
* count of elements must be equal with csStr elements |
* count of elements must be equal with csStr elements |
* return: NULL error or != subscribe variables array, must be free after use with mqtt_freeSub() |
* return: NULL error or != subscribe variables array, must be free after use with mqtt_freeSub() |
*/ |
*/ |
mqtt_subscr_t *mqtt_str2subs(const char **csStr, unsigned short strnum, | mqtt_subscr_t *mqtt_strs2subs(const char **csStr, unsigned short strnum, unsigned char *qoses); |
unsigned char *qoses); | |
/* |
/* |
* mqtt_subFree() Free array from subscribe variables |
* mqtt_subFree() Free array from subscribe variables |
* |
* |