Child pages
  • Configuration Options

This is the HCC Embedded Product Documentation.

HCC Embedded Main Website   |    HCC Documentation Home Page  |     Contacting HCC Embedded



Set the system configuration options in the file src/config/config_ip_app_mqttc.h. This section lists the available configuration options and their default values.

Note: The configuration parameters have the following effect on the client's RAM consumption:

  • Packet size is directly affected by the options MQTT_CLIENT_MAX_MESSAGE_LENGTH (by default 32) and MQTT_CLIENT_MAX_TOPIC_LENGTH (by default 128). If the defaults are used for these options, the client requires approx. 900 bytes of RAM for each connection with 1 subscription and 4 packets stored.
  • Every additional packet adds approx. 200 extra bytes; every additional subscription adds approx. 20 extra bytes.
  • Alignment and pointer sizes have additional effects.

Be aware that the maximum packet size is limited by the maximum TCP buffer size. Using TLS further reduces the available buffer size.



MQTT_TASK_STACK_SIZE

The size of the MQTT stack. The default value is 1024. This includes the client's stack usage and the content of callbacks, so try to minimize callback implementations.

MQTT_CLIENT_MAX_ID_LENGTH

The maximum length of the client ID in bytes. The client ID is a unique identifier that the device manufacturer may give to the device. An MQTT server implementation must accept IDs of length 1-23 bytes but can optionally accept longer identifiers. Set this parameter to the maximum size you will use for this field on this range of devices. The default value is 48.

MQTT_CLIENT_MAX_USERNAME_LENGTH

The maximum length of the username in bytes. The default value is 48.

MQTT_CLIENT_MAX_PASSWORD_LENGTH

The maximum length of the password in bytes. The default value is 48.

MQTT_CLIENT_MAX_MESSAGE_LENGTH

The maximum length of a published message in bytes. The default value is 32.

MQTT_CLIENT_MAX_TOPIC_LENGTH

The maximum length of a topic (for publish and subscribe) in bytes. The default value is 128.

MQTT_CLIENT_MAX_NUMBER_OF_CONNECTIONS

The maximum number of connections that the client can maintain at the same time. The default value is 1. The range is from 1 to the limit of the RAM (see the note above).

MQTT_CLIENT_MAX_NUMBER_OF_PACKETS

The number of packets on one connection that the client can process at the same time. (The packet size always depends on the length of the parameters below). The default value is 4. The range is from 4 to the limit of the RAM (see the note above).

MQTT_CLIENT_MAX_NUMBER_OF_SUBSCRIPTIONS

The number of simultaneous subscriptions on one connection that the client supports. The default value is 1. The range is from 1 to the limit of the RAM (see the note above).

MQTT_CLIENT_MAX_BROKER_NAME_LENGTH

The maximum length of the broker name (for example, *.broker.xively.com) in bytes. The default value is 32. The range is from 1 to the maximum that TLS can handle (see the TLS options in the HCC TLS and DTLS User Guide).

MQTT_CLIENT_MAX_CONNECTION_TIME

The maximum time in seconds allowed for a connection procedure.  The default value is 10.

MQTT_CLIENT_MAX_QUIET_TIME

The maximum time allowed for silence on the network in seconds. This is only used for cases where keep-alive is not provided. The default value is 30.

MQTT_CLIENT_MAX_RESTART_TIME

The maximum time in seconds allowed for a reconnection procedure. The default value is 10.

MQTT_CLIENT_MAX_DISCONNECT_TIME

The maximum time in seconds allowed for a disconnect procedure. The default value is 10.

MQTT_CLIENT_MAX_PACKET_TIMEOUT

The maximum time in seconds that a client can wait for a packet response to a resend event. The default value is 5.

MQTT_CLIENT_MAX_PACKET_SEND_COUNTER

The maximum number of times that a client can try to send a packet. The default value is 3.

MQTT_CLIENT_MAX_RECONNECT_COUNTER

The maximum number of reconnection attempts. The default value is 3.

MQTT_SECURE_CONNECTION_ENABLED

Set this to 1 if TLS is used. If the TLS package is not available, the module will only compile if this is set to 0 (the default value).