MyQttD Developer manual

Section 1: Creating myqttd modules (C language)

Section 2: Myqtt 1.1 API

Because MyQttD extends and it is built on top of Myqtt Library 1.1, it is required to keep in mind and use Myqtt API. Here is the reference:

Section 3: MyQttD API

The following is the API exposed to myqttd modules and tools. This is only useful for myqttd developers.

How MyQttD module works

MyQttD is a listener application built on top of Myqtt Library, which reads a set of configuration files to start at some selected ports, etc, and then load all modules installed.

These modules could implement new MQTT features that extend MyQttd internal function.

MyQttD core is really small. The rest of features are added as modules.

MyQttD module form is fairly simple. It contains the following handlers (defined at MyQttdModDef):

  1. Init (ModInitFunc): A handler called by MyQttD to start the module. Here the developer must place all calls required to install/configure the module, init global variables, etc.

  2. Close (ModCloseFunc): Called by MyQttD to stop a module. Here the developer must stop and dealloc all resources used by its module.

  3. Reconf (ModReconfFunc): Called by MyQttD when a HUP signal is received. This is a notification that the module should reload its configuration files and start to behave as they propose.

Creating a module from the scratch (dirty way)

Maybe the easiest way to start writing a MyQttD Module is to take a look into mod-test source code. This module does anything but is maintained across releases to contain all handlers required and a brief help. You can use it as an official reference. A module is at minimum composed by the following tree files: