Giter VIP home page Giter VIP logo

azure-umqtt-c's Introduction

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Microsoft Azure MQTT

azure-umqtt-c is a C library for MQTT 3.1 protocol communication to Azure Cloud IoT Services.

Dependencies

azure-mqtt client use the azure-c-shared-utility, which is a C library provisioning common functionality for basic tasks (like string, list manipulation, IO, etc.). azure-c-shared-utility is available here: https://github.com/Azure/azure-c-shared-utility. azure-c-shared-utility needs to be built before building azure-mqtt-c.

Setup

Build

  • Clone azure-umqtt-c by:
git clone https://github.com/Azure/azure-umqtt-c.git
cd azure-umqtt-c
git submodule update --init
  • Create a folder cmake under azure-umqtt-c

  • Switch to the cmake folder and run

cmake ..
  • Build
cmake --build .

Installation and Use

Optionally, you may choose to install azure-umqtt-c on your machine:

  1. Switch to the cmake folder and run

    cmake -Duse_installed=ON ../
    cmake --build . --target install

    or install using the follow commands for each platform:

    On Linux:

    sudo make install

    On Windows:

    find_package(umqtt REQUIRED CONFIG)
    target_link_library(yourlib umqtt)

This requires that azure-c-shared-utility is installed (through CMake) on your machine.

If running tests, this requires that umock-c, azure-ctest, and azure-c-testrunnerswitcher are installed (through CMake) on your machine.

Building the tests

In order to build the tests use:

cmake .. -Drun_unittests:bool=ON

azure-umqtt-c's People

Contributors

andrew-buckley avatar anporumb avatar aribeironovaes avatar az-iot-builder-01 avatar bertkleewein avatar cartertinney avatar cipop avatar damonbarry avatar danewalton avatar dcristoloveanu avatar ericwol-msft avatar ewertons avatar hihigupt avatar iluican avatar jasmineymlo avatar jbobotek avatar jebrando avatar jetstreamroysprowl avatar jspaith avatar mamokarz avatar marcschier avatar markrad avatar massand avatar momuno avatar prmathur-microsoft avatar rleclair avatar tameraw avatar ttins avatar vaavva avatar villepalo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-umqtt-c's Issues

Get connection error while publishing

Hi all,

I'm trying to use this library to send messages to IoTHub broker, but it fails during the publish phase. In particular I get MQTT_CLIENT_CONNECTION_ERROR in the mqtt_client_dowork function. This is the code I'm using:

#include "azure_umqtt_c/mqtt_client.h"
#include "azure_c_shared_utility/socketio.h"
#include "azure_c_shared_utility/tls_config.h"
#include "azure_c_shared_utility/tlsio.h"
#include "azure_c_shared_utility/platform.h"
#include "azure_c_shared_utility/wsio.h"

std::string const MSG_BODY = "Message using umqtt: hello";

MQTT_CLIENT_HANDLE mqttHandle = NULL;
XIO_HANDLE xio = NULL;
bool isError = false;
bool connected = false;
bool published = false;
bool subscribed = false;
int packetId = 1;

void OnRecvCallback(MQTT_MESSAGE_HANDLE msgHandle, void* context)
{
    std::cout << "Recv callback" << std::endl;
}

void OnCloseComplete(void* context)
{
    std::cout << "close complete callback" << std::endl;
}

void OnOperationComplete(MQTT_CLIENT_HANDLE handle, MQTT_CLIENT_EVENT_RESULT actionResult, const void* msgInfo, void* callbackCtx)
{
    switch (actionResult)
    {
    case MQTT_CLIENT_ON_CONNACK:
    {
        std::cout << "connack called" << std::endl;
        connected = true;
        break;
    }
    case MQTT_CLIENT_ON_SUBSCRIBE_ACK:
    {
        std::cout << "subscribed_ack called" << std::endl;
        subscribed = true;
        break;
    }
    case MQTT_CLIENT_ON_PUBLISH_ACK:
    {
        std::cout << "publish_ack called" << std::endl;
        published = true;
        break;
    }
    case MQTT_CLIENT_ON_PUBLISH_RECV:
    {
        std::cout << "publish_recv called" << std::endl;
        break;
    }
    case MQTT_CLIENT_ON_PUBLISH_REL:
    {
        std::cout << "publish_rel called" << std::endl;
        break;
    }
    case MQTT_CLIENT_ON_PUBLISH_COMP:
    {
        std::cout << "publish_comp called" << std::endl;
        published = true;
        break;
    }
    case MQTT_CLIENT_ON_DISCONNECT:
        std::cout << "client disconnect called" << std::endl;
        connected = false;
        break;
    }
}

void OnErrorComplete(MQTT_CLIENT_HANDLE handle, MQTT_CLIENT_EVENT_ERROR error, void* callbackCtx)
{
    switch (error)
    {
    case MQTT_CLIENT_CONNECTION_ERROR:
        std::cout << "connection error" << std::endl;
        isError = true;
        connected = false;
        break;
    case MQTT_CLIENT_PARSE_ERROR:
        std::cout << "parse error" << std::endl;
        isError = true;
        connected = false;
        break;
    case MQTT_CLIENT_MEMORY_ERROR:
        std::cout << "memory error" << std::endl;
        isError = true;
        break;
    case MQTT_CLIENT_COMMUNICATION_ERROR:
        std::cout << "communication error" << std::endl;
        isError = true;
        connected = false;
        break;
    case MQTT_CLIENT_NO_PING_RESPONSE:
        std::cout <<"no ping response error" << std::endl;
        isError = true;
        connected = false;
        break;
    case MQTT_CLIENT_UNKNOWN_ERROR:
        std::cout << "unknown error" << std::endl;
        isError = true;
        connected = false;
        break;
    default:
        isError = true;
        connected = false;
        break;
    }
}

bool PublishMessage()
{
    published = false;

    std::stringstream msgText;
    msgText << MSG_BODY  << " # " << packetId;
    std::string msgTextString = msgText.str();
    std::cout << "trying to publish msg: \"" << msgTextString << "\"" << std::endl;
    std::vector<uint8_t> msgBody(msgTextString.begin(), msgTextString.end());
    MQTT_MESSAGE_HANDLE msg = mqttmessage_create(packetId++, TOPIC.c_str(), DELIVER_AT_LEAST_ONCE, &msgBody[0], msgBody.size());
    if (msg == NULL)
    {
        std::cout << "mqttmessage_create failed" << std::endl;
        return false;
    }

    if (mqtt_client_publish(mqttHandle, msg))
    {
        std::cout << "mqtt_client_publish failed" << std::endl;
        return false;
    }

    mqttmessage_destroy(msg);

    do
    {
        if (isError || !connected)
            return false;

        mqtt_client_dowork(mqttHandle);
    } while (!published);

    return true;
}

bool Connect()
{
    MQTT_CLIENT_OPTIONS options = { 0 };
    options.clientId = &CLIENTID[0];
    options.willMessage = NULL;
    options.username = &USERNAME[0];
    options.password = &PASSWORD[0];
    options.keepAliveInterval = 240;
    options.useCleanSession = false;
    options.qualityOfServiceValue = DELIVER_AT_LEAST_ONCE;
    if (mqtt_client_connect(mqttHandle, xio, &options) != 0)
    {
        std::cout << "mqtt_client_connect failed" << std::endl;
        return false;
    }

    do
    {
        if (isError)
            return false;

        mqtt_client_dowork(mqttHandle);
    } while (!connected);

    return true;
}

void Disconnect()
{
    xio_close(xio, OnCloseComplete, NULL);

    mqtt_client_deinit(mqttHandle);

    platform_deinit();
}

bool InitializeClient()
{
    if (platform_init() != 0)
    {
        std::cout << "platform_init failed" << std::endl;
        return false;
    }

    mqttHandle = mqtt_client_init(OnRecvCallback, OnOperationComplete, NULL, OnErrorComplete, NULL);
    if (mqttHandle == NULL)
    {
        std::cout << "mqtt_client_init failed" << std::endl;
        return false;
    }

    TLSIO_CONFIG tlsIOConfig;
    tlsIOConfig.hostname = HOST.c_str();
    tlsIOConfig.port = PORT;
    tlsIOConfig.underlying_io_interface = NULL;
    tlsIOConfig.underlying_io_parameters = NULL;

    const IO_INTERFACE_DESCRIPTION* tlsio_interface = platform_get_default_tlsio();
    xio = xio_create(tlsio_interface, &tlsIOConfig);


    if (xio == NULL)
    {
        std::cout << "xio_create failed" << std::endl;
        return false;
    }

    return true;
}

int main()
{
    if (!InitializeClient())
        return -1;

    if (!Connect())
        return -1;

    for (int i = 0; i < 10; i++)
    {
        if (!PublishMessage())
            break;
    }

    Disconnect();

    return 0;
}

This is the trace:

-> 09:08:15 CONNECT: 0x10 0xd5 0x01 0x00 0x04 0x4d 0x51 0x54 0x54 0x04 0xc0 0x00 0xf0 0x00 0x0b 0x75 0x61 0x6d 0x71 0x70 0x44 0x65 0x76 0x69 0x63 0x65 0x00 0x29 0x75 0x6e 0x69 0x71 0x6c 0x6f 0x75 0x64 0x64 0x65 0x76 0x2e 0x61 0x7a 0x75 0x72 0x65 0x2d 0x64 0x65 0x76 0x69 0x63 0x65 0x73 0x2e 0x6e 0x65 0x74 0x2f 0x75 0x61 0x6d 0x71 0x70 0x44 0x65 0x76 0x69 0x63 0x65 0x00 0x91 0x53 0x68 0x61 0x72 0x65 0x64 0x41 0x63 0x63 0x65 0x73 0x73 0x53 0x69 0x67 0x6e 0x61 0x74 0x75 0x72 0x65 0x20 0x73 0x72 0x3d 0x75 0x6e 0x69 0x71 0x6c 0x6f 0x75 0x64 0x64 0x65 0x76 0x2e 0x61 0x7a 0x75 0x72 0x65 0x2d 0x64 0x65 0x76 0x69 0x63 0x65 0x73 0x2e 0x6e 0x65 0x74 0x25 0x32 0x46 0x64 0x65 0x76 0x69 0x63 0x65 0x73 0x25 0x32 0x46 0x75 0x61 0x6d 0x71 0x70 0x44 0x65 0x76 0x69 0x63 0x65 0x26 0x73 0x69 0x67 0x3d 0x77 0x76 0x52 0x6d 0x5a 0x51 0x52 0x58 0x65 0x33 0x38 0x67 0x45 0x62 0x59 0x4c 0x37 0x71 0x74 0x67 0x33 0x71 0x52 0x38 0x63 0x5a 0x58 0x62 0x48 0x69 0x45 0x6d 0x6a 0x42 0x4e 0x25 0x32 0x42 0x38 0x6a 0x57 0x76 0x46 0x78 0x6f 0x25 0x33 0x44 0x26 0x73 0x65 0x3d 0x31 0x34 0x39 0x37 0x36 0x31 0x39 0x38 0x33 0x31
-> 09:08:15 CONNECT | VER: 4 | KEEPALIVE: 240 | FLAGS: 192 | USERNAME: xxxxxxx.azure-devices.net/myDevice | PWD: XXXX | CLEAN: 0
<- 09:08:15 CONNACK: 0x20 0x02 0x00 0x05
<- 09:08:15 CONNACK | SESSION_PRESENT: false | RETURN_CODE: 0x5
connack called
trying to publish msg: "Message using umqtt: hello # 1"
-> 09:08:15 PUBLISH: 0x32 0x58 0x00 0x36 0x64 0x65 0x76 0x69 0x63 0x65 0x73 0x2f 0x75 0x61 0x6d 0x71 0x70 0x44 0x65 0x76 0x69 0x63 0x65 0x2f 0x6d 0x65 0x73 0x73 0x61 0x67 0x65 0x73 0x2f 0x65 0x76 0x65 0x6e 0x74 0x73 0x2f 0x50 0x72 0x6f 0x70 0x4e 0x61 0x6d 0x65 0x3d 0x50 0x72 0x6f 0x70 0x4d 0x73 0x67 0x5f 0x30 0x00 0x01 0x4d 0x65 0x73 0x73 0x61 0x67 0x65 0x20 0x75 0x73 0x69 0x6e 0x67 0x20 0x75 0x6d 0x71 0x74 0x74 0x3a 0x20 0x68 0x65 0x6c 0x6c 0x6f 0x20 0x23 0x20 0x31
-> 09:08:15 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_LEAST_ONCE | TOPIC_NAME: devices/myDevice/messages/events/PropName=PropMsg_0 | PACKET_ID: 1 | PAYLOAD_LEN: 30
Error: Time:Mon Jun 19 09:08:15 2017 File:C:\Dev\ThirdParty\azure-umqtt-c-2017-14-06\c-utility\adapters\socketio_win32.c Func:_socketio_dowork Line:535 Socketio_Failure: Recieving data from endpoint: 10053.
connection error
Error: Time:Mon Jun 19 09:08:15 2017 File:C:\Dev\ThirdParty\azure-umqtt-c-2017-14-06\c-utility\src\tlsio_schannel.c Func:_tlsio_schannel_close Line:1188 invalid tls_io_instance->tlsio_state = TLSIO_STATE_NOT_OPEN

