version 1.2.10.1, 2013/05/26 20:27:58
|
version 1.3.4.2, 2022/09/12 21:52:57
|
Line 12 terms:
|
Line 12 terms:
|
All of the documentation and software included in the ELWIX and AITNET |
All of the documentation and software included in the ELWIX and AITNET |
Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
|
|
Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 | Copyright 2004 - 2022 |
by Michael Pounov <misho@elwix.org>. All rights reserved. |
by Michael Pounov <misho@elwix.org>. All rights reserved. |
|
|
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
Line 49 SUCH DAMAGE.
|
Line 49 SUCH DAMAGE.
|
|
|
#define MAX_CONNID 24 |
#define MAX_CONNID 24 |
#define MAX_CRED 13 |
#define MAX_CRED 13 |
#define MQTTMSG_MAX 65529 | #define MQTTMSG_MAX 65535 |
#define MQTT_DATA_MAX 268435455 |
#define MQTT_DATA_MAX 268435455 |
|
|
#define MQTT_PROTO_VER 3 |
#define MQTT_PROTO_VER 3 |
Line 69 struct mqtthdr {
|
Line 69 struct mqtthdr {
|
unsigned char val; |
unsigned char val; |
} 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 */ |
} __packed; | } __attribute__((packed)); |
#define MQTTHDR_MSGINIT(x) (assert((x)), (x)->mqtt_msg.val ^= (x)->mqtt_msg.val) |
#define MQTTHDR_MSGINIT(x) (assert((x)), (x)->mqtt_msg.val ^= (x)->mqtt_msg.val) |
#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)) |
|
|
Line 88 struct mqtthdr {
|
Line 88 struct mqtthdr {
|
#define MQTT_TYPE_PINGREQ 12 /* PING request */ |
#define MQTT_TYPE_PINGREQ 12 /* PING request */ |
#define MQTT_TYPE_PINGRESP 13 /* PING response */ |
#define MQTT_TYPE_PINGRESP 13 /* PING response */ |
#define MQTT_TYPE_DISCONNECT 14 /* client is disconnecting */ |
#define MQTT_TYPE_DISCONNECT 14 /* client is disconnecting */ |
|
#define MQTT_TYPE_AUTH 15 /* authentication exchange */ |
#define MQTT_TYPE_MAX 15 /* reserved */ |
#define MQTT_TYPE_MAX 15 /* reserved */ |
|
|
#define MQTT_FLAG_DUP 1 /* This flag is set when the client or server attempts to re-deliver |
#define MQTT_FLAG_DUP 1 /* This flag is set when the client or server attempts to re-deliver |
Line 170 typedef struct {
|
Line 171 typedef struct {
|
typedef struct { |
typedef struct { |
mqtt_len_t var_sb; |
mqtt_len_t var_sb; |
unsigned char var_data[0]; |
unsigned char var_data[0]; |
} __packed mqtthdr_var_t; | } __attribute__((packed)) mqtthdr_var_t; |
#define MQTTHDR_VAR_SIZEOF(x) (assert((x)), sizeof(mqtt_len_t) + ntohs((x)->var_sb.val)) |
#define MQTTHDR_VAR_SIZEOF(x) (assert((x)), sizeof(mqtt_len_t) + ntohs((x)->var_sb.val)) |
|
|
typedef unsigned char mqtthdr_protover_t; |
typedef unsigned char mqtthdr_protover_t; |
Line 186 typedef union {
|
Line 187 typedef union {
|
username:1; |
username:1; |
}; |
}; |
unsigned char flags; |
unsigned char flags; |
} __packed mqtthdr_connflgs_t; | } __attribute__((packed)) mqtthdr_connflgs_t; |
|
|
typedef struct { |
typedef struct { |
unsigned char reserved; |
unsigned char reserved; |
unsigned char retcode; |
unsigned char retcode; |
} __packed mqtthdr_connack_t; | } __attribute__((packed)) mqtthdr_connack_t; |
|
|
|
|
// ------------------------------------------------------- |
// ------------------------------------------------------- |