#pragma once #include #include #include #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 #include #include #include #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, };