1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #pragma once
- #include <stdint.h>
- #include <stddef.h>
- #include <MqttBuildInfo.h>
- #if defined _WIN32 || defined _WIN64
- #define MQTT_DECL_EXPORT __declspec(dllexport)
- #define MQTT_DECL_IMPORT __declspec(dllimport)
- #else
- #define MQTT_DECL_EXPORT __attribute__((visibility("default")))
- #define MQTT_DECL_IMPORT
- #endif
- #ifdef USE_WASM
- #include <emscripten.h>
- #include <emscripten/bind.h>
- #include <emscripten/val.h>
- #include <emscripten/websocket.h>
- #define MQTTAPI EMSCRIPTEN_KEEPALIVE
- #elif defined MQTT_EXPORT
- #define MQTTAPI MQTT_DECL_EXPORT
- #else
- #define MQTTAPI MQTT_DECL_IMPORT
- #endif
- enum MqttErrorCode
- {
- MqttErrorSuccess,
- MqttErrorFailure = -1,
- MqttErrorDisconnected = -3,
- MqttErrorBadString = -5,
- MqttErrorNullParameter = -6,
- MqttErrorBadStructure = -7,
- MqttErrorBadQos = -8,
- MqttErrorNotSupported = -9,
- MqttErrorBadVersion = -10,
- MqttErrorBadProtocol = -11,
- };
- enum MqttVersion
- {
- MqttVersion_3_1 = 3,
- MqttVersion_3_1_1 = 4,
- MqttVersion_5 = 5,
- MqttVersion_6 = 6,
- };
|