---
title: "Is MQTT Internet iolibrary complete?"
url: "https://maker.wiznet.io/forum/14368"
markdown_url: "https://maker.wiznet.io/forum/14368/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "sam zozis"
created: "2021-10-22T00:48:18+09:00"
last_activity: "2021-10-25T18:06:00+09:00"
language: "en"
views: 402
replies: 2
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Is MQTT Internet iolibrary complete?

## Question

Asked by sam zozis on 2021-10-22 in Ethernet Chips.

Hi,

I am working with the iolibrary and I use the MQTT Internet module to develop a MQTT client application on my MCU. By looking at the code that implements the MQTT client in MQTTClient.c, it seems that there are no mechanisms to ensure the reliability of QoS 1 and 2 messages. For example, in a QoS 2 message exchange, I cannot find actual code handling situations where the client needs to re-send its publish message if it does not receive a PUBREC packet after a while ?

Do I worry for nothing or do the library is just a minimal and not complete implementation of the requirements implied with QoS 1 and 2 messages ?

Thanks in advance,

Sam

## Replies

### Reply 1 by louis, 2021-10-25

Hi,

Did you ask about QoS settings?

If you look inside the file MQTTClient.c in the library,

There is a cycle function. You can set QoS in the function as shown in the following figure.

[![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/1/16e1bb98fa0d888747a59bf3fb78eccc09e2897d.png) image714×792 16.5 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/1/16e1bb98fa0d888747a59bf3fb78eccc09e2897d.png)

[github.com](https://github.com/Wiznet/ioLibrary_Driver/blob/master/Internet/MQTT/MQTTClient.c)

#### [Wiznet/ioLibrary_Driver/blob/master/Internet/MQTT/MQTTClient.c](https://github.com/Wiznet/ioLibrary_Driver/blob/master/Internet/MQTT/MQTTClient.c)

```
/*******************************************************************************
 * Copyright (c) 2014, 2015 IBM Corp.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * and Eclipse Distribution License v1.0 which accompany this distribution.
 *
 * The Eclipse Public License is available at
 *    http://www.eclipse.org/legal/epl-v10.html
 * and the Eclipse Distribution License is available at
 *   http://www.eclipse.org/org/documents/edl-v10.php.
 *
 * Contributors:
 *    Allan Stockdill-Mander/Ian Craggs - initial API and implementation and/or initial documentation
 *******************************************************************************/
#include "MQTTClient.h"

static void NewMessageData(MessageData* md, MQTTString* aTopicName, MQTTMessage* aMessage) {
    md->topicName = aTopicName;
    md->message = aMessage;
```

This file has been truncated. [show original](https://github.com/Wiznet/ioLibrary_Driver/blob/master/Internet/MQTT/MQTTClient.c)

Thank you.

### Reply 2 by sam zozis, 2021-10-25

Hi Louis,

Yes, I asked about QoS, but that is not my point.

I saw the cycle function, but it seems like this function does not handle all the potential cases that can happen. For example, for QoS 2 messages, I cannot see code in the cycle function that handles re-transmission of publish message if the client does not receive a PUBREC packet after a certain amount of time (timeout).

Sam

---

Source: https://maker.wiznet.io/forum/14368