The password is a SAS token generated by the Device Explorer tool.
I'm running library cloned from the master branch on commit 5bddc79. The example runs on Windows 10 and uses schannel.

Thank you
Nicolo'

ping response timeout quesiton

my project is encountering a problem that azure-iot-c-sdk return NO_PING_REPSONE error to user application but it can immediately reconnect very quickly. I'm trying to understand the design of ping response.

  • By default we set it to 80s, and use the min(80, keepalive/2) in our code, why does the comment says 80% of send time?
  • MQTT spec left this to implementation of mqtt client, how did we decide to use this value?
  • do you see any customer in a poor network condition suffer this error but by adjust it to a higher value solve the problem?
  • do you think it will useful to make it configurable?

See MQTT Ping Response timeout section in https://docs.aws.amazon.com/embedded-csdk/latest/lib-ref/libraries/standard/coreMQTT/docs/doxygen/output/html/mqtt_timeouts.html#mqtt_timeouts_ping_response

Connect to IoTHub

Hi all,

I am not able to publish a message to IoTHub, I get a MQTT_CLIENT_ON_CONNACK and then a 'MQTT_CLIENT_CONNECTION_ERROR'. Maybe this is due to some parameter put in a wrong way. With the same parameters I am able to publish a message with another mqtt c client (Paho).

Could you please provide and example of how to connect and publish a message to IoTHub?

