Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Goals

µC/HTTPMQTT-client product can be used to access public HTTP MQTT servers and perform actions on resources maintained by a server.

In an embedded environment, an HTTP MQTT client will rarely primarily be used to display web pages like a web browser does. It will primarily be used  to get and update specific values, download and upload files or to interface with public web servicesto publish small messages to a server and subscribe to some topics of interest so that it may receive messages from other MQTT clients, via the server.

Design

µC/HTTPMQTT-client has been designed to suit many different types of HTTP client applications. With the right configuration it can be used with use a very low small footprint and to send a simple HTTP request and wait for the HTTP server's response. Another benefit of its design is that it can also be used to make simultaneous HTTP requests by opening multiple connections which allows for consistent usage of the same API callsbe as simple to use as possible. It also supports opening multiple connection to multiple servers, allowing to send or receive message to/from different sources. It also uses a similar API to other Micrium products, allowing users to start developing faster if they have used one of the other Micrium products.

Memory Usage

Each HTTP MQTT client application can have very different memory needs. For example, some applications will only require connection to one connection server whereas others will require more; some applications will prefer to allocate objects on their own Stack while others will want to use a memory pool on the Heap. Therefore, to conform with all of these different requirements, µC/HTTPMQTT-client does not have its own memory module. All the objects required by the µC/HTTPMQTT-client MUST be passed by the application. Three HTTP Client Objects A single MQTT Client Message must be supplied provided by the Application: a Connection object, a Request Object and a Response Object. Also, a buffer per connection must be supplied for the transmission/reception operations. Additional objects may be required when some available features are enabled, it will be use to receive any PUBLISH message from the server and to reply to it, if needed. For any message the Application wishes to send to the server, a message must also be provided. Each message must have their own buffer, with a size varying from a few bytes for very simple messages to possibly a couple of hundreds for very complex messages.

Info

It is very important that every objects passed by the application to the µC/HTTPMQTT-client stack stay valid for the duration of the HTTP transaction MQTT message (until the callback is called) or until the connection is closed for the HTTPc MQTTc Connection Object.

Internal Task

To support multiple simultaneous connections, µC/HTTPMQTT-client has an internal task. This task also allows the queuing of multiple requests messages on a given connection. When the µC/HTTP-client Task is present, API calls to µC/HTTP-client's stack can set to the blocking or non-blocking mode.For simpler applications and to reduce memory footage, the internal µC/HTTP-client task can be disabled. In that case, µC/HTTP-client operations will be executed directly in the application task and will always be blockingThis task is mandatory, the Application must provide the µC/MQTT-client module with the priority of the internal task, the stack for the task to use and an optional delay for the task.

Auto Select Remote IP address

When µC/DNSc is present, µC/HTTPMQTT-client can accept a host name string to connect to the remote server. It will perform the IP address resolution by communicating with a DNS server. If the DNS server sends back IPv4 and IPv6 addresses, the first attempt will be to use the IPv6 address to connect to the remote HTTP serverMQTT server. If this connection fails the IPv4 address will be used instead.

When µC/DNSc is not present, an IPv4 or IPv6 remote address in string form must be passed to µC/HTTPMQTT-client to connect to the remote server.

...

With its compile-time configuration, µC/HTTP-client's code footprint can be adjusted to fit the Application requirements by enabling/disabling features.

Features

µC/HTTPMQTT-client supports:

  • Persistent connection
  • Form submission
  • Chunked Transfer Encoding for transmission and reception.
  • HTTP Header Field processing.
  • HTTP Query String processing.

...

  • Multiple connections to multiple servers
  • Every type of messages defined by the MQTT specifications V3.1 and V3.1.1, including the three levels of QoS for PUBLISH messages

See the section MQTT Features Available for additional details on each feature available.

Limitations

...

.