Exported MQTT result codes

This commit is contained in:
Sergio R. Caprile 2022-07-01 15:15:38 -03:00
parent d6e1a3ab4c
commit 85d300ce71
4 changed files with 4 additions and 4 deletions

View File

@ -3004,8 +3004,6 @@ void mg_md5_final(mg_md5_ctx *ctx, unsigned char digest[16]) {
#define MQTT_HAS_PASSWORD 0x40 #define MQTT_HAS_PASSWORD 0x40
#define MQTT_HAS_USER_NAME 0x80 #define MQTT_HAS_USER_NAME 0x80
enum { MQTT_OK, MQTT_INCOMPLETE, MQTT_MALFORMED };
void mg_mqtt_send_header(struct mg_connection *c, uint8_t cmd, uint8_t flags, void mg_mqtt_send_header(struct mg_connection *c, uint8_t cmd, uint8_t flags,
uint32_t len) { uint32_t len) {
uint8_t buf[1 + sizeof(len)], *vlen = &buf[1]; uint8_t buf[1 + sizeof(len)], *vlen = &buf[1];

View File

@ -1230,6 +1230,8 @@ int64_t mg_sntp_parse(const unsigned char *buf, size_t len);
#define MQTT_CMD_DISCONNECT 14 #define MQTT_CMD_DISCONNECT 14
#define MQTT_CMD_AUTH 15 #define MQTT_CMD_AUTH 15
enum { MQTT_OK, MQTT_INCOMPLETE, MQTT_MALFORMED };
struct mg_mqtt_opts { struct mg_mqtt_opts {
struct mg_str user; // Username, can be empty struct mg_str user; // Username, can be empty
struct mg_str pass; // Password, can be empty struct mg_str pass; // Password, can be empty

View File

@ -12,8 +12,6 @@
#define MQTT_HAS_PASSWORD 0x40 #define MQTT_HAS_PASSWORD 0x40
#define MQTT_HAS_USER_NAME 0x80 #define MQTT_HAS_USER_NAME 0x80
enum { MQTT_OK, MQTT_INCOMPLETE, MQTT_MALFORMED };
void mg_mqtt_send_header(struct mg_connection *c, uint8_t cmd, uint8_t flags, void mg_mqtt_send_header(struct mg_connection *c, uint8_t cmd, uint8_t flags,
uint32_t len) { uint32_t len) {
uint8_t buf[1 + sizeof(len)], *vlen = &buf[1]; uint8_t buf[1 + sizeof(len)], *vlen = &buf[1];

View File

@ -19,6 +19,8 @@
#define MQTT_CMD_DISCONNECT 14 #define MQTT_CMD_DISCONNECT 14
#define MQTT_CMD_AUTH 15 #define MQTT_CMD_AUTH 15
enum { MQTT_OK, MQTT_INCOMPLETE, MQTT_MALFORMED };
struct mg_mqtt_opts { struct mg_mqtt_opts {
struct mg_str user; // Username, can be empty struct mg_str user; // Username, can be empty
struct mg_str pass; // Password, can be empty struct mg_str pass; // Password, can be empty