Zigbee Protocol Controller 1.6.0
Unify Component Fixture Set Up and Tear Down

Modules

 Internal Fixture Interfaces.
 

Typedefs

typedef sl_status_t(* uic_fixt_setup_t) (void)
 
typedef int(* uic_fixt_shutdown_t) (void)
 

Variables

static uic_fixt_setup_step_t uic_fixt_setup_steps_list []
 
uic_fixt_setup_step_tuic_fixt_setup_steps = uic_fixt_setup_steps_list
 
uic_fixt_shutdown_step_tuic_fixt_shutdown_steps = uic_fixt_shutdown_steps_list
 

Detailed Description

A fixture is the environment a component runs in. So it must be set up before the component can work and maybe also cleaned up afterwards.

In the Unify Framework, most of what the components need are provided by other components or by the Contiki OS. However, there are key features that are needed by a few of the components and that are not provided by Unify itself. This may relate to external interfaces or dynamic memory.

If a component needs to set up and/or tear down such a resource, it can install an initializer (the set-up function). If the component is in the Unify library, this shall be done in uic_fixt_setup_steps_list array and a tear-down function in the uic_fixt_shutdown_steps_list array. If the component is outside the Unify library an array of uic_fixt_setup_step_t and uic_fixt_shutdown_step_t are added to Main Function for Contiki function call.

A tear-down function may also be useful for releasing allocated resources.

Order of Execution

The set-up functions are executed as the first thing after the configuration settings have been read and the logging system has been initialized.

Tear-down functions are run after the uic_main_loop() has terminated and after the Contiki OS is terminated, i.e., there are no processes and no Contiki timers.

Note
If any of the set-up functions fail, the whole system will fail to start and the tear-down functions will not be called.

Typedef Documentation

◆ uic_fixt_setup_t

typedef sl_status_t(* uic_fixt_setup_t) (void)

Type of a component fixture set-up function.

The function should returns SL_STATUS_FAIL if the Unify GW cannot start due to an error. If the component whish to abort the boot sequence but not due to an error SL_STATUS_ABORT should be returned. If the component failed in a non-critical way or is optional, SL_STATUS_NOT_AVAILABLE should be returned. If boot should proceed normally SL_STATUS_OK should be returned

◆ uic_fixt_shutdown_t

typedef int(* uic_fixt_shutdown_t) (void)

Type of a component tear-down function.

Variable Documentation

◆ uic_fixt_setup_steps

Reference to the set-up steps.

◆ uic_fixt_setup_steps_list

uic_fixt_setup_step_t uic_fixt_setup_steps_list[]
static
Initial value:
= {{uic_signal_handler_setup, "Unify Signal Handler"},
{uic_mqtt_setup, "Unify MQTT Client"},
{uic_stdin_setup, "Unify STDIN"},
{NULL, "Terminator"}}
#define NULL
Definition: list.c:50
sl_status_t uic_signal_handler_setup(void)
Setup fixture for Unify signal handler.
Definition: uic_signal_handler.c:35
sl_status_t uic_mqtt_setup()
Definition: uic_mqtt.c:101
sl_status_t uic_stdin_setup()
Unify interface to Contiki STDIN feature.
Definition: uic_stdin_process.c:186

Pre-contiki set-up steps.

The set-up steps are executed in order, before launching contiki and starting the contiki processes.

Note
For some features, it is important that they are started in the correct order, since they may depend on each other. If this is the case, the dependency should be listed with the set-up function.

◆ uic_fixt_shutdown_steps

Reference to the tear-down steps.