Thanks
Nicolo`

Compile error

Hi,

I am getting a compile error. Here is my spec:

  • gcc -dumpmachine
    x86_64-alpine-linux-musl
  • gcc --version
    gcc (Alpine 12.2.1_git20220924-r4) 12.2.1 20220924
    Copyright (C) 2022 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
image

Requesting a fix for same.
Thanks

UMQTT or Azure IoT SDK C?

I'm trying to send mqtt messages to Azure IoT Hub using the ESP32, and I see some conflicting resources. First off I know that both of these resources are based on the esp8266, and esp32 support may be some way out, but I am looking ahead to future Azure compatibility.

This Azure mqtt client shows one way to do it: https://github.com/Azure/azure-umqtt-c/blob/master/samples/mqtt_client_sample/mqtt_client_sample.c

And this Azure IoT SDK example shows another way to do it: https://github.com/Azure/azure-iot-sdk-c/blob/master/iothub_client/samples/iothub_client_sample_mqtt_esp8266/iothub_client_sample_mqtt_esp8266.c

Not sure which one I should be using... Any advice? At first glance the umqtt sample looks cleaner, but I have not dug into it too deeply.

Publisher and Subscriber in the same client

I want to implement 2 clients with feature of publisher and subscriber in the same client.

Client 1: Publisher will send data in every 1 second and subscriber will listen for any incoming message in another topic.

Client 2: Subscriber will receive any data and as soon as it receives the data it will publish the data to another topic.

Can you provide me with any examples? I am new to this library. Facing some difficulties.

compiliation problems when mqtt_client .h included by a cpp file

Hi all,

There is a cpp file in my project that includes <mqtt_client.h>. When I try to build my project, there are many compile errors like this:
In file included from /usr/local/include/azure_c_shared_utility/crt_abstractions.h:13:0, from /usr/local/include/azure_umqtt_c/mqttconst.h:16, from /usr/local/include/azure_umqtt_c/mqtt_client.h:16, from /home/hjy/ota/unittest/remote/remote_unittest.cc:10: /usr/include/c++/4.8/cmath: In function ‘constexpr float std::abs(float)’: /usr/include/c++/4.8/cmath:87:16: error: declaration of C function ‘constexpr float std::abs(float)’ conflicts with abs(float __x) ^ /usr/include/c++/4.8/cmath:81:3: error: previous declaration ‘constexpr double std::abs(double)’ here abs(double __x)
I suppose it's because some cpp headers are included after an extern "C" macro, for example
<cstddef> included by <mqttconst.h> included by <mqtt_client.h> which defines extern "C"
So I put all includes before __cplusplus macro in inc folder and it works. I wonder if it's a bug or my usage fault?

Thanks
Tracihuo

ESP32-Mqtt was not connected using Azure SSL Certificate

#include <WiFiClientSecure.h>

const char* ssid = "xxx"; // your network SSID (name of wifi network)
const char* password = "xxx"; // your network password
const char* server = "xxx.azure-devices.net"; // Server URL

const char* test_root_ca=
"-----BEGIN CERTIFICATE-----\n"
"-----END CERTIFICATE-----\n";

// You can use x.509 client certificates if you want
const char* test_client_key =
"-----BEGIN RSA PRIVATE KEY-----\n"
"-----END RSA PRIVATE KEY-----\n"; //to verify the client

const char* test_client_cert =
"-----BEGIN CERTIFICATE-----\n"
"-----END CERTIFICATE-----\n"; //to verify the client

WiFiClientSecure client;

void setup() {
//Initialize serial and wait for port to open:
Serial.begin(115200);
delay(100);

Serial.print("Attempting to connect to SSID: ");
Serial.println(ssid);
WiFi.begin(ssid, password);

// attempt to connect to Wifi network:
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
// wait 1 second for re-trying
delay(1000);
}

Serial.print("Connected to ");
Serial.println(ssid);

client.setCACert(test_root_ca);
client.setCertificate(test_client_cert); // for client verification
client.setPrivateKey(test_client_key); // for client verification

Serial.println("\nStarting connection to server...");
if (!client.connect(server, 8883)){
Serial.println("Connection failed!");
}
else {
Serial.println("Connected to server!");
}

}

void loop() {
// do nothing
}

Fails to publish message to IoTHub

Hi all,

I'm trying to use this library to send messages to IoTHub broker, but it fails during the publish phase. In particular the OnOperationComplete callback is never called, so I am stuck in a infinite loop waiting for the mqtt_client_dowork to complete the publish operation. This is the code I'm using:

#include "azure_umqtt_c/mqtt_client.h"
#include "azure_c_shared_utility/socketio.h"
#include "azure_c_shared_utility/tls_config.h"
#include "azure_c_shared_utility/tlsio.h"
#include "azure_c_shared_utility/platform.h"
#include "azure_c_shared_utility/wsio.h"

std::string const MSG_BODY = "Message using umqtt: hello";

MQTT_CLIENT_HANDLE mqttHandle = NULL;
XIO_HANDLE xio = NULL;
bool isError = false;
bool connected = false;
bool published = false;
bool subscribed = false;
int packetId = 0;

void OnRecvCallback(MQTT_MESSAGE_HANDLE msgHandle, void* context)
{
    std::cout << "Recv callback" << std::endl;
}

void OnCloseComplete(void* context)
{
    std::cout << "close complete callback" << std::endl;
}

void OnOperationComplete(MQTT_CLIENT_HANDLE handle, MQTT_CLIENT_EVENT_RESULT actionResult, const void* msgInfo, void* callbackCtx)
{
    switch (actionResult)
    {
    case MQTT_CLIENT_ON_CONNACK:
    {
        std::cout << "connack called" << std::endl;
        connected = true;
        break;
    }
    case MQTT_CLIENT_ON_SUBSCRIBE_ACK:
    {
        std::cout << "subscribed_ack called" << std::endl;
        subscribed = true;
        break;
    }
    case MQTT_CLIENT_ON_PUBLISH_ACK:
    {
        std::cout << "publish_ack called" << std::endl;
        published = true;
        break;
    }
    case MQTT_CLIENT_ON_PUBLISH_RECV:
    {
        std::cout << "publish_recv called" << std::endl;
        break;
    }
    case MQTT_CLIENT_ON_PUBLISH_REL:
    {
        std::cout << "publish_rel called" << std::endl;
        break;
    }
    case MQTT_CLIENT_ON_PUBLISH_COMP:
    {
        std::cout << "publish_comp called" << std::endl;
        published = true;
        break;
    }
    case MQTT_CLIENT_ON_DISCONNECT:
        std::cout << "client disconnect called" << std::endl;
        connected = false;
        break;
    }
}

void OnErrorComplete(MQTT_CLIENT_HANDLE handle, MQTT_CLIENT_EVENT_ERROR error, void* callbackCtx)
{
    switch (error)
    {
    case MQTT_CLIENT_CONNECTION_ERROR:
        std::cout << "connection error" << std::endl;
        isError = true;
        connected = false;
        break;
    case MQTT_CLIENT_PARSE_ERROR:
        std::cout << "parse error" << std::endl;
        isError = true;
        connected = false;
        break;
    case MQTT_CLIENT_MEMORY_ERROR:
        std::cout << "memory error" << std::endl;
        isError = true;
        break;
    case MQTT_CLIENT_COMMUNICATION_ERROR:
        std::cout << "communication error" << std::endl;
        isError = true;
        connected = false;
        break;
    case MQTT_CLIENT_NO_PING_RESPONSE:
        std::cout <<"no ping response error" << std::endl;
        isError = true;
        connected = false;
        break;
    case MQTT_CLIENT_UNKNOWN_ERROR:
        std::cout << "unknown error" << std::endl;
        isError = true;
        connected = false;
        break;
    default:
        isError = true;
        connected = false;
        break;
    }
}

bool PublishMessage()
{
    published = false;

    std::stringstream msgText;
    msgText << MSG_BODY  << " # " << packetId;
    std::string msgTextString = msgText.str();
    std::cout << "trying to publish msg: \"" << msgTextString << "\"" << std::endl;
    std::vector<uint8_t> msgBody(msgTextString.begin(), msgTextString.end());
    MQTT_MESSAGE_HANDLE msg = mqttmessage_create(packetId++, TOPIC.c_str(), DELIVER_AT_LEAST_ONCE, &msgBody[0], msgBody.size());
    if (msg == NULL)
    {
        std::cout << "mqttmessage_create failed" << std::endl;
        return false;
    }

    if (mqtt_client_publish(mqttHandle, msg))
    {
        std::cout << "mqtt_client_publish failed" << std::endl;
        return false;
    }

    mqttmessage_destroy(msg);

    do
    {
        if (isError || !connected)
            return false;

        mqtt_client_dowork(mqttHandle);
    } while (!published);

    return true;
}

bool Connect()
{
    MQTT_CLIENT_OPTIONS options = { 0 };
    options.clientId = &CLIENTID[0];
    options.willMessage = NULL;
    options.username = &USERNAME[0];
    options.password = &PASSWORD[0];
    options.keepAliveInterval = 240;
    options.useCleanSession = false;
    options.qualityOfServiceValue = DELIVER_AT_LEAST_ONCE;
    if (mqtt_client_connect(mqttHandle, xio, &options) != 0)
    {
        std::cout << "mqtt_client_connect failed" << std::endl;
        return false;
    }

    do
    {
        if (isError)
            return false;

        mqtt_client_dowork(mqttHandle);
    } while (!connected);

    return true;
}

void Disconnect()
{
    xio_close(xio, OnCloseComplete, NULL);

    mqtt_client_deinit(mqttHandle);

    platform_deinit();
}

bool InitializeClient()
{
    if (platform_init() != 0)
    {
        std::cout << "platform_init failed" << std::endl;
        return false;
    }

    mqttHandle = mqtt_client_init(OnRecvCallback, OnOperationComplete, NULL, OnErrorComplete, NULL);
    if (mqttHandle == NULL)
    {
        std::cout << "mqtt_client_init failed" << std::endl;
        return false;
    }

    TLSIO_CONFIG tlsIOConfig;
    tlsIOConfig.hostname = HOST.c_str();
    tlsIOConfig.port = PORT;
    tlsIOConfig.underlying_io_interface = NULL;
    tlsIOConfig.underlying_io_parameters = NULL;

    const IO_INTERFACE_DESCRIPTION* tlsio_interface = platform_get_default_tlsio();
    xio = xio_create(tlsio_interface, &tlsIOConfig);


    if (xio == NULL)
    {
        std::cout << "xio_create failed" << std::endl;
        return false;
    }

    return true;
}

int main()
{
    if (!InitializeClient())
        return -1;

    if (!Connect())
        return -1;

    for (int i = 0; i < 10; i++)
    {
        if (!PublishMessage())
            break;
    }

    Disconnect();

    return 0;
}

The password is a SAS token generated by the Device Explorer tool.
I'm running library cloned from the master branch on commit 5bddc79. The example runs on Windows 10 and uses schannel.

Random connection failure to IoTHub

Hi all,

I'm trying to use this library to send messages to a IoT Hub S1 instance, but sometimes it fails during the connection phase. This is the log from the library:

Error: File:C:\umqtt\c-utility\adapters\socketio_win32.c Func:_socketio_open Line:306 Failure: connect failure 10060.
Error: File:C:\umqtt\c-utility\src\tlsio_openssl.c Func:_tlsio_openssl_close Line:1263 Invalid tlsio_state. Expected state is TLSIO_STATE_NOT_OPEN or TLSIO_STATE_CLOSING.
Error: File:C:\umqtt\c-utility\src\tlsio_openssl.c Func:_on_underlying_io_open_complete Line:687 Invalid tlsio_state. Expected state is TLSIO_STATE_OPENING_UNDERLYING_IO.
Error: File:C:\umqtt\c-utility\src\tlsio_openssl.c Func:_tlsio_openssl_open Line:1232 Failed opening the underlying I/O.
Error: File:C:\umqtt\src\mqtt_client.c Func:_mqtt_client_connect Line:906 Error: io_open failed

Wireshark showed a SYN message sent and two TCP retrasmissions. Then the library fails.
When I use websockets I never get this error.

This is the code I'm running:


#include "azure_umqtt_c/mqtt_client.h"
#include "azure_c_shared_utility/socketio.h"
#include "azure_c_shared_utility/tls_config.h"
#include "azure_c_shared_utility/tlsio.h"
#include "azure_c_shared_utility/platform.h"
#include "azure_c_shared_utility/wsio.h"

std::string const MSG_BODY = "Message using umqtt: hello";

MQTT_CLIENT_HANDLE mqttHandle = NULL;
XIO_HANDLE xio = NULL;
bool isError = false;
bool connected = false;
bool published = false;
bool subscribed = false;
int packetId = 1;
char msgText[1024];

void OnRecvCallback(MQTT_MESSAGE_HANDLE msgHandle, void* context)
{
    std::cout << "Recv callback" << std::endl;
}

void OnCloseComplete(void* context)
{
    std::cout << "close complete callback" << std::endl;
}

void processConnAckReturnCode(CONNECT_RETURN_CODE code)
{
    switch (code)
    {
    case CONNECTION_ACCEPTED:
        std::cout << "return code: CONNECTION_ACCEPTED" << std::endl;
        connected = true;
        break;
    case CONN_REFUSED_UNACCEPTABLE_VERSION:
        std::cout << "return code: CONN_REFUSED_UNACCEPTABLE_VERSION" << std::endl;
        connected = false;
        break;
    case CONN_REFUSED_ID_REJECTED:
        std::cout << "return code: CONNECTIOCONN_REFUSED_ID_REJECTEDN_ACCEPTED" << std::endl;
        connected = false;
        break;
    case CONN_REFUSED_SERVER_UNAVAIL:
        std::cout << "return code: CONN_REFUSED_SERVER_UNAVAIL" << std::endl;
        connected = false;
        break;
    case CONN_REFUSED_BAD_USERNAME_PASSWORD:
        std::cout << "return code: CONN_REFUSED_BAD_USERNAME_PASSWORD" << std::endl;
        connected = false;
        break;
    case CONN_REFUSED_NOT_AUTHORIZED:
        std::cout << "return code: CONN_REFUSED_NOT_AUTHORIZED" << std::endl;
        connected = false;
        break;
    case CONN_REFUSED_UNKNOWN:
        std::cout << "return code: CONN_REFUSED_UNKNOWN" << std::endl;
        connected = false;
        break;
    }
}


void OnOperationComplete(MQTT_CLIENT_HANDLE handle, MQTT_CLIENT_EVENT_RESULT actionResult, const void* msgInfo, void* callbackCtx)
{
    switch (actionResult)
    {
    case MQTT_CLIENT_ON_CONNACK:
    {
        const CONNECT_ACK* connack = (const CONNECT_ACK*)msgInfo;
        std::cout << "connack called" << std::endl;
        processConnAckReturnCode(connack->returnCode);
        break;
    }
    case MQTT_CLIENT_ON_SUBSCRIBE_ACK:
    {
        std::cout << "subscribed_ack called" << std::endl;
        subscribed = true;
        break;
    }
    case MQTT_CLIENT_ON_PUBLISH_ACK:
    {
        std::cout << "publish_ack called" << std::endl;
        published = true;
        break;
    }
    case MQTT_CLIENT_ON_PUBLISH_RECV:
    {
        std::cout << "publish_recv called" << std::endl;
        break;
    }
    case MQTT_CLIENT_ON_PUBLISH_REL:
    {
        std::cout << "publish_rel called" << std::endl;
        break;
    }
    case MQTT_CLIENT_ON_PUBLISH_COMP:
    {
        std::cout << "publish_comp called" << std::endl;
        published = true;
        break;
    }
    case MQTT_CLIENT_ON_DISCONNECT:
        std::cout << "client disconnect called" << std::endl;
        connected = false;
        break;
    }
}

void OnErrorComplete(MQTT_CLIENT_HANDLE handle, MQTT_CLIENT_EVENT_ERROR error, void* callbackCtx)
{
    switch (error)
    {
    case MQTT_CLIENT_CONNECTION_ERROR:
        std::cout << "connection error" << std::endl;
        isError = true;
        connected = false;
        break;
    case MQTT_CLIENT_PARSE_ERROR:
        std::cout << "parse error" << std::endl;
        isError = true;
        connected = false;
        break;
    case MQTT_CLIENT_MEMORY_ERROR:
        std::cout << "memory error" << std::endl;
        isError = true;
        break;
    case MQTT_CLIENT_COMMUNICATION_ERROR:
        std::cout << "communication error" << std::endl;
        isError = true;
        connected = false;
        break;
    case MQTT_CLIENT_NO_PING_RESPONSE:
        std::cout <<"no ping response error" << std::endl;
        isError = true;
        connected = false;
        break;
    case MQTT_CLIENT_UNKNOWN_ERROR:
        std::cout << "unknown error" << std::endl;
        isError = true;
        connected = false;
        break;
    default:
        isError = true;
        connected = false;
        break;
    }
}

bool PublishMessage()
{
    published = false;

    std::stringstream msgText;
    msgText << MSG_BODY  << " # " << packetId;
    std::string msgTextString = msgText.str();
    std::cout << "trying to publish msg: \"" << msgTextString << "\"" << std::endl;
    std::vector<uint8_t> msgBody(msgTextString.begin(), msgTextString.end());

    MQTT_MESSAGE_HANDLE msg = mqttmessage_create(packetId++, TOPIC.c_str(), DELIVER_AT_LEAST_ONCE, &msgBody[0], msgBody.size());
    if (msg == NULL)
    {
        std::cout << "mqttmessage_create failed" << std::endl;
        return false;
    }

    if (mqtt_client_publish(mqttHandle, msg))
    {
        std::cout << "mqtt_client_publish failed" << std::endl;
        return false;
    }

    mqttmessage_destroy(msg);

    do
    {
        if (isError || !connected)
            return false;

        mqtt_client_dowork(mqttHandle);
    } while (!published);

    return true;
}

bool Connect()
{
    MQTT_CLIENT_OPTIONS options = { 0 };
    options.clientId = &CLIENTID[0];
    options.willMessage = NULL;
#ifdef PASSWORD
    options.username = &USERNAME[0];
#endif
#ifdef USERNAME
    options.password = &PASSWORD[0];
#endif
    options.keepAliveInterval = 240;
    options.useCleanSession = false;
    options.qualityOfServiceValue = DELIVER_AT_LEAST_ONCE;
    if (mqtt_client_connect(mqttHandle, xio, &options) != 0)
    {
        std::cout << "mqtt_client_connect failed" << std::endl;
        return false;
    }

    do
    {
        if (isError)
            return false;

        mqtt_client_dowork(mqttHandle);
    } while (!connected);

    return true;
}

void Disconnect()
{
    xio_close(xio, OnCloseComplete, NULL);

    mqtt_client_deinit(mqttHandle);

    platform_deinit();
}

bool InitializeClient()
{
    if (platform_init() != 0)
    {
        std::cout << "platform_init failed" << std::endl;
        return false;
    }

    mqttHandle = mqtt_client_init(OnRecvCallback, OnOperationComplete, NULL, OnErrorComplete, NULL);
    if (mqttHandle == NULL)
    {
        std::cout << "mqtt_client_init failed" << std::endl;
        return false;
    }

    mqtt_client_set_trace(mqttHandle, true, true);

    TLSIO_CONFIG tlsIOConfig;
    tlsIOConfig.hostname = HOST.c_str();
    tlsIOConfig.port = PORT;
    tlsIOConfig.underlying_io_interface = NULL;
    tlsIOConfig.underlying_io_parameters = NULL;
    std::string trustStore = TRUST_STORE_PATH;
    if (!ClientLib::Utils::FileSystem::FileExists(trustStore))
    {
        std::cout << "file " << trustStore << " does not exists" << std::endl;
        return false;
    }

    tlsIOConfig.trustStore = trustStore.c_str();

#ifdef USE_WEBSOCKETS
    // create the WS IO
    WSIO_CONFIG wsioConfig;
    wsioConfig.hostname = HOST.c_str();
    wsioConfig.port = PORT;
    wsioConfig.protocol = PROTOCOL_NAME.c_str();
    wsioConfig.resource_name = RELATIVE_PATH.c_str();
    wsioConfig.underlying_io_interface = platform_get_default_tlsio();
    wsioConfig.underlying_io_parameters = &tlsIOConfig;

    const IO_INTERFACE_DESCRIPTION* tlsio_interface = wsio_get_interface_description();
    xio = xio_create(tlsio_interface, &wsioConfig);

    (void)xio_setoption(xio, "TrustedCerts", TRUST_STORE_CONTENT.c_str());
#else

    const IO_INTERFACE_DESCRIPTION* tlsio_interface = platform_get_default_tlsio();
    xio = xio_create(tlsio_interface, &tlsIOConfig);

#endif

    if (xio == NULL)
    {
        std::cout << "xio_create failed" << std::endl;
        return false;
    }

    return true;
}

int main()
{
    if (!InitializeClient())
        return -1;

    if (!Connect())
        return -1;

    for (int i = 0; i < 10; i++)
    {
        if (!PublishMessage())
            break;
    }

    Disconnect();

    return 0;
}

I'm running the version tagged as Release 2017-06-16. The example runs on Windows 10 and uses openssl.

Relationship between this library and Azure Iot SDK MQTT code?

Hi,

Just curious what the relationship is between this library and the MQTT code in Azure Iot SDK?

Is this library intended to be used in embedded device only? If so, which library provides the server-side code for the IoT hub?

I am looking to use an MQTT server in a .NET project (that doesn't have access to the cloud). I see Azure IoT SDK is already providing me code for the client, but what about the server? Is the code for the MQTT part of Azure IoT Hub publicly available?

Cheers,
Jack

error: unknown type name ‘QOS_VALUE’

Failed to build umqtt as

[ 95%] Building C object CMakeFiles/umqtt.dir/src/mqtt_codec.c.o
/usr/bin/cc  -I....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc -I....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/inc -I....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/pal/linux -I....../azure-iot-sdk-c/azure-umqtt-c/inc -I....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc -std=gnu99 -D_POSIX_C_SOURCE=200112L  -Werror -Werror -O3 -DNDEBUG -fPIC -std=gnu99 -MD -MT CMakeFiles/umqtt.dir/src/mqtt_client.c.o -MF CMakeFiles/umqtt.dir/src/mqtt_client.c.o.d -o CMakeFiles/umqtt.dir/src/mqtt_client.c.o -c ....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c
/usr/bin/cc  -I....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc -I....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/inc -I....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/pal/linux -I....../azure-iot-sdk-c/azure-umqtt-c/inc -I....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc -std=gnu99 -D_POSIX_C_SOURCE=200112L  -Werror -Werror -O3 -DNDEBUG -fPIC -std=gnu99 -MD -MT CMakeFiles/umqtt.dir/src/mqtt_message.c.o -MF CMakeFiles/umqtt.dir/src/mqtt_message.c.o.d -o CMakeFiles/umqtt.dir/src/mqtt_message.c.o -c ....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c
/usr/bin/cc  -I....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc -I....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/inc -I....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/pal/linux -I....../azure-iot-sdk-c/azure-umqtt-c/inc -I....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc -std=gnu99 -D_POSIX_C_SOURCE=200112L  -Werror -Werror -O3 -DNDEBUG -fPIC -std=gnu99 -MD -MT CMakeFiles/umqtt.dir/src/mqtt_codec.c.o -MF CMakeFiles/umqtt.dir/src/mqtt_codec.c.o.d -o CMakeFiles/umqtt.dir/src/mqtt_codec.c.o -c ....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c
In file included from ....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_message.h:7,
                 from ....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:5:
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:20:19: error: expected ‘)’ before numeric constant
   20 |     CONNECT_TYPE, 0x10, \
      |                   ^~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:39:39: note: in expansion of macro ‘CONTROL_PACKET_TYPE_VALUES’
   39 | MU_DEFINE_ENUM_2(CONTROL_PACKET_TYPE, CONTROL_PACKET_TYPE_VALUES)
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:53:3: error: data definition has no type or storage class [-Werror]
   53 | } APP_PAYLOAD;
      |   ^~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:53:3: error: type defaults to ‘int’ in declaration of ‘APP_PAYLOAD’ [-Werror=implicit-int]
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:65:5: error: unknown type name ‘QOS_VALUE’
   65 |     QOS_VALUE qualityOfServiceValue;
      |     ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:89:5: error: unknown type name ‘QOS_VALUE’
   89 |     QOS_VALUE qosReturn;
      |     ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:95:5: error: unknown type name ‘QOS_VALUE’
   95 |     QOS_VALUE* qosReturn;
      |     ^~~~~~~~~
In file included from ....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_message.h:8,
                 from ....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:5:
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_message.h:22:115: error: unknown type name ‘QOS_VALUE’
   22 | MOCKABLE_FUNCTION(, MQTT_MESSAGE_HANDLE, mqttmessage_create_in_place, uint16_t, packetId, const char*, topicName, QOS_VALUE, qosValue, const uint8_t*, appMsg, size_t, appMsgLength);
      |                                                                                                                   ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:88:66: note: in definition of macro ‘UMOCK_C_PROD_ARG_IN_SIGNATURE’
   88 | #define UMOCK_C_PROD_ARG_IN_SIGNATURE(count, arg_type, arg_name) arg_type arg_name MU_IFCOMMA(count)
      |                                                                  ^~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc/macro_utils/macro_utils_generated.h:12489:1: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED_6’
12489 | MU_FOR_EACH_2_COUNTED_6(X, P3, P4, P5, P6, P7, P8)
      | ^~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc/macro_utils/macro_utils_generated.h:12493:1: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED_8’
12493 | MU_FOR_EACH_2_COUNTED_8(X, P3, P4, P5, P6, P7, P8, P9, P10)
      | ^~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc/macro_utils/macro_utils.h:39:21: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED_10’
   39 | #define MU_C2_(x,y) x##y
      |                     ^
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:91:70: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED’
   91 |     result modifiers function(MU_IF(MU_COUNT_ARG(__VA_ARGS__),,void) MU_FOR_EACH_2_COUNTED(UMOCK_C_PROD_ARG_IN_SIGNATURE, __VA_ARGS__))
      |                                                                      ^~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:101:5: note: in expansion of macro ‘MOCKABLE_FUNCTION_SIGNATURE’
  101 |     MOCKABLE_FUNCTION_SIGNATURE(modifiers, result, function, ##__VA_ARGS__);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_message.h:22:1: note: in expansion of macro ‘MOCKABLE_FUNCTION’
   22 | MOCKABLE_FUNCTION(, MQTT_MESSAGE_HANDLE, mqttmessage_create_in_place, uint16_t, packetId, const char*, topicName, QOS_VALUE, qosValue, const uint8_t*, appMsg, size_t, appMsgLength);
      | ^~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_message.h:23:106: error: unknown type name ‘QOS_VALUE’
   23 | MOCKABLE_FUNCTION(, MQTT_MESSAGE_HANDLE, mqttmessage_create, uint16_t, packetId, const char*, topicName, QOS_VALUE, qosValue, const uint8_t*, appMsg, size_t, appMsgLength);
      |                                                                                                          ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:88:66: note: in definition of macro ‘UMOCK_C_PROD_ARG_IN_SIGNATURE’
   88 | #define UMOCK_C_PROD_ARG_IN_SIGNATURE(count, arg_type, arg_name) arg_type arg_name MU_IFCOMMA(count)
      |                                                                  ^~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc/macro_utils/macro_utils_generated.h:12489:1: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED_6’
12489 | MU_FOR_EACH_2_COUNTED_6(X, P3, P4, P5, P6, P7, P8)
      | ^~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc/macro_utils/macro_utils_generated.h:12493:1: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED_8’
12493 | MU_FOR_EACH_2_COUNTED_8(X, P3, P4, P5, P6, P7, P8, P9, P10)
      | ^~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc/macro_utils/macro_utils.h:39:21: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED_10’
   39 | #define MU_C2_(x,y) x##y
      |                     ^
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:91:70: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED’
   91 |     result modifiers function(MU_IF(MU_COUNT_ARG(__VA_ARGS__),,void) MU_FOR_EACH_2_COUNTED(UMOCK_C_PROD_ARG_IN_SIGNATURE, __VA_ARGS__))
      |                                                                      ^~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:101:5: note: in expansion of macro ‘MOCKABLE_FUNCTION_SIGNATURE’
  101 |     MOCKABLE_FUNCTION_SIGNATURE(modifiers, result, function, ##__VA_ARGS__);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_message.h:23:1: note: in expansion of macro ‘MOCKABLE_FUNCTION’
   23 | MOCKABLE_FUNCTION(, MQTT_MESSAGE_HANDLE, mqttmessage_create, uint16_t, packetId, const char*, topicName, QOS_VALUE, qosValue, const uint8_t*, appMsg, size_t, appMsgLength);
      | ^~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_message.h:39:21: error: unknown type name ‘QOS_VALUE’
   39 | MOCKABLE_FUNCTION(, QOS_VALUE, mqttmessage_getQosType, MQTT_MESSAGE_HANDLE, handle);
      |                     ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:91:5: note: in definition of macro ‘MOCKABLE_FUNCTION_SIGNATURE’
   91 |     result modifiers function(MU_IF(MU_COUNT_ARG(__VA_ARGS__),,void) MU_FOR_EACH_2_COUNTED(UMOCK_C_PROD_ARG_IN_SIGNATURE, __VA_ARGS__))
      |     ^~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_message.h:39:1: note: in expansion of macro ‘MOCKABLE_FUNCTION’
   39 | MOCKABLE_FUNCTION(, QOS_VALUE, mqttmessage_getQosType, MQTT_MESSAGE_HANDLE, handle);
      | ^~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_message.h:44:38: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
   44 | MOCKABLE_FUNCTION(, const APP_PAYLOAD*, mqttmessage_getApplicationMsg, MQTT_MESSAGE_HANDLE, handle);
      |                                      ^
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:91:5: note: in definition of macro ‘MOCKABLE_FUNCTION_SIGNATURE’
   91 |     result modifiers function(MU_IF(MU_COUNT_ARG(__VA_ARGS__),,void) MU_FOR_EACH_2_COUNTED(UMOCK_C_PROD_ARG_IN_SIGNATURE, __VA_ARGS__))
      |     ^~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_message.h:44:1: note: in expansion of macro ‘MOCKABLE_FUNCTION’
   44 | MOCKABLE_FUNCTION(, const APP_PAYLOAD*, mqttmessage_getApplicationMsg, MQTT_MESSAGE_HANDLE, handle);
      | ^~~~~~~~~~~~~~~~~
In file included from ....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_client.h:9,
                 from ....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:18:
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:20:19: error: expected ‘)’ before numeric constant
   20 |     CONNECT_TYPE, 0x10, \
      |                   ^~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:39:39: note: in expansion of macro ‘CONTROL_PACKET_TYPE_VALUES’
   39 | MU_DEFINE_ENUM_2(CONTROL_PACKET_TYPE, CONTROL_PACKET_TYPE_VALUES)
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:53:3: error: data definition has no type or storage class [-Werror]
   53 | } APP_PAYLOAD;
      |   ^~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:53:3: error: type defaults to ‘int’ in declaration of ‘APP_PAYLOAD’ [-Werror=implicit-int]
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:65:5: error: unknown type name ‘QOS_VALUE’
   65 |     QOS_VALUE qualityOfServiceValue;
      |     ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:89:5: error: unknown type name ‘QOS_VALUE’
   89 |     QOS_VALUE qosReturn;
      |     ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:95:5: error: unknown type name ‘QOS_VALUE’
   95 |     QOS_VALUE* qosReturn;
      |     ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:15:5: error: unknown type name ‘QOS_VALUE’
   15 |     QOS_VALUE qosInfo;
      |     ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:18:5: error: expected specifier-qualifier-list before ‘APP_PAYLOAD’
   18 |     APP_PAYLOAD appPayload;
      |     ^~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:27:59: error: unknown type name ‘QOS_VALUE’
   27 | static MQTT_MESSAGE* create_msg_object(uint16_t packetId, QOS_VALUE qosValue)
      |                                                           ^~~~~~~~~
In file included from ....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_message.h:8,
                 from ....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_client.h:10,
                 from ....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:18:
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_message.h:22:115: error: unknown type name ‘QOS_VALUE’
   22 | MOCKABLE_FUNCTION(, MQTT_MESSAGE_HANDLE, mqttmessage_create_in_place, uint16_t, packetId, const char*, topicName, QOS_VALUE, qosValue, const uint8_t*, appMsg, size_t, appMsgLength);
      |                                                                                                                   ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:88:66: note: in definition of macro ‘UMOCK_C_PROD_ARG_IN_SIGNATURE’
   88 | #define UMOCK_C_PROD_ARG_IN_SIGNATURE(count, arg_type, arg_name) arg_type arg_name MU_IFCOMMA(count)
      |                                                                  ^~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc/macro_utils/macro_utils_generated.h:12489:1: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED_6’
12489 | MU_FOR_EACH_2_COUNTED_6(X, P3, P4, P5, P6, P7, P8)
      | ^~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc/macro_utils/macro_utils_generated.h:12493:1: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED_8’
12493 | MU_FOR_EACH_2_COUNTED_8(X, P3, P4, P5, P6, P7, P8, P9, P10)
      | ^~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc/macro_utils/macro_utils.h:39:21: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED_10’
   39 | #define MU_C2_(x,y) x##y
      |                     ^
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:91:70: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED’
   91 |     result modifiers function(MU_IF(MU_COUNT_ARG(__VA_ARGS__),,void) MU_FOR_EACH_2_COUNTED(UMOCK_C_PROD_ARG_IN_SIGNATURE, __VA_ARGS__))
      |                                                                      ^~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:101:5: note: in expansion of macro ‘MOCKABLE_FUNCTION_SIGNATURE’
  101 |     MOCKABLE_FUNCTION_SIGNATURE(modifiers, result, function, ##__VA_ARGS__);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_message.h:22:1: note: in expansion of macro ‘MOCKABLE_FUNCTION’
   22 | MOCKABLE_FUNCTION(, MQTT_MESSAGE_HANDLE, mqttmessage_create_in_place, uint16_t, packetId, const char*, topicName, QOS_VALUE, qosValue, const uint8_t*, appMsg, size_t, appMsgLength);
      | ^~~~~~~~~~~~~~~~~
In file included from ....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_codec.h:10,
                 from ....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:12:
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:20:19: error: expected ‘)’ before numeric constant
   20 |     CONNECT_TYPE, 0x10, \
      |                   ^~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:39:39: note: in expansion of macro ‘CONTROL_PACKET_TYPE_VALUES’
   39 | MU_DEFINE_ENUM_2(CONTROL_PACKET_TYPE, CONTROL_PACKET_TYPE_VALUES)
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:53:3: error: data definition has no type or storage class [-Werror]
   53 | } APP_PAYLOAD;
      |   ^~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:53:3: error: type defaults to ‘int’ in declaration of ‘APP_PAYLOAD’ [-Werror=implicit-int]
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:65:5: error: unknown type name ‘QOS_VALUE’
   65 |     QOS_VALUE qualityOfServiceValue;
      |     ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:89:5: error: unknown type name ‘QOS_VALUE’
   89 |     QOS_VALUE qosReturn;
      |     ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:95:5: error: unknown type name ‘QOS_VALUE’
   95 |     QOS_VALUE* qosReturn;
      |     ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:46:91: error: unknown type name ‘QOS_VALUE’
   46 | MQTT_MESSAGE_HANDLE mqttmessage_create_in_place(uint16_t packetId, const char* topicName, QOS_VALUE qosValue, const uint8_t* appMsg, size_t appMsgLength)
      |                                                                                           ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_message.h:23:106: error: unknown type name ‘QOS_VALUE’
   23 | MOCKABLE_FUNCTION(, MQTT_MESSAGE_HANDLE, mqttmessage_create, uint16_t, packetId, const char*, topicName, QOS_VALUE, qosValue, const uint8_t*, appMsg, size_t, appMsgLength);
      |                                                                                                          ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:88:66: note: in definition of macro ‘UMOCK_C_PROD_ARG_IN_SIGNATURE’
   88 | #define UMOCK_C_PROD_ARG_IN_SIGNATURE(count, arg_type, arg_name) arg_type arg_name MU_IFCOMMA(count)
      |                                                                  ^~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc/macro_utils/macro_utils_generated.h:12489:1: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED_6’
12489 | MU_FOR_EACH_2_COUNTED_6(X, P3, P4, P5, P6, P7, P8)
      | ^~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc/macro_utils/macro_utils_generated.h:12493:1: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED_8’
12493 | MU_FOR_EACH_2_COUNTED_8(X, P3, P4, P5, P6, P7, P8, P9, P10)
      | ^~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc/macro_utils/macro_utils.h:39:21: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED_10’
   39 | #define MU_C2_(x,y) x##y
      |                     ^
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:91:70: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED’
   91 |     result modifiers function(MU_IF(MU_COUNT_ARG(__VA_ARGS__),,void) MU_FOR_EACH_2_COUNTED(UMOCK_C_PROD_ARG_IN_SIGNATURE, __VA_ARGS__))
      |                                                                      ^~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:101:5: note: in expansion of macro ‘MOCKABLE_FUNCTION_SIGNATURE’
  101 |     MOCKABLE_FUNCTION_SIGNATURE(modifiers, result, function, ##__VA_ARGS__);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_message.h:23:1: note: in expansion of macro ‘MOCKABLE_FUNCTION’
   23 | MOCKABLE_FUNCTION(, MQTT_MESSAGE_HANDLE, mqttmessage_create, uint16_t, packetId, const char*, topicName, QOS_VALUE, qosValue, const uint8_t*, appMsg, size_t, appMsgLength);
      | ^~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:78:82: error: unknown type name ‘QOS_VALUE’
   78 | MQTT_MESSAGE_HANDLE mqttmessage_create(uint16_t packetId, const char* topicName, QOS_VALUE qosValue, const uint8_t* appMsg, size_t appMsgLength)
      |                                                                                  ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c: In function ‘mqttmessage_destroy’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:146:19: error: ‘struct MQTT_MESSAGE_TAG’ has no member named ‘appPayload’
  146 |         if (handle->appPayload.message != NULL)
      |                   ^~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:148:24: error: ‘struct MQTT_MESSAGE_TAG’ has no member named ‘appPayload’
  148 |             free(handle->appPayload.message);
      |                        ^~
In file included from ....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:12:
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_codec.h:25:59: error: unknown type name ‘CONTROL_PACKET_TYPE’; did you mean ‘CONTROL_PACKET_TYPE_VALUES’?
   25 | typedef void(*ON_PACKET_COMPLETE_CALLBACK)(void* context, CONTROL_PACKET_TYPE packet, int flags, BUFFER_HANDLE headerData);
      |                                                           ^~~~~~~~~~~~~~~~~~~
      |                                                           CONTROL_PACKET_TYPE_VALUES
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_message.h:39:21: error: unknown type name ‘QOS_VALUE’
   39 | MOCKABLE_FUNCTION(, QOS_VALUE, mqttmessage_getQosType, MQTT_MESSAGE_HANDLE, handle);
      |                     ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:91:5: note: in definition of macro ‘MOCKABLE_FUNCTION_SIGNATURE’
   91 |     result modifiers function(MU_IF(MU_COUNT_ARG(__VA_ARGS__),,void) MU_FOR_EACH_2_COUNTED(UMOCK_C_PROD_ARG_IN_SIGNATURE, __VA_ARGS__))
      |     ^~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_message.h:39:1: note: in expansion of macro ‘MOCKABLE_FUNCTION’
   39 | MOCKABLE_FUNCTION(, QOS_VALUE, mqttmessage_getQosType, MQTT_MESSAGE_HANDLE, handle);
      | ^~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c: In function ‘mqttmessage_clone’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:166:18: error: implicit declaration of function ‘mqttmessage_create’; did you mean ‘mqttmessage_clone’? [-Werror=implicit-function-declaration]
  166 |         result = mqttmessage_create(handle->packetId, handle->topicName, handle->qosInfo, handle->appPayload.message, handle->appPayload.length);
      |                  ^~~~~~~~~~~~~~~~~~
      |                  mqttmessage_clone
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:166:97: error: ‘struct MQTT_MESSAGE_TAG’ has no member named ‘appPayload’
  166 |         result = mqttmessage_create(handle->packetId, handle->topicName, handle->qosInfo, handle->appPayload.message, handle->appPayload.length);
      |                                                                                                 ^~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:166:125: error: ‘struct MQTT_MESSAGE_TAG’ has no member named ‘appPayload’
  166 |         result = mqttmessage_create(handle->packetId, handle->topicName, handle->qosInfo, handle->appPayload.message, handle->appPayload.length);
      |                                                                                                                             ^~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:169:19: error: ‘struct MQTT_MESSAGE_TAG’ has no member named ‘isDuplicateMsg’
  169 |             result->isDuplicateMsg = handle->isDuplicateMsg;
      |                   ^~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:169:44: error: ‘struct MQTT_MESSAGE_TAG’ has no member named ‘isDuplicateMsg’
  169 |             result->isDuplicateMsg = handle->isDuplicateMsg;
      |                                            ^~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:170:19: error: ‘struct MQTT_MESSAGE_TAG’ has no member named ‘isMessageRetained’
  170 |             result->isMessageRetained = handle->isMessageRetained;
      |                   ^~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:170:47: error: ‘struct MQTT_MESSAGE_TAG’ has no member named ‘isMessageRetained’
  170 |             result->isMessageRetained = handle->isMessageRetained;
      |                                               ^~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c: In function ‘mqttmessage_getTopicName’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:207:28: error: ‘struct MQTT_MESSAGE_TAG’ has no member named ‘const_topic_name’
  207 |             result = handle->const_topic_name;
      |                            ^~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c: In function ‘mqttmessage_getTopicLevels’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:231:91: error: ‘MQTT_MESSAGE’ {aka ‘struct MQTT_MESSAGE_TAG’} has no member named ‘const_topic_name’
  231 |         const char* topic_name = msgInfo->topicName != NULL ? msgInfo->topicName : msgInfo->const_topic_name;
      |                                                                                           ^~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_message.h:44:38: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
   44 | MOCKABLE_FUNCTION(, const APP_PAYLOAD*, mqttmessage_getApplicationMsg, MQTT_MESSAGE_HANDLE, handle);
      |                                      ^
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:91:5: note: in definition of macro ‘MOCKABLE_FUNCTION_SIGNATURE’
   91 |     result modifiers function(MU_IF(MU_COUNT_ARG(__VA_ARGS__),,void) MU_FOR_EACH_2_COUNTED(UMOCK_C_PROD_ARG_IN_SIGNATURE, __VA_ARGS__))
      |     ^~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_message.h:44:1: note: in expansion of macro ‘MOCKABLE_FUNCTION’
   44 | MOCKABLE_FUNCTION(, const APP_PAYLOAD*, mqttmessage_getApplicationMsg, MQTT_MESSAGE_HANDLE, handle);
      | ^~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c: At top level:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:263:1: error: unknown type name ‘QOS_VALUE’
  263 | QOS_VALUE mqttmessage_getQosType(MQTT_MESSAGE_HANDLE handle)
      | ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c: In function ‘mqttmessage_getQosType’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:265:5: error: unknown type name ‘QOS_VALUE’
  265 |     QOS_VALUE result;
      |     ^~~~~~~~~
In file included from ....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_client.h:11,
                 from ....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:18:
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_client.h:68:109: error: unknown type name ‘QOS_VALUE’
   68 | MOCKABLE_FUNCTION(, int, mqtt_client_send_message_response, MQTT_CLIENT_HANDLE, handle, uint16_t, packetId, QOS_VALUE, qosValue);
      |                                                                                                             ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:88:66: note: in definition of macro ‘UMOCK_C_PROD_ARG_IN_SIGNATURE’
   88 | #define UMOCK_C_PROD_ARG_IN_SIGNATURE(count, arg_type, arg_name) arg_type arg_name MU_IFCOMMA(count)
      |                                                                  ^~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc/macro_utils/macro_utils_generated.h:12481:1: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED_2’
12481 | MU_FOR_EACH_2_COUNTED_2(X, P3, P4)
      | ^~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc/macro_utils/macro_utils_generated.h:12485:1: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED_4’
12485 | MU_FOR_EACH_2_COUNTED_4(X, P3, P4, P5, P6)
      | ^~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc/macro_utils/macro_utils.h:39:21: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED_6’
   39 | #define MU_C2_(x,y) x##y
      |                     ^
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:91:70: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED’
   91 |     result modifiers function(MU_IF(MU_COUNT_ARG(__VA_ARGS__),,void) MU_FOR_EACH_2_COUNTED(UMOCK_C_PROD_ARG_IN_SIGNATURE, __VA_ARGS__))
      |                                                                      ^~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:101:5: note: in expansion of macro ‘MOCKABLE_FUNCTION_SIGNATURE’
  101 |     MOCKABLE_FUNCTION_SIGNATURE(modifiers, result, function, ##__VA_ARGS__);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_client.h:68:1: note: in expansion of macro ‘MOCKABLE_FUNCTION’
   68 | MOCKABLE_FUNCTION(, int, mqtt_client_send_message_response, MQTT_CLIENT_HANDLE, handle, uint16_t, packetId, QOS_VALUE, qosValue);
      | ^~~~~~~~~~~~~~~~~
In file included from ....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/inc/azure_c_shared_utility/crt_abstractions.h:20,
                 from ....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:7,
                 from ....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_codec.h:10,
                 from ....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:12:
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_codec.h:27:58: error: unknown type name ‘ON_PACKET_COMPLETE_CALLBACK’
   27 | MOCKABLE_FUNCTION(, MQTTCODEC_HANDLE, mqtt_codec_create, ON_PACKET_COMPLETE_CALLBACK, packetComplete, void*, callbackCtx);
      |                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:88:66: note: in definition of macro ‘UMOCK_C_PROD_ARG_IN_SIGNATURE’
   88 | #define UMOCK_C_PROD_ARG_IN_SIGNATURE(count, arg_type, arg_name) arg_type arg_name MU_IFCOMMA(count)
      |                                                                  ^~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc/macro_utils/macro_utils.h:39:21: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED_4’
   39 | #define MU_C2_(x,y) x##y
      |                     ^
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:91:70: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED’
   91 |     result modifiers function(MU_IF(MU_COUNT_ARG(__VA_ARGS__),,void) MU_FOR_EACH_2_COUNTED(UMOCK_C_PROD_ARG_IN_SIGNATURE, __VA_ARGS__))
      |                                                                      ^~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:101:5: note: in expansion of macro ‘MOCKABLE_FUNCTION_SIGNATURE’
  101 |     MOCKABLE_FUNCTION_SIGNATURE(modifiers, result, function, ##__VA_ARGS__);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_codec.h:27:1: note: in expansion of macro ‘MOCKABLE_FUNCTION’
   27 | MOCKABLE_FUNCTION(, MQTTCODEC_HANDLE, mqtt_codec_create, ON_PACKET_COMPLETE_CALLBACK, packetComplete, void*, callbackCtx);
      | ^~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_codec.h:33:56: error: unknown type name ‘QOS_VALUE’
   33 | MOCKABLE_FUNCTION(, BUFFER_HANDLE, mqtt_codec_publish, QOS_VALUE, qosValue, bool, duplicateMsg, bool, serverRetain, uint16_t, packetId, const char*, topicName, const uint8_t*, msgBuffer, size_t, buffLen, STRING_HANDLE, trace_log);
      |                                                        ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:88:66: note: in definition of macro ‘UMOCK_C_PROD_ARG_IN_SIGNATURE’
   88 | #define UMOCK_C_PROD_ARG_IN_SIGNATURE(count, arg_type, arg_name) arg_type arg_name MU_IFCOMMA(count)
      |                                                                  ^~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc/macro_utils/macro_utils.h:39:21: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED_16’
   39 | #define MU_C2_(x,y) x##y
      |                     ^
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:91:70: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED’
   91 |     result modifiers function(MU_IF(MU_COUNT_ARG(__VA_ARGS__),,void) MU_FOR_EACH_2_COUNTED(UMOCK_C_PROD_ARG_IN_SIGNATURE, __VA_ARGS__))
      |                                                                      ^~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:101:5: note: in expansion of macro ‘MOCKABLE_FUNCTION_SIGNATURE’
  101 |     MOCKABLE_FUNCTION_SIGNATURE(modifiers, result, function, ##__VA_ARGS__);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_codec.h:33:1: note: in expansion of macro ‘MOCKABLE_FUNCTION’
   33 | MOCKABLE_FUNCTION(, BUFFER_HANDLE, mqtt_codec_publish, QOS_VALUE, qosValue, bool, duplicateMsg, bool, serverRetain, uint16_t, packetId, const char*, topicName, const uint8_t*, msgBuffer, size_t, buffLen, STRING_HANDLE, trace_log);
      | ^~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:270:18: error: ‘DELIVER_AT_MOST_ONCE’ undeclared (first use in this function)
  270 |         result = DELIVER_AT_MOST_ONCE;
      |                  ^~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:270:18: note: each undeclared identifier is reported only once for each function it appears in
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c: In function ‘mqttmessage_getIsDuplicateMsg’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:292:24: error: ‘struct MQTT_MESSAGE_TAG’ has no member named ‘isDuplicateMsg’
  292 |         result = handle->isDuplicateMsg;
      |                        ^~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c: In function ‘mqttmessage_getIsRetained’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:309:24: error: ‘struct MQTT_MESSAGE_TAG’ has no member named ‘isMessageRetained’
  309 |         result = handle->isMessageRetained;
      |                        ^~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c: In function ‘mqttmessage_setIsDuplicateMsg’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:326:15: error: ‘struct MQTT_MESSAGE_TAG’ has no member named ‘isDuplicateMsg’
  326 |         handle->isDuplicateMsg = duplicateMsg;
      |               ^~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c: In function ‘mqttmessage_setIsRetained’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:344:15: error: ‘struct MQTT_MESSAGE_TAG’ has no member named ‘isMessageRetained’
  344 |         handle->isMessageRetained = retainMsg;
      |               ^~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c: At top level:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_message.c:350:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
  350 | const APP_PAYLOAD* mqttmessage_getApplicationMsg(MQTT_MESSAGE_HANDLE handle)
      |                  ^
cc1: all warnings being treated as errors
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:58:5: error: unknown type name ‘CONTROL_PACKET_TYPE’
   58 |     CONTROL_PACKET_TYPE currPacket;
      |     ^~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:63:5: error: unknown type name ‘ON_PACKET_COMPLETE_CALLBACK’
   63 |     ON_PACKET_COMPLETE_CALLBACK packetComplete;
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:74:5: error: unknown type name ‘QOS_VALUE’
   74 |     QOS_VALUE qualityOfServiceValue;
      |     ^~~~~~~~~
make[2]: *** [CMakeFiles/umqtt.dir/build.make:107: CMakeFiles/umqtt.dir/src/mqtt_message.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:77:39: error: unknown type name ‘QOS_VALUE’
   77 | static const char* retrieve_qos_value(QOS_VALUE value)
      |                                       ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:121:8: error: unknown type name ‘CONTROL_PACKET_TYPE’
  121 | static CONTROL_PACKET_TYPE processControlPacketType(uint8_t pktByte, int* flags)
      |        ^~~~~~~~~~~~~~~~~~~
In file included from ....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:19:
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_codec.h:25:59: error: unknown type name ‘CONTROL_PACKET_TYPE’; did you mean ‘CONTROL_PACKET_TYPE_VALUES’?
   25 | typedef void(*ON_PACKET_COMPLETE_CALLBACK)(void* context, CONTROL_PACKET_TYPE packet, int flags, BUFFER_HANDLE headerData);
      |                                                           ^~~~~~~~~~~~~~~~~~~
      |                                                           CONTROL_PACKET_TYPE_VALUES
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c: In function ‘processControlPacketType’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:123:5: error: unknown type name ‘CONTROL_PACKET_TYPE’; did you mean ‘CONTROL_PACKET_TYPE_VALUES’?
  123 |     CONTROL_PACKET_TYPE result;
      |     ^~~~~~~~~~~~~~~~~~~
      |     CONTROL_PACKET_TYPE_VALUES
In file included from ....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_codec.h:9,
                 from ....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:19:
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_codec.h:27:58: error: unknown type name ‘ON_PACKET_COMPLETE_CALLBACK’
   27 | MOCKABLE_FUNCTION(, MQTTCODEC_HANDLE, mqtt_codec_create, ON_PACKET_COMPLETE_CALLBACK, packetComplete, void*, callbackCtx);
      |                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:88:66: note: in definition of macro ‘UMOCK_C_PROD_ARG_IN_SIGNATURE’
   88 | #define UMOCK_C_PROD_ARG_IN_SIGNATURE(count, arg_type, arg_name) arg_type arg_name MU_IFCOMMA(count)
      |                                                                  ^~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc/macro_utils/macro_utils.h:39:21: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED_4’
   39 | #define MU_C2_(x,y) x##y
      |                     ^
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:91:70: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED’
   91 |     result modifiers function(MU_IF(MU_COUNT_ARG(__VA_ARGS__),,void) MU_FOR_EACH_2_COUNTED(UMOCK_C_PROD_ARG_IN_SIGNATURE, __VA_ARGS__))
      |                                                                      ^~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:101:5: note: in expansion of macro ‘MOCKABLE_FUNCTION_SIGNATURE’
  101 |     MOCKABLE_FUNCTION_SIGNATURE(modifiers, result, function, ##__VA_ARGS__);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_codec.h:27:1: note: in expansion of macro ‘MOCKABLE_FUNCTION’
   27 | MOCKABLE_FUNCTION(, MQTTCODEC_HANDLE, mqtt_codec_create, ON_PACKET_COMPLETE_CALLBACK, packetComplete, void*, callbackCtx);
      | ^~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:16:46: error: ‘CONTROL_PACKET_TYPE’ undeclared (first use in this function); did you mean ‘CONTROL_PACKET_TYPE_VALUES’?
   16 | #define PACKET_TYPE_BYTE(p)                 (CONTROL_PACKET_TYPE)((uint8_t)(((uint8_t)(p)) & 0xf0))
      |                                              ^~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:124:14: note: in expansion of macro ‘PACKET_TYPE_BYTE’
  124 |     result = PACKET_TYPE_BYTE(pktByte);
      |              ^~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:16:46: note: each undeclared identifier is reported only once for each function it appears in
   16 | #define PACKET_TYPE_BYTE(p)                 (CONTROL_PACKET_TYPE)((uint8_t)(((uint8_t)(p)) & 0xf0))
      |                                              ^~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:124:14: note: in expansion of macro ‘PACKET_TYPE_BYTE’
  124 |     result = PACKET_TYPE_BYTE(pktByte);
      |              ^~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_codec.h:33:56: error: unknown type name ‘QOS_VALUE’
   33 | MOCKABLE_FUNCTION(, BUFFER_HANDLE, mqtt_codec_publish, QOS_VALUE, qosValue, bool, duplicateMsg, bool, serverRetain, uint16_t, packetId, const char*, topicName, const uint8_t*, msgBuffer, size_t, buffLen, STRING_HANDLE, trace_log);
      |                                                        ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:88:66: note: in definition of macro ‘UMOCK_C_PROD_ARG_IN_SIGNATURE’
   88 | #define UMOCK_C_PROD_ARG_IN_SIGNATURE(count, arg_type, arg_name) arg_type arg_name MU_IFCOMMA(count)
      |                                                                  ^~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/c-utility/deps/macro-utils-c/inc/macro_utils/macro_utils.h:39:21: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED_16’
   39 | #define MU_C2_(x,y) x##y
      |                     ^
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:91:70: note: in expansion of macro ‘MU_FOR_EACH_2_COUNTED’
   91 |     result modifiers function(MU_IF(MU_COUNT_ARG(__VA_ARGS__),,void) MU_FOR_EACH_2_COUNTED(UMOCK_C_PROD_ARG_IN_SIGNATURE, __VA_ARGS__))
      |                                                                      ^~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/deps/umock-c/inc/umock_c/umock_c_prod.h:101:5: note: in expansion of macro ‘MOCKABLE_FUNCTION_SIGNATURE’
  101 |     MOCKABLE_FUNCTION_SIGNATURE(modifiers, result, function, ##__VA_ARGS__);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_codec.h:33:1: note: in expansion of macro ‘MOCKABLE_FUNCTION’
   33 | MOCKABLE_FUNCTION(, BUFFER_HANDLE, mqtt_codec_publish, QOS_VALUE, qosValue, bool, duplicateMsg, bool, serverRetain, uint16_t, packetId, const char*, topicName, const uint8_t*, msgBuffer, size_t, buffLen, STRING_HANDLE, trace_log);
      | ^~~~~~~~~~~~~~~~~
In file included from ....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqtt_client.h:9,
                 from ....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:18:
....../azure-iot-sdk-c/azure-umqtt-c/inc/azure_umqtt_c/mqttconst.h:42:27: error: expected ‘)’ before numeric constant
   42 |     DELIVER_AT_MOST_ONCE, 0x00, \
      |                           ^~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:35:37: note: in expansion of macro ‘QOS_VALUE_VALUES’
   35 | MU_DEFINE_ENUM_STRINGS_2(QOS_VALUE, QOS_VALUE_VALUES);
      |                                     ^~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:49:5: error: unknown type name ‘CONTROL_PACKET_TYPE’
   49 |     CONTROL_PACKET_TYPE packetState;
      |     ^~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:59:5: error: unknown type name ‘QOS_VALUE’
   59 |     QOS_VALUE qosValue;
      |     ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c: In function ‘constructPublishVariableHeader’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:238:49: error: ‘DELIVER_AT_MOST_ONCE’ undeclared (first use in this function)
  238 |     if (publishHeader->qualityOfServiceValue != DELIVER_AT_MOST_ONCE)
      |                                                 ^~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c: In function ‘sendComplete’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:211:45: error: ‘DISCONNECT_TYPE’ undeclared (first use in this function)
  211 |             if (mqtt_client->packetState == DISCONNECT_TYPE)
      |                                             ^~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:211:45: note: each undeclared identifier is reported only once for each function it appears in
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c: In function ‘onOpenComplete’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:413:40: error: ‘CONNECT_TYPE’ undeclared (first use in this function); did you mean ‘CONNECT_ACK’?
  413 |             mqtt_client->packetState = CONNECT_TYPE;
      |                                        ^~~~~~~~~~~~
      |                                        CONNECT_ACK
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c: At top level:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:305:44: error: unknown type name ‘CONTROL_PACKET_TYPE’; did you mean ‘CONTROL_PACKET_TYPE_VALUES’?
  305 | static BUFFER_HANDLE constructPublishReply(CONTROL_PACKET_TYPE type, uint8_t flags, uint16_t packetId)
      |                                            ^~~~~~~~~~~~~~~~~~~
      |                                            CONTROL_PACKET_TYPE_VALUES
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c: At top level:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:634:73: error: unknown type name ‘QOS_VALUE’
  634 | static void SendMessageAck(MQTT_CLIENT* mqtt_client, uint16_t packetId, QOS_VALUE qosValue)
      |                                                                         ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:336:59: error: unknown type name ‘CONTROL_PACKET_TYPE’; did you mean ‘CONTROL_PACKET_TYPE_VALUES’?
  336 | static int constructFixedHeader(BUFFER_HANDLE ctrlPacket, CONTROL_PACKET_TYPE packetType, uint8_t flags)
      |                                                           ^~~~~~~~~~~~~~~~~~~
      |                                                           CONTROL_PACKET_TYPE_VALUES
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c: In function ‘completePacketData’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:590:35: error: comparison between pointer and integer [-Werror]
  590 |     if (codecData->packetComplete != NULL)
      |                                   ^~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:592:9: error: called object is not a function or function pointer
  592 |         codecData->packetComplete(codecData->callContext, codecData->currPacket, codecData->headerFlags, codecData->headerData);
      |         ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c: In function ‘ProcessPublishMessage’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:688:5: error: unknown type name ‘QOS_VALUE’
  688 |     QOS_VALUE qosValue = (flags == 0) ? DELIVER_AT_MOST_ONCE : (flags & QOS_LEAST_ONCE_FLAG_MASK) ? DELIVER_AT_LEAST_ONCE : DELIVER_EXACTLY_ONCE;
      |     ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:596:29: error: ‘UNKNOWN_TYPE’ undeclared (first use in this function)
  596 |     codecData->currPacket = UNKNOWN_TYPE;
      |                             ^~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:688:41: error: ‘DELIVER_AT_MOST_ONCE’ undeclared (first use in this function)
  688 |     QOS_VALUE qosValue = (flags == 0) ? DELIVER_AT_MOST_ONCE : (flags & QOS_LEAST_ONCE_FLAG_MASK) ? DELIVER_AT_LEAST_ONCE : DELIVER_EXACTLY_ONCE;
      |                                         ^~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c: In function ‘clear_codec_data’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:606:30: error: ‘UNKNOWN_TYPE’ undeclared (first use in this function)
  606 |     codec_data->currPacket = UNKNOWN_TYPE;
      |                              ^~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:688:101: error: ‘DELIVER_AT_LEAST_ONCE’ undeclared (first use in this function)
  688 |     QOS_VALUE qosValue = (flags == 0) ? DELIVER_AT_MOST_ONCE : (flags & QOS_LEAST_ONCE_FLAG_MASK) ? DELIVER_AT_LEAST_ONCE : DELIVER_EXACTLY_ONCE;
      |                                                                                                     ^~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c: At top level:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:623:36: error: unknown type name ‘ON_PACKET_COMPLETE_CALLBACK’
  623 | MQTTCODEC_HANDLE mqtt_codec_create(ON_PACKET_COMPLETE_CALLBACK packetComplete, void* callbackCtx)
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:688:125: error: ‘DELIVER_EXACTLY_ONCE’ undeclared (first use in this function)
  688 |     QOS_VALUE qosValue = (flags == 0) ? DELIVER_AT_MOST_ONCE : (flags & QOS_LEAST_ONCE_FLAG_MASK) ? DELIVER_AT_LEAST_ONCE : DELIVER_EXACTLY_ONCE;
      |                                                                                                                             ^~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c: In function ‘mqtt_codec_connect’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:690:25: error: implicit declaration of function ‘constructFixedHeader’ [-Werror=implicit-function-declaration]
  690 |                     if (constructFixedHeader(result, CONNECT_TYPE, 0) != 0)
      |                         ^~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:707:38: error: implicit declaration of function ‘MU_ENUM_TO_STRING_2’; did you mean ‘MU_ENUM_TO_STRING’? [-Werror=implicit-function-declaration]
  707 |                 isRetainMsg ? 1 : 0, MU_ENUM_TO_STRING_2(QOS_VALUE, qosValue), topicName);
      |                                      ^~~~~~~~~~~~~~~~~~~
      |                                      MU_ENUM_TO_STRING
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:707:58: error: ‘QOS_VALUE’ undeclared (first use in this function)
  707 |                 isRetainMsg ? 1 : 0, MU_ENUM_TO_STRING_2(QOS_VALUE, qosValue), topicName);
      |                                                          ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:690:54: error: ‘CONNECT_TYPE’ undeclared (first use in this function); did you mean ‘CONNECT_ACK’?
  690 |                     if (constructFixedHeader(result, CONNECT_TYPE, 0) != 0)
      |                                                      ^~~~~~~~~~~~
      |                                                      CONNECT_ACK
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c: In function ‘mqtt_codec_disconnect’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:737:31: error: ‘DISCONNECT_TYPE’ undeclared (first use in this function)
  737 |                 iterator[0] = DISCONNECT_TYPE;
      |                               ^~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:731:45: error: implicit declaration of function ‘mqttmessage_create_in_place’ [-Werror=implicit-function-declaration]
  731 |             MQTT_MESSAGE_HANDLE msgHandle = mqttmessage_create_in_place(packetId, topicName, qosValue, iterator, numberOfBytesToBeRead);
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:731:45: error: initialization of ‘MQTT_MESSAGE_HANDLE’ {aka ‘struct MQTT_MESSAGE_TAG *’} from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c: At top level:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:745:34: error: unknown type name ‘QOS_VALUE’
  745 | BUFFER_HANDLE mqtt_codec_publish(QOS_VALUE qosValue, bool duplicateMsg, bool serverRetain, uint16_t packetId, const char* topicName, const uint8_t* msgBuffer, size_t buffLen, STRING_HANDLE trace_log)
      |                                  ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:756:21: error: implicit declaration of function ‘SendMessageAck’ [-Werror=implicit-function-declaration]
  756 |                     SendMessageAck(mqtt_client, packetId, qosValue);
      |                     ^~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c: In function ‘mqtt_codec_publishAck’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:866:28: error: implicit declaration of function ‘constructPublishReply’ [-Werror=implicit-function-declaration]
  866 |     BUFFER_HANDLE result = constructPublishReply(PUBACK_TYPE, 0, packetId);
      |                            ^~~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c: At top level:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:771:49: error: unknown type name ‘CONTROL_PACKET_TYPE’; did you mean ‘CONTROL_PACKET_TYPE_VALUES’?
  771 | static void recvCompleteCallback(void* context, CONTROL_PACKET_TYPE packet, int flags, BUFFER_HANDLE headerData)
      |                                                 ^~~~~~~~~~~~~~~~~~~
      |                                                 CONTROL_PACKET_TYPE_VALUES
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:866:50: error: ‘PUBACK_TYPE’ undeclared (first use in this function)
  866 |     BUFFER_HANDLE result = constructPublishReply(PUBACK_TYPE, 0, packetId);
      |                                                  ^~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c: In function ‘mqtt_codec_publishReceived’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:874:50: error: ‘PUBREC_TYPE’ undeclared (first use in this function)
  874 |     BUFFER_HANDLE result = constructPublishReply(PUBREC_TYPE, 0, packetId);
      |                                                  ^~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c: In function ‘mqtt_client_init’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:1043:35: error: ‘UNKNOWN_TYPE’ undeclared (first use in this function)
 1043 |             result->packetState = UNKNOWN_TYPE;
      |                                   ^~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c: In function ‘mqtt_codec_publishRelease’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:882:50: error: ‘PUBREL_TYPE’ undeclared (first use in this function)
  882 |     BUFFER_HANDLE result = constructPublishReply(PUBREL_TYPE, 2, packetId);
      |                                                  ^~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:1049:32: error: ‘DELIVER_AT_MOST_ONCE’ undeclared (first use in this function)
 1049 |             result->qosValue = DELIVER_AT_MOST_ONCE;
      |                                ^~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c: In function ‘mqtt_codec_publishComplete’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:890:50: error: ‘PUBCOMP_TYPE’ undeclared (first use in this function)
  890 |     BUFFER_HANDLE result = constructPublishReply(PUBCOMP_TYPE, 0, packetId);
      |                                                  ^~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:1061:40: error: implicit declaration of function ‘mqtt_codec_create’; did you mean ‘mqtt_codec_reset’? [-Werror=implicit-function-declaration]
 1061 |                 result->codec_handle = mqtt_codec_create(recvCompleteCallback, result);
      |                                        ^~~~~~~~~~~~~~~~~
      |                                        mqtt_codec_reset
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c: In function ‘mqtt_codec_ping’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:917:31: error: ‘PINGREQ_TYPE’ undeclared (first use in this function)
  917 |                 iterator[0] = PINGREQ_TYPE;
      |                               ^~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:1061:58: error: ‘recvCompleteCallback’ undeclared (first use in this function)
 1061 |                 result->codec_handle = mqtt_codec_create(recvCompleteCallback, result);
      |                                                          ^~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c: In function ‘mqtt_codec_subscribe’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:966:54: error: ‘SUBSCRIBE_TYPE’ undeclared (first use in this function); did you mean ‘SUBSCRIBE_ACK’?
  966 |                     if (constructFixedHeader(result, SUBSCRIBE_TYPE, SUBSCRIBE_FIXED_HEADER_FLAG) != 0)
      |                                                      ^~~~~~~~~~~~~~
      |                                                      SUBSCRIBE_ACK
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c: In function ‘mqtt_client_connect’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:1103:36: error: ‘UNKNOWN_TYPE’ undeclared (first use in this function)
 1103 |         mqtt_client->packetState = UNKNOWN_TYPE;
      |                                    ^~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c: In function ‘mqtt_client_publish’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:1144:26: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
 1144 |         const APP_PAYLOAD* payload = mqttmessage_getApplicationMsg(msgHandle);
      |                          ^
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c: In function ‘mqtt_codec_unsubscribe’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1030:54: error: ‘UNSUBSCRIBE_TYPE’ undeclared (first use in this function); did you mean ‘UNSUBSCRIBE_ACK’?
 1030 |                     if (constructFixedHeader(result, UNSUBSCRIBE_TYPE, UNSUBSCRIBE_FIXED_HEADER_FLAG) != 0)
      |                                                      ^~~~~~~~~~~~~~~~
      |                                                      UNSUBSCRIBE_ACK
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:1144:28: error: ‘payload’ undeclared (first use in this function)
 1144 |         const APP_PAYLOAD* payload = mqttmessage_getApplicationMsg(msgHandle);
      |                            ^~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:1144:38: error: implicit declaration of function ‘mqttmessage_getApplicationMsg’; did you mean ‘mqttmessage_getIsDuplicateMsg’? [-Werror=implicit-function-declaration]
 1144 |         const APP_PAYLOAD* payload = mqttmessage_getApplicationMsg(msgHandle);
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                      mqttmessage_getIsDuplicateMsg
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c: In function ‘mqtt_codec_bytesReceived’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1067:34: error: ‘PACKET_TYPE_ERROR’ undeclared (first use in this function); did you mean ‘PACKET_TYPE_BYTE’?
 1067 |         codec_Data->currPacket = PACKET_TYPE_ERROR;
      |                                  ^~~~~~~~~~~~~~~~~
      |                                  PACKET_TYPE_BYTE
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:1155:13: error: unknown type name ‘QOS_VALUE’
 1155 |             QOS_VALUE qos = mqttmessage_getQosType(msgHandle);
      |             ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:1160:43: error: implicit declaration of function ‘mqtt_codec_publish’; did you mean ‘mqtt_codec_publishAck’? [-Werror=implicit-function-declaration]
 1160 |             BUFFER_HANDLE publishPacket = mqtt_codec_publish(qos, isDuplicate, isRetained, packetId, topicName, payload->message, payload->length, trace_log);
      |                                           ^~~~~~~~~~~~~~~~~~
      |                                           mqtt_codec_publishAck
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1080:47: error: ‘UNKNOWN_TYPE’ undeclared (first use in this function)
 1080 |                 if (codec_Data->currPacket == UNKNOWN_TYPE)
      |                                               ^~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:1169:44: error: ‘PUBLISH_TYPE’ undeclared (first use in this function); did you mean ‘PUBLISH_ACK’?
 1169 |                 mqtt_client->packetState = PUBLISH_TYPE;
      |                                            ^~~~~~~~~~~~
      |                                            PUBLISH_ACK
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c: In function ‘mqtt_client_subscribe’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:1218:40: error: ‘SUBSCRIBE_TYPE’ undeclared (first use in this function); did you mean ‘SUBSCRIBE_ACK’?
 1218 |             mqtt_client->packetState = SUBSCRIBE_TYPE;
      |                                        ^~~~~~~~~~~~~~
      |                                        SUBSCRIBE_ACK
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1087:30: error: ‘PACKET_INVALID1_TYPE’ undeclared (first use in this function)
 1087 |                         case PACKET_INVALID1_TYPE:
      |                              ^~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c: In function ‘mqtt_client_unsubscribe’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:1266:40: error: ‘UNSUBSCRIBE_TYPE’ undeclared (first use in this function); did you mean ‘UNSUBSCRIBE_ACK’?
 1266 |             mqtt_client->packetState = UNSUBSCRIBE_TYPE;
      |                                        ^~~~~~~~~~~~~~~~
      |                                        UNSUBSCRIBE_ACK
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1088:30: error: ‘PACKET_INVALID2_TYPE’ undeclared (first use in this function)
 1088 |                         case PACKET_INVALID2_TYPE:
      |                              ^~~~~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c: At top level:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:1291:85: error: unknown type name ‘QOS_VALUE’
 1291 | int mqtt_client_send_message_response(MQTT_CLIENT_HANDLE handle, uint16_t packetId, QOS_VALUE qosValue)
      |                                                                                     ^~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1093:30: error: ‘CONNECT_TYPE’ undeclared (first use in this function); did you mean ‘CONNECT_ACK’?
 1093 |                         case CONNECT_TYPE:
      |                              ^~~~~~~~~~~~
      |                              CONNECT_ACK
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c: In function ‘mqtt_client_disconnect’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:1328:44: error: ‘PACKET_TYPE_ERROR’ undeclared (first use in this function)
 1328 |                 mqtt_client->packetState = PACKET_TYPE_ERROR;
      |                                            ^~~~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1094:30: error: ‘CONNACK_TYPE’ undeclared (first use in this function)
 1094 |                         case CONNACK_TYPE:
      |                              ^~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:1336:44: error: ‘DISCONNECT_TYPE’ undeclared (first use in this function)
 1336 |                 mqtt_client->packetState = DISCONNECT_TYPE;
      |                                            ^~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1095:30: error: ‘PUBACK_TYPE’ undeclared (first use in this function)
 1095 |                         case PUBACK_TYPE:
      |                              ^~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c: In function ‘mqtt_client_dowork’:
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_client.c:1411:52: error: ‘UNKNOWN_TYPE’ undeclared (first use in this function)
 1411 |                         mqtt_client->packetState = UNKNOWN_TYPE;
      |                                                    ^~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1096:30: error: ‘PUBREC_TYPE’ undeclared (first use in this function)
 1096 |                         case PUBREC_TYPE:
      |                              ^~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/umqtt.dir/build.make:79: CMakeFiles/umqtt.dir/src/mqtt_client.c.o] Error 1
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1097:30: error: ‘PUBCOMP_TYPE’ undeclared (first use in this function)
 1097 |                         case PUBCOMP_TYPE:
      |                              ^~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1098:30: error: ‘SUBACK_TYPE’ undeclared (first use in this function)
 1098 |                         case SUBACK_TYPE:
      |                              ^~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1099:30: error: ‘UNSUBACK_TYPE’ undeclared (first use in this function)
 1099 |                         case UNSUBACK_TYPE:
      |                              ^~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1100:30: error: ‘PINGREQ_TYPE’ undeclared (first use in this function)
 1100 |                         case PINGREQ_TYPE:
      |                              ^~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1101:30: error: ‘PINGRESP_TYPE’ undeclared (first use in this function)
 1101 |                         case PINGRESP_TYPE:
      |                              ^~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1102:30: error: ‘DISCONNECT_TYPE’ undeclared (first use in this function)
 1102 |                         case DISCONNECT_TYPE:
      |                              ^~~~~~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1110:30: error: ‘PUBREL_TYPE’ undeclared (first use in this function)
 1110 |                         case PUBREL_TYPE:
      |                              ^~~~~~~~~~~
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1111:30: error: ‘SUBSCRIBE_TYPE’ undeclared (first use in this function); did you mean ‘SUBSCRIBE_ACK’?
 1111 |                         case SUBSCRIBE_TYPE:
      |                              ^~~~~~~~~~~~~~
      |                              SUBSCRIBE_ACK
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1112:30: error: ‘UNSUBSCRIBE_TYPE’ undeclared (first use in this function); did you mean ‘UNSUBSCRIBE_ACK’?
 1112 |                         case UNSUBSCRIBE_TYPE:
      |                              ^~~~~~~~~~~~~~~~
      |                              UNSUBSCRIBE_ACK
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1120:30: error: ‘PUBLISH_TYPE’ undeclared (first use in this function); did you mean ‘PUBLISH_ACK’?
 1120 |                         case PUBLISH_TYPE:
      |                              ^~~~~~~~~~~~
      |                              PUBLISH_ACK
....../azure-iot-sdk-c/azure-umqtt-c/src/mqtt_codec.c:1121:30: error: ‘CONTROL_PACKET_TYPE_INVALID’ undeclared (first use in this function); did you mean ‘CONTROL_PACKET_TYPE_VALUES’?
 1121 |                         case CONTROL_PACKET_TYPE_INVALID:
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                              CONTROL_PACKET_TYPE_VALUES
cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/umqtt.dir/build.make:93: CMakeFiles/umqtt.dir/src/mqtt_codec.c.o] Error 1
make[2]: Leaving directory '....../azure-iot-sdk-c/azure-umqtt-c/build_22.04'
make[1]: *** [CMakeFiles/Makefile2:338: CMakeFiles/umqtt.dir/all] Error 2
make[1]: Leaving directory '....../azure-iot-sdk-c/azure-umqtt-c/build_22.04'
make: *** [Makefile:149: all] Error 2build_22.04 git:(master) ✗ 

mqtt_client_sample.c program client program exits after receiving one or two messages,

Hi Team,

mqtt_client_sample.c program exits after publishing and receiving one or two messages. The program exits quickly and wont wait in infinite loop.
MQTT_CLIENT_ON_DISCONNECT Disconnects message receives in OnOperationComplete() call back function and terminates the program.
Also, proper MQTT_CLIENT_ON_CONNACK messages is received in After connection to "test.mosquitto.org".

Please let me know why I am getting immediately MQTT_CLIENT_ON_DISCONNECT after MQTT_CLIENT_ON_CONNACK message in OnOperationComplete().
How to wait continuously for subscriber messages? What setting/configuration I need to do for client connection?

Thanks,
Darshan.

Error on xio_close

Hi all,

I'm using this library (version tagged as Release 2017-06-16) with openssl and when I call xio_close I get the following error:

Invalid tlsio_state. Expected state is TLSIO_STATE_NOT_OPEN or TLSIO_STATE_CLOSING.

Actually tls_io_instance->tlsio_state is set to TLSIO_STATE_NOT_OPEN in function on_underlying_io_close_complete (file tlsio_opnessl.c). Then in tlsio_openssl_close function, the check fails because it finds the state to be not open.

Additionally I believe that error message printed by the tlsio_openssl_close function is misleading.

Thank you
Nicolo'

mqtt client does not handle ping response in the right way

I write an example to use mqtt client, set mqtt keep alive to 10 seconds, I want to check whether it can handle ping message correctly, when I shutdown my wireless connection for more than 30 seconds, but the client did not send MQTT_CLIENT_NO_PING_RESPONSE message to error callback function.

My proposes:

  1. compare current time with ping response time instead of ping send time since we need to check server could send response in time, or else we assume the connection is lost.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.