The routing management is an aspect of the INIC Resources Management that implements the connectivity between sources and sinks endpoints respectively sockets from a device perspective (see picture below).
A (virtual) route is a logical unidirectional connection between two endpoints. An endpoint acts as a MOST connection in INIC plus the internal linked resources.
The routing management consists of following features:
The UNICENS library provides therefore a set of functions to fulfill the above features. These will be depicted in the next sections.
Since the routing management is based on XRM (refer to MNS V3.2.x), the user has to change the default values of the following macros to suit his specific system needs.
ucs_cfg.h
ucs_xrm_cfg.h
ucs_xrm_cfg.h
The application shall provide following report callback functions in the UNICENS Init-Structure in order to receive any routing events. These are:
The example below illustrates how to initialize these callback functions:
After initialization the application specifies the routes, endpoints, nodes as well as the XRM jobs and calls the Ucs_Rm_Start() function to initialize and start the routing process. This function must be called once and can only be called once. At this point, it is important to mention that there are some preconditions for the routes to be handled properly:
available
. That is, the user application has to call the function Ucs_Rm_SetNodeAvailable() whenever the node is available or the node is unavailable. In case the node is unavailable all created resources related to the node will be internally released and the user will receive a notification via the given callback functions report_fptr and debug_resource_status_fptr in Ucs_Rm_InitData_t.In short the user application can anytime call the function Ucs_Rm_Start() with the specified list of routes but these routes will have been processing only when the above conditions are met.
It is important to note that, The build up of routes can take some times in case the routing process may need to perform retries when uncritical errors occur (e.g.: transmission errors, processing errors, etc) or when certain conditions are not met yet (e.g. network not available, node not available, etc.). By the way, the maximum number of retries is 0xFF and the minimum time between the retries is 50ms.
Also note that enabling the error and event trace output in ucs_cfg.h
file (see below) will help user get detailed information on routes during processing.
The following example outlines the construction of a route between a local (Master) and a remote device incl. the settings of the above preconditions. In this example the UCS_ADDR_LOCAL_DEV macro is used to address the local device and should only be used for the local device.
This example is inserted as a guide and may not contain all of the necessary details and information.
The Routing provides additional API functions to handle some runtime tasks. These functions are:
"active"
or "inactive"
at runtime.available
or not
available
) of the given node and triggers the routing process to handle attached route(s)."available"
flag information of a given node.ConnectionLabel
of the given route.