summaryrefslogtreecommitdiffstats
path: root/ucs2-lib/doc/html/_p__u_m__s_t_a_r_t_e_d__r_m.html
blob: 8f0ce5accbbdc83515fe0f5b4186229ef3534489 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>UNICENS: Routing Management</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="style_html.css" rel="stylesheet" type="text/css" />
<link href="inic.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="GlobalWrapper">
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr>
  <td><a href="index.html"><img alt="Logo" src="logo.png"/></a></td>
  <td>
   <div id="projectname">UNICENS&#160;<span id="projectnumber">V2.1.0-3491</span></div>
   <div id="projectbrief">User Manual and API Reference</div>
    <div id="searchbox">        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_p__u_m__s_t_a_r_t_e_d__r_m.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Routing Management </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1>Introduction</h1>
<p>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).</p>
<div class="image">
<img src="routing_physical_pov.png" alt="routing_physical_pov.png"/>
</div>
<p> 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. <br/>
 The routing management consists of following features:</p>
<ul>
<li>Create a route</li>
<li>Destroy a route</li>
<li>Monitor created routes and XRM resources</li>
<li>Report each route state to the user application callback functions.</li>
</ul>
<p>The UNICENS library provides therefore a set of functions to fulfill the above features. These will be depicted in the next sections.</p>
<h1>Configuration</h1>
<p>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.</p>
<ul>
<li><a class="el" href="group___g___u_c_s___x_r_m___c_f_g_ga70720ac0fdcbbbc7f4742654c8f8abc1.html#ga70720ac0fdcbbbc7f4742654c8f8abc1">UCS_NUM_REMOTE_DEVICES</a> in <code>ucs_cfg.h</code> </li>
<li><a class="el" href="group___g___u_c_s___x_r_m___c_f_g_gaddc205bcdb37b435fddb292c416f605b.html#gaddc205bcdb37b435fddb292c416f605b">UCS_XRM_NUM_JOBS</a> in <code>ucs_xrm_cfg.h</code> </li>
<li><a class="el" href="group___g___u_c_s___x_r_m___c_f_g_ga9bbd7e20bff0c7ea54699df5969e933a.html#ga9bbd7e20bff0c7ea54699df5969e933a">UCS_XRM_NUM_RESOURCES</a> in <code>ucs_xrm_cfg.h</code> </li>
</ul>
<div class="fragment"><div class="line"><span class="comment">/* File: ucs_cfg.h */</span></div>
<div class="line"><span class="preprocessor">#define UCS_NUM_REMOTE_DEVICES  10U</span></div>
</div><!-- fragment --><div class="fragment"><div class="line"><span class="comment">/* File: ucs_xrm_cfg.h */</span></div>
<div class="line"><span class="preprocessor">#define UCS_XRM_NUM_JOBS        40U</span></div>
<div class="line"><span class="preprocessor">#define UCS_XRM_NUM_RESOURCES  200U</span></div>
</div><!-- fragment --><h1>Initialization</h1>
<p>The application shall provide following report callback functions in the UNICENS Init-Structure in order to receive any routing events. These are:</p>
<ul>
<li><b>rm.report_fptr:</b> Optional callback function that reports status information for all routes.</li>
<li><b>rm.debug_resource_status_fptr:</b> Optional callback function that acts as a debug interface for XRM resources. User application can monitor the specified XRM resources via this interface.</li>
<li><b>rm.xrm.most_port_status_fptr</b>: Optional callback function that reports streaming-related information for the MOST Network Port</li>
<li><b>rm.xrm.check_unmute_fptr</b>: Optional callback function that signals the EHC to check the mute pin state of devices before attempting an unmute.</li>
</ul>
<p>The example below illustrates how to initialize these callback functions: </p>
<div class="fragment"><div class="line"><a class="code" href="struct_ucs___init_data__t.html" title="UNICENS initialization structure used by function Ucs_Init().">Ucs_InitData_t</a> ucs_init_data;</div>
<div class="line">(void)<a class="code" href="group___g___u_c_s___i_n_i_t___a_n_d___s_r_v_ga64b50780725a0dc8693b5b73f8345ad6.html#ga64b50780725a0dc8693b5b73f8345ad6" title="Assigns default values to a provided UNICENS init structure.">Ucs_SetDefaultConfig</a>(&amp;ucs_init_data);</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Routing Management init section. */</span></div>
<div class="line">ucs_init_data.<a class="code" href="struct_ucs___init_data__t_a8619aaf795810b7508046fbfef6d6907.html#a8619aaf795810b7508046fbfef6d6907" title="The initialization data of the Routing Management.">rm</a>.<a class="code" href="struct_ucs___rm___init_data__t_a2420c468d89e6f991f68189ba2f61d15.html#a2420c468d89e6f991f68189ba2f61d15" title="Optional report callback function pointer for all routes.">report_fptr</a> = &amp;App_OnRoutingResult;</div>
<div class="line">ucs_init_data.<a class="code" href="struct_ucs___init_data__t_a8619aaf795810b7508046fbfef6d6907.html#a8619aaf795810b7508046fbfef6d6907" title="The initialization data of the Routing Management.">rm</a>.<a class="code" href="struct_ucs___rm___init_data__t_a68590d8712353f94f2e9ccec1e21baa5.html#a68590d8712353f94f2e9ccec1e21baa5" title="Callback function that acts as a debug interface for XRM resources. The user application has the poss...">debug_resource_status_fptr</a> = &amp;App_OnDebuggingXrmResources;</div>
<div class="line">ucs_init_data.<a class="code" href="struct_ucs___init_data__t_a8619aaf795810b7508046fbfef6d6907.html#a8619aaf795810b7508046fbfef6d6907" title="The initialization data of the Routing Management.">rm</a>.<a class="code" href="struct_ucs___rm___init_data__t_ab3de88c423837727c463947f57895e49.html#ab3de88c423837727c463947f57895e49" title="Initialization structure of the Extended Resource Manager.">xrm</a>.<a class="code" href="struct_ucs___xrm___init_data__t_a9497e039c582e7d2804ee470d6812e91.html#a9497e039c582e7d2804ee470d6812e91" title="Callback function that reports streaming-related information for the MOST Network Port...">most_port_status_fptr</a>  = &amp;App_MostPortStatusCb;</div>
<div class="line">ucs_init_data.<a class="code" href="struct_ucs___init_data__t_a8619aaf795810b7508046fbfef6d6907.html#a8619aaf795810b7508046fbfef6d6907" title="The initialization data of the Routing Management.">rm</a>.<a class="code" href="struct_ucs___rm___init_data__t_ab3de88c423837727c463947f57895e49.html#ab3de88c423837727c463947f57895e49" title="Initialization structure of the Extended Resource Manager.">xrm</a>.<a class="code" href="struct_ucs___xrm___init_data__t_a7ad953f5414061df43df073ece15e25b.html#a7ad953f5414061df43df073ece15e25b" title="Callback function that signals the EHC to check the mute pin state of devices before attempting unmut...">check_unmute_fptr</a>      = &amp;App_CheckUnmuteStatusCb;</div>
<div class="line"></div>
<div class="line"><span class="comment">/* The report callback function for all routes */</span></div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> App_OnRoutingResult(uint16_t route_id, <a class="code" href="group___g___u_c_s___r_o_u_t_i_n_g___t_y_p_e_s_ga75ffbf28e4afc99a6abdbff0887baf9b.html#ga75ffbf28e4afc99a6abdbff0887baf9b" title="This enumerator specifies the possible route information returned via User callback function of Ucs_R...">Ucs_Rm_RouteInfos_t</a> route_infos, <span class="keywordtype">void</span> *user_ptr)</div>
<div class="line">{</div>
<div class="line">    <span class="comment">/* Do whatever is necessary here */</span></div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">switch</span> (route_infos)</div>
<div class="line">    {</div>
<div class="line">        <span class="keywordflow">case</span> <a class="code" href="group___g___u_c_s___r_o_u_t_i_n_g___t_y_p_e_s_ga75ffbf28e4afc99a6abdbff0887baf9b.html#gga75ffbf28e4afc99a6abdbff0887baf9ba5778af29569eb74e7546749e93ed9c1e" title="Specifies that the route has been built.">UCS_RM_ROUTE_INFOS_BUILT</a>:</div>
<div class="line">            <span class="comment">/* Route has been built */</span></div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">        <span class="keywordflow">case</span> <a class="code" href="group___g___u_c_s___r_o_u_t_i_n_g___t_y_p_e_s_ga75ffbf28e4afc99a6abdbff0887baf9b.html#gga75ffbf28e4afc99a6abdbff0887baf9ba5458da57325825b8922710a90a9ea4d5" title="Specifies that the route has been destroyed.">UCS_RM_ROUTE_INFOS_DESTROYED</a>:</div>
<div class="line">            <span class="comment">/* Route has been destroyed */</span></div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">        <span class="keywordflow">case</span> <a class="code" href="group___g___u_c_s___r_o_u_t_i_n_g___t_y_p_e_s_ga75ffbf28e4afc99a6abdbff0887baf9b.html#gga75ffbf28e4afc99a6abdbff0887baf9bace1ac2f05b198d3d223baa33ca71493a" title="Specifies that the route cannot be processed anymore because of UNICENS Termination.">UCS_RM_ROUTE_INFOS_PROCESS_STOP</a>:</div>
<div class="line">            <span class="comment">/* Route cannot be processed anymore due to Unicens Termination */</span></div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">        <span class="keywordflow">default</span>:</div>
<div class="line">            <span class="comment">/* Route has been suspended */</span></div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Handle MOST Port Status event here */</span></div>
<div class="line"><span class="keywordtype">void</span> App_MostPortStatusCb(uint16_t most_port_handle,</div>
<div class="line">                            <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_ga902951b9083ff58a88e19e151b57106a.html#ga902951b9083ff58a88e19e151b57106a" title="Indicates if the MOST Network Port is available and ready for streaming data connections.">Ucs_Most_PortAvail_t</a> availability,</div>
<div class="line">                            <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_ga24bf81b4e52fc1fb01deba9165d7c79e.html#ga24bf81b4e52fc1fb01deba9165d7c79e" title="Indicates the sub state to parameter Available.">Ucs_Most_PortAvailInfo_t</a> avail_info,</div>
<div class="line">                            uint16_t free_streaming_bw)</div>
<div class="line">{</div>
<div class="line">    <span class="comment">/* Do what needs to be.. */</span></div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Handle the Mute Pin check here */</span></div>
<div class="line"><span class="keywordtype">void</span> App_CheckUnmuteStatusCb (uint16_t node_address)</div>
<div class="line">{</div>
<div class="line">    <span class="comment">/* Check the state of the mute pin here before unmuting */</span></div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Debug interface for the XRM resources */</span></div>
<div class="line"><span class="keywordtype">void</span> App_OnDebuggingXrmResources (<a class="code" href="group___g___u_c_s___x_r_m___t_y_p_e_s_gac238d98be8f9df6340eb4ee72de36ccc.html#gac238d98be8f9df6340eb4ee72de36ccc" title="INIC resource types used by the Extended Resource Manager.">Ucs_Xrm_ResourceType_t</a> resource_type, <a class="code" href="group___g___u_c_s___x_r_m___t_y_p_e_s_ga74e06fedcde6bc971088b2cb21405173.html#ga74e06fedcde6bc971088b2cb21405173" title="INIC Resource Object used for Extended Resource Manager jobs.">Ucs_Xrm_ResObject_t</a> *resource_ptr, <a class="code" href="group___g___u_c_s___x_r_m___t_y_p_e_s_ga5299ac232aaeba37eb6fceb53e32b2ea.html#ga5299ac232aaeba37eb6fceb53e32b2ea" title="This enumerator specifies the type of resources information.">Ucs_Xrm_ResourceInfos_t</a> resource_infos, </div>
<div class="line">                                  <a class="code" href="struct_ucs___rm___end_point__t.html" title="Configuration structure of a Connection EndPoint.">Ucs_Rm_EndPoint_t</a> *endpoint_inst_ptr, <span class="keywordtype">void</span> *user_ptr)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordflow">switch</span> (resource_infos)</div>
<div class="line">    {</div>
<div class="line">        <span class="keywordflow">case</span> <a class="code" href="group___g___u_c_s___x_r_m___t_y_p_e_s_ga5299ac232aaeba37eb6fceb53e32b2ea.html#gga5299ac232aaeba37eb6fceb53e32b2eaaf17abdbe8fab65a069b6a8af1079066a" title="Signals that the resource is built.">UCS_XRM_INFOS_BUILT</a>:</div>
<div class="line">            <span class="comment">/* Resource has been built */</span></div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">        <span class="keywordflow">case</span> <a class="code" href="group___g___u_c_s___x_r_m___t_y_p_e_s_ga5299ac232aaeba37eb6fceb53e32b2ea.html#gga5299ac232aaeba37eb6fceb53e32b2eaa6e7faa32a0cb82c3fdf4450d80188262" title="Signals that the resource is destroyed.">UCS_XRM_INFOS_DESTROYED</a>:</div>
<div class="line">            <span class="comment">/* resource has been destroyed */</span></div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">        <span class="keywordflow">case</span> <a class="code" href="group___g___u_c_s___x_r_m___t_y_p_e_s_ga5299ac232aaeba37eb6fceb53e32b2ea.html#gga5299ac232aaeba37eb6fceb53e32b2eaac57d4f29bbfd2f62eefddc4e31a7ad81" title="Signals that XRM fails to build the resource.">UCS_XRM_INFOS_ERR_BUILT</a>:</div>
<div class="line">            <span class="comment">/* Resource cannot be built */</span></div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">        <span class="keywordflow">default</span>:</div>
<div class="line">            <span class="comment">/* Resource cannot be destroyed */</span></div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">    }</div>
<div class="line">}</div>
</div><!-- fragment --><h1>Operation</h1>
<p>After initialization the application specifies the routes, endpoints, nodes as well as the XRM jobs and calls the <a class="el" href="group___g___u_c_s___r_o_u_t_i_n_g_gaaa23aca8279da197192210fe11889452.html#gaaa23aca8279da197192210fe11889452" title="Initializes the routing process with the given routes list information and starts the process to hand...">Ucs_Rm_Start()</a> 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 <b>preconditions</b> for the routes to be handled properly:</p>
<ul>
<li>UNICENS is initialized</li>
<li>XRM macros have been set correctly (See above)</li>
<li>The network is available</li>
<li>The nodes, where the corresponding routes shall be built on, are <code>available</code>. That is, the user application has to call the function <a class="el" href="group___g___u_c_s___r_o_u_t_i_n_g_ga57ca34a488f06d57f2219be23fa0259f.html#ga57ca34a488f06d57f2219be23fa0259f" title="Sets the availability attribute (available or not available) of the given node and triggers the routi...">Ucs_Rm_SetNodeAvailable()</a> 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 <a class="el" href="struct_ucs___rm___init_data__t_a2420c468d89e6f991f68189ba2f61d15.html#a2420c468d89e6f991f68189ba2f61d15">report_fptr</a> and <a class="el" href="struct_ucs___rm___init_data__t_a68590d8712353f94f2e9ccec1e21baa5.html#a68590d8712353f94f2e9ccec1e21baa5">debug_resource_status_fptr</a> in <a class="el" href="struct_ucs___rm___init_data__t.html" title="The initialization structure of the Routing Management.">Ucs_Rm_InitData_t</a>.</li>
</ul>
<p>In short the user application can anytime call the function <a class="el" href="group___g___u_c_s___r_o_u_t_i_n_g_gaaa23aca8279da197192210fe11889452.html#gaaa23aca8279da197192210fe11889452" title="Initializes the routing process with the given routes list information and starts the process to hand...">Ucs_Rm_Start()</a> with the specified list of routes but these routes will have been processing only when the above conditions are met.</p>
<p>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 <b>0xFF</b> and the minimum time between the retries is <b>50ms</b>.</p>
<p>Also note that enabling the error and event trace output in <code>ucs_cfg.h</code> file (see below) will help user get detailed information on routes during processing. </p>
<div class="fragment"><div class="line"><span class="comment">/* File: ucs_cfg.h */</span></div>
<div class="line"><span class="comment">/*------------------------------------------------------------------------------------------------*/</span></div>
<div class="line"><span class="comment">/* Tracing &amp; Debugging                                                                            */</span></div>
<div class="line"><span class="comment">/*------------------------------------------------------------------------------------------------*/</span></div>
<div class="line"><span class="preprocessor"># define UCS_TR_ERROR     App_TraceError</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor"># define UCS_TR_INFO      App_TraceInfo</span></div>
<div class="line"><span class="preprocessor"></span></div>
<div class="line"><span class="keyword">extern</span> <span class="keywordtype">void</span> App_TraceError(<span class="keywordtype">void</span> *ucs_user_ptr, <span class="keyword">const</span> <span class="keywordtype">char</span> module_str[], <span class="keyword">const</span> <span class="keywordtype">char</span> entry_str[], </div>
<div class="line">                           uint16_t vargs_cnt, ...); </div>
<div class="line"><span class="keyword">extern</span> <span class="keywordtype">void</span> App_TraceInfo(<span class="keywordtype">void</span> *ucs_user_ptr, <span class="keyword">const</span> <span class="keywordtype">char</span> module_str[], <span class="keyword">const</span> <span class="keywordtype">char</span> entry_str[], </div>
<div class="line">                           uint16_t vargs_cnt, ...);</div>
</div><!-- fragment --><h1>Example</h1>
<p>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 <a class="el" href="group___g___u_c_s___i_r_m_ga17bc521c78b99dc17f16161199cd4c1a.html#ga17bc521c78b99dc17f16161199cd4c1a">UCS_ADDR_LOCAL_DEV</a> macro is used to address the local device and <b>should</b> <b>only</b> <b>be</b> <b>used</b> for the local device. <br/>
 This example is inserted as a guide and may not contain all of the necessary details and information. </p>
<div class="fragment"><div class="line"><span class="comment">/***************************************************************************************************</span></div>
<div class="line"><span class="comment">                 DESCRIPTION OF THE SPECIFIED ROUTE_66 (Refer to the above picture)</span></div>
<div class="line"><span class="comment">                                                                                                    </span></div>
<div class="line"><span class="comment">  </span></div>
<div class="line"><span class="comment">   Source Endpoint [Synchronous Data Connection &quot;Application -&gt; Streaming Port -&gt; MOST&quot;]:</span></div>
<div class="line"><span class="comment">        - Configuration Port A:</span></div>
<div class="line"><span class="comment">            - Operation Mode: Generic</span></div>
<div class="line"><span class="comment">            - Port Option: InOut</span></div>
<div class="line"><span class="comment">            - Clock Mode: Output</span></div>
<div class="line"><span class="comment">            - Clock Data Delay: NonDelayed</span></div>
<div class="line"><span class="comment">        - Configuration Port B:</span></div>
<div class="line"><span class="comment">            - Operation Mode: Generic</span></div>
<div class="line"><span class="comment">            - Port Option: InOut</span></div>
<div class="line"><span class="comment">            - Clock Mode: Output</span></div>
<div class="line"><span class="comment">            - Clock Data Delay: NonDelayed</span></div>
<div class="line"><span class="comment">        - Streaming Port A:</span></div>
<div class="line"><span class="comment">            - Clock Config: 64 Fs</span></div>
<div class="line"><span class="comment">            - Data Alignment: Left16Bit</span></div>
<div class="line"><span class="comment">        - Streaming Socket:</span></div>
<div class="line"><span class="comment">            - Direction: Input</span></div>
<div class="line"><span class="comment">            - Data Type: Sync</span></div>
<div class="line"><span class="comment">            - Bandwidth: 2</span></div>
<div class="line"><span class="comment">            - Streaming Pin ID: SRXA0</span></div>
<div class="line"><span class="comment">        - MOST Socket:</span></div>
<div class="line"><span class="comment">            - Direction: Output</span></div>
<div class="line"><span class="comment">            - Data type: Sync Data</span></div>
<div class="line"><span class="comment">            - MOST Port Handle: 0x0D00</span></div>
<div class="line"><span class="comment">            - Bandwidth: 2 bytes</span></div>
<div class="line"><span class="comment">  </span></div>
<div class="line"><span class="comment">   Sink Endpoint [Synchronous Data Connection &quot;MOST -&gt; MediaLB -&gt; Application (INIC on I/O-Board)&quot;]:</span></div>
<div class="line"><span class="comment">        - No Muting</span></div>
<div class="line"><span class="comment">        - MediaLB Port:</span></div>
<div class="line"><span class="comment">            - Clock Config: 512Fs</span></div>
<div class="line"><span class="comment">        - MediaLB Socket:</span></div>
<div class="line"><span class="comment">            - Direction: Output</span></div>
<div class="line"><span class="comment">            - Data type: Sync Data</span></div>
<div class="line"><span class="comment">            - Bandwidth: 2 bytes</span></div>
<div class="line"><span class="comment">            - Channel address: 0x000A</span></div>
<div class="line"><span class="comment">        - MOST Socket:</span></div>
<div class="line"><span class="comment">            - Direction: Input</span></div>
<div class="line"><span class="comment">            - Data type: Sync Data</span></div>
<div class="line"><span class="comment">            - MOST Port Handle: 0x0D00</span></div>
<div class="line"><span class="comment">            - Bandwidth: 2 bytes</span></div>
<div class="line"><span class="comment">  </span></div>
<div class="line"><span class="comment"> *--------------------------------------------------------------------------------------------------</span></div>
<div class="line"><span class="comment"> */</span></div>
<div class="line"></div>
<div class="line"><span class="comment">/* Forward declaration of results callback function */</span></div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> App_OnRoutingResult(uint16_t route_id, <a class="code" href="group___g___u_c_s___r_o_u_t_i_n_g___t_y_p_e_s_ga75ffbf28e4afc99a6abdbff0887baf9b.html#ga75ffbf28e4afc99a6abdbff0887baf9b" title="This enumerator specifies the possible route information returned via User callback function of Ucs_R...">Ucs_Rm_RouteInfos_t</a> route_infos, <span class="keywordtype">void</span> *user_ptr);</div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> App_OnInitResult(<a class="code" href="group___g___u_c_s___i_n_i_t___a_n_d___s_r_v___t_y_p_e_s_ga0a933f34b9acbf21dc68f426c324e78c.html#ga0a933f34b9acbf21dc68f426c324e78c" title="Result values of initialization result callback function.">Ucs_InitResult_t</a> result, <span class="keywordtype">void</span> *user_ptr);</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Set app flags */</span></div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">bool</span> app_is_running = <span class="keyword">true</span>;</div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">bool</span> ucs_is_running = <span class="keyword">false</span>;</div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">bool</span> ampl_is_discovered    = <span class="keyword">false</span>;</div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">bool</span> set_ampl_to_available = <span class="keyword">false</span>;</div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">bool</span> rtm_is_started = <span class="keyword">false</span>;</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Set route Activity Flag */</span></div>
<div class="line"><span class="keyword">static</span> uint8_t is_active = 0x01U;    </div>
<div class="line"></div>
<div class="line"><span class="comment">/* Specification of XRM JOB OUT */</span></div>
<div class="line"> <span class="keyword">static</span> <a class="code" href="struct_ucs___xrm___most_socket__t.html" title="Configuration structure of a MOST socket.">Ucs_Xrm_MostSocket_t</a> Xrm_Most_Sckt_Out = { <a class="code" href="group___g___u_c_s___x_r_m___t_y_p_e_s_gac238d98be8f9df6340eb4ee72de36ccc.html#ggac238d98be8f9df6340eb4ee72de36cccaeebb673b9abc5172f688f8e9e692441c" title="MOST socket.">UCS_XRM_RC_TYPE_MOST_SOCKET</a>, 0x0D00U, <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_ga28477f727fe10f9d6fd21cfc98a9c115.html#gga28477f727fe10f9d6fd21cfc98a9c115aa14fc95a1f8c5f54aa6d601614a887fe" title="Socket transfers data out of INIC.">UCS_SOCKET_DIR_OUTPUT</a>, <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_gab29e10223e27331045485facbe4102ee.html#ggab29e10223e27331045485facbe4102eea345ad57d9919545fa5e5bf8393b0224f" title="Specifies the synchronous streaming data type.">UCS_MOST_SCKT_SYNC_DATA</a>, 2U };</div>
<div class="line"> <span class="keyword">static</span> <a class="code" href="struct_ucs___xrm___strm_port__t.html" title="Configuration structure of a streaming port.">Ucs_Xrm_StrmPort_t</a>   Xrm_Str_Port_A    = { <a class="code" href="group___g___u_c_s___x_r_m___t_y_p_e_s_gac238d98be8f9df6340eb4ee72de36ccc.html#ggac238d98be8f9df6340eb4ee72de36ccca1956e37c3cfebc66ed6f5da75f67d589" title="Streaming port.">UCS_XRM_RC_TYPE_STRM_PORT</a>, 0x00U, <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_ga0e856884fa1c7908c59718da0f396484.html#gga0e856884fa1c7908c59718da0f396484a6ecefb4d6d534dfc6225644bf6cb9823" title="64 x Fs">UCS_STREAM_PORT_CLK_CFG_64FS</a>, <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_ga02741bef1059621aaf6cf4fa956cfccf.html#gga02741bef1059621aaf6cf4fa956cfccfa7505ae359df8d66ec68bacb78c049f52" title="Left-justified, 16 bit, legacy.">UCS_STREAM_PORT_ALGN_LEFT16BIT</a> };</div>
<div class="line"> <span class="keyword">static</span> <a class="code" href="struct_ucs___xrm___strm_socket__t.html" title="Configuration structure of a streaming data socket.">Ucs_Xrm_StrmSocket_t</a> Xrm_Str_Socket_In = { <a class="code" href="group___g___u_c_s___x_r_m___t_y_p_e_s_gac238d98be8f9df6340eb4ee72de36ccc.html#ggac238d98be8f9df6340eb4ee72de36ccca42a35dfe6f0054952406aeb6cdcf5119" title="Streaming socket.">UCS_XRM_RC_TYPE_STRM_SOCKET</a>, &amp;Xrm_Str_Port_A, <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_ga28477f727fe10f9d6fd21cfc98a9c115.html#gga28477f727fe10f9d6fd21cfc98a9c115a02fdd605a809a4a660e25cfd888347c7" title="Socket transfers data into INIC.">UCS_SOCKET_DIR_INPUT</a>, <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_gae12684f1b74844d622e59da79f1a23f8.html#ggae12684f1b74844d622e59da79f1a23f8a547bb39c45cc5788c3e5352f2b7fa76f" title="Specifies the synchronous streaming data type.">UCS_STREAM_PORT_SCKT_SYNC_DATA</a>, 2U, <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_gaadbd9007127f39c3c257040adf063d07.html#ggaadbd9007127f39c3c257040adf063d07a16eeeaad94f4398034b16f32832b2b52" title="PortA, pin 5.">UCS_STREAM_PORT_PIN_ID_SRXA0</a> };</div>
<div class="line"> <span class="keyword">static</span> <a class="code" href="struct_ucs___xrm___sync_con__t.html" title="Configuration structure of a synchronous data connection.">Ucs_Xrm_SyncCon_t</a>    Xrm_Sync_Conn_Src = { <a class="code" href="group___g___u_c_s___x_r_m___t_y_p_e_s_gac238d98be8f9df6340eb4ee72de36ccc.html#ggac238d98be8f9df6340eb4ee72de36ccca47342ee294555a9b7e738c9fc34b5265" title="Synchronous data connection.">UCS_XRM_RC_TYPE_SYNC_CON</a>, &amp;Xrm_Str_Socket_In, &amp;Xrm_Most_Sckt_Out, <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_gaef12892b897a1cd1013357cfe63f2434.html#ggaef12892b897a1cd1013357cfe63f2434a6e21656de3fa891d522f272307fca772" title="No mute monitoring.">UCS_SYNC_MUTE_MODE_NO_MUTING</a>, 0U };</div>
<div class="line"></div>
<div class="line"> <span class="comment">/* Specification of XRM JOB IN */</span></div>
<div class="line"> <span class="keyword">static</span> <a class="code" href="struct_ucs___xrm___most_socket__t.html" title="Configuration structure of a MOST socket.">Ucs_Xrm_MostSocket_t</a> Xrm_Most_Sckt_In   = { <a class="code" href="group___g___u_c_s___x_r_m___t_y_p_e_s_gac238d98be8f9df6340eb4ee72de36ccc.html#ggac238d98be8f9df6340eb4ee72de36cccaeebb673b9abc5172f688f8e9e692441c" title="MOST socket.">UCS_XRM_RC_TYPE_MOST_SOCKET</a>, 0x0D00U, <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_ga28477f727fe10f9d6fd21cfc98a9c115.html#gga28477f727fe10f9d6fd21cfc98a9c115a02fdd605a809a4a660e25cfd888347c7" title="Socket transfers data into INIC.">UCS_SOCKET_DIR_INPUT</a>, <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_gab29e10223e27331045485facbe4102ee.html#ggab29e10223e27331045485facbe4102eea345ad57d9919545fa5e5bf8393b0224f" title="Specifies the synchronous streaming data type.">UCS_MOST_SCKT_SYNC_DATA</a>, 2U };</div>
<div class="line"> <span class="keyword">static</span> <a class="code" href="struct_ucs___xrm___mlb_port__t.html" title="Configuration structure of a MediaLB port.">Ucs_Xrm_MlbPort_t</a>    Xrm_Mlb_Port       = { <a class="code" href="group___g___u_c_s___x_r_m___t_y_p_e_s_gac238d98be8f9df6340eb4ee72de36ccc.html#ggac238d98be8f9df6340eb4ee72de36ccca2c31643fe2ccea0ecb44424ef0ba0472" title="MediaLB port.">UCS_XRM_RC_TYPE_MLB_PORT</a>, 0x00U, <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_ga12193f5b8d160e84ad8b9853b0308f63.html#gga12193f5b8d160e84ad8b9853b0308f63a13645115ff4864a09293ef5cdaaaf963" title="512 Fs">UCS_MLB_CLK_CFG_512_FS</a> };</div>
<div class="line"> <span class="keyword">static</span> <a class="code" href="struct_ucs___xrm___mlb_socket__t.html" title="Configuration structure of a MediaLB socket.">Ucs_Xrm_MlbSocket_t</a>  Xrm_Mlb_Socket_Out = { <a class="code" href="group___g___u_c_s___x_r_m___t_y_p_e_s_gac238d98be8f9df6340eb4ee72de36ccc.html#ggac238d98be8f9df6340eb4ee72de36ccca51a0ec5a470cb37f90a79a73f0f83be4" title="MediaLB socket.">UCS_XRM_RC_TYPE_MLB_SOCKET</a>, &amp;Xrm_Mlb_Port, <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_ga28477f727fe10f9d6fd21cfc98a9c115.html#gga28477f727fe10f9d6fd21cfc98a9c115aa14fc95a1f8c5f54aa6d601614a887fe" title="Socket transfers data out of INIC.">UCS_SOCKET_DIR_OUTPUT</a>, <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_gaf3facaf3378409c31465c68380990b53.html#ggaf3facaf3378409c31465c68380990b53a09527a2a481a353e06071b0d83a97fd9" title="Specifies the synchronous streaming data type.">UCS_MLB_SCKT_SYNC_DATA</a>, 2U, 0x000AU };</div>
<div class="line"> <span class="keyword">static</span> <a class="code" href="struct_ucs___xrm___sync_con__t.html" title="Configuration structure of a synchronous data connection.">Ucs_Xrm_SyncCon_t</a>    Xrm_Sync_Conn_Sink = { <a class="code" href="group___g___u_c_s___x_r_m___t_y_p_e_s_gac238d98be8f9df6340eb4ee72de36ccc.html#ggac238d98be8f9df6340eb4ee72de36ccca47342ee294555a9b7e738c9fc34b5265" title="Synchronous data connection.">UCS_XRM_RC_TYPE_SYNC_CON</a>, &amp;Xrm_Most_Sckt_In, &amp;Xrm_Mlb_Socket_Out, <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_gaef12892b897a1cd1013357cfe63f2434.html#ggaef12892b897a1cd1013357cfe63f2434a6e21656de3fa891d522f272307fca772" title="No mute monitoring.">UCS_SYNC_MUTE_MODE_NO_MUTING</a>, 0U };</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Specification of the XRM jobs lists */</span></div>
<div class="line"><span class="keyword">static</span> <a class="code" href="group___g___u_c_s___x_r_m___t_y_p_e_s_ga74e06fedcde6bc971088b2cb21405173.html#ga74e06fedcde6bc971088b2cb21405173" title="INIC Resource Object used for Extended Resource Manager jobs.">Ucs_Xrm_ResObject_t</a> * xrm_job_out[] = { &amp;Xrm_Most_Sckt_Out, &amp;Xrm_Str_Port_A, &amp;Xrm_Str_Socket_In,  &amp;Xrm_Sync_Conn_Src, NULL };</div>
<div class="line"><span class="keyword">static</span> <a class="code" href="group___g___u_c_s___x_r_m___t_y_p_e_s_ga74e06fedcde6bc971088b2cb21405173.html#ga74e06fedcde6bc971088b2cb21405173" title="INIC Resource Object used for Extended Resource Manager jobs.">Ucs_Xrm_ResObject_t</a> * xrm_job_in [] = { &amp;Xrm_Most_Sckt_In,  &amp;Xrm_Mlb_Port, &amp;Xrm_Mlb_Socket_Out, &amp;Xrm_Sync_Conn_Sink, NULL };</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Specification of signatures objects */</span></div>
<div class="line"><a class="code" href="struct_ucs___signature__t.html" title="This structure holds the signature of the Hello, Welcome and Signature messages. It supports the sign...">Ucs_Signature_t</a> src_sig  = { <a class="code" href="group___g___u_c_s___i_r_m_ga17bc521c78b99dc17f16161199cd4c1a.html#ga17bc521c78b99dc17f16161199cd4c1a" title="Defines the address of the local device.">UCS_ADDR_LOCAL_DEV</a> };</div>
<div class="line"><a class="code" href="struct_ucs___signature__t.html" title="This structure holds the signature of the Hello, Welcome and Signature messages. It supports the sign...">Ucs_Signature_t</a> sink_sig = { 0x555U };</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Specification of Nodes objects */</span></div>
<div class="line"><span class="keyword">static</span> <a class="code" href="struct_ucs___rm___node__t.html" title="Configuration structure of a Node.">Ucs_Rm_Node_t</a> hmi_node  = { &amp;src_sig };</div>
<div class="line"><span class="keyword">static</span> <a class="code" href="struct_ucs___rm___node__t.html" title="Configuration structure of a Node.">Ucs_Rm_Node_t</a> ampl_node = { &amp;sink_sig };</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Source and Sink Endpoints */</span></div>
<div class="line"><span class="keyword">static</span> <a class="code" href="struct_ucs___rm___end_point__t.html" title="Configuration structure of a Connection EndPoint.">Ucs_Rm_EndPoint_t</a> endpoint_src   = { <a class="code" href="group___g___u_c_s___r_o_u_t_i_n_g___t_y_p_e_s_ga127a72f023d3c0289ab74b001f6edc25.html#gga127a72f023d3c0289ab74b001f6edc25ac1244d5bc6a569137f6f9132b8b0a3da" title="Specifies the source endpoint.">UCS_RM_EP_SOURCE</a>, &amp;xrm_job_out[0], &amp;hmi_node  };</div>
<div class="line"><span class="keyword">static</span> <a class="code" href="struct_ucs___rm___end_point__t.html" title="Configuration structure of a Connection EndPoint.">Ucs_Rm_EndPoint_t</a> endpoint_sink  = { <a class="code" href="group___g___u_c_s___r_o_u_t_i_n_g___t_y_p_e_s_ga127a72f023d3c0289ab74b001f6edc25.html#gga127a72f023d3c0289ab74b001f6edc25a63c4dfa3683ce8122d760c4e2d580138" title="Specifies the sink endpoint.">UCS_RM_EP_SINK</a>,   &amp;xrm_job_in[0],  &amp;ampl_node };</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Routes Specification */</span></div>
<div class="line"><span class="keyword">static</span> <a class="code" href="struct_ucs___rm___route__t.html" title="Configuration structure of a Route.">Ucs_Rm_Route_t</a> route_66[]        = { {&amp;endpoint_src, &amp;endpoint_sink, is_active, 66U} };</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Main function */</span></div>
<div class="line"><span class="keywordtype">void</span> main ()</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="struct_ucs___init_data__t.html" title="UNICENS initialization structure used by function Ucs_Init().">Ucs_InitData_t</a> ucs_init_data;</div>
<div class="line">    <span class="comment">/* create instance and prepare init structure */</span></div>
<div class="line">    ucs_inst_ptr = <a class="code" href="group___g___u_c_s___i_n_i_t___a_n_d___s_r_v_ga85a99b5d236b29e2d598bef51edad638.html#ga85a99b5d236b29e2d598bef51edad638" title="Retrieves a UNICENS API instance.">Ucs_CreateInstance</a>();</div>
<div class="line">    (void)<a class="code" href="group___g___u_c_s___i_n_i_t___a_n_d___s_r_v_ga64b50780725a0dc8693b5b73f8345ad6.html#ga64b50780725a0dc8693b5b73f8345ad6" title="Assigns default values to a provided UNICENS init structure.">Ucs_SetDefaultConfig</a>(&amp;ucs_init_data);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* Routing Management init section. */</span></div>
<div class="line">    ucs_init_data.<a class="code" href="struct_ucs___init_data__t_a8619aaf795810b7508046fbfef6d6907.html#a8619aaf795810b7508046fbfef6d6907" title="The initialization data of the Routing Management.">rm</a>.<a class="code" href="struct_ucs___rm___init_data__t_a2420c468d89e6f991f68189ba2f61d15.html#a2420c468d89e6f991f68189ba2f61d15" title="Optional report callback function pointer for all routes.">report_fptr</a> = &amp;App_OnRoutingResult;</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* Library initialization */</span></div>
<div class="line">    (void)<a class="code" href="group___g___u_c_s___i_n_i_t___a_n_d___s_r_v_gaea8d7735d41853167a2befdc06febe43.html#gaea8d7735d41853167a2befdc06febe43" title="UNICENS initialization function.">Ucs_Init</a>(inst_ptr, &amp;init_data, &amp;App_OnInitResult);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">while</span> (app_is_running)</div>
<div class="line">    {</div>
<div class="line">        <span class="keywordflow">if</span> (ucs_is_running)</div>
<div class="line">        {</div>
<div class="line">            <span class="keywordflow">if</span> (!rtm_is_started)</div>
<div class="line">            {</div>
<div class="line">                rtm_is_started = <span class="keyword">true</span>;</div>
<div class="line"></div>
<div class="line">                <span class="comment">/* Network start-up */</span></div>
<div class="line">                <a class="code" href="group___g___u_c_s___n_e_t_ga83c2e74a4cc216aa10d7c6a1a517d459.html#ga83c2e74a4cc216aa10d7c6a1a517d459" title="Starts up the MOST Network.">Ucs_Network_Startup</a>(ucs_inst_ptr, 52U, 0xFFFFU, NULL);</div>
<div class="line"></div>
<div class="line">                <span class="comment">/* Starts routes processing */</span></div>
<div class="line">                <a class="code" href="group___g___u_c_s___i_n_i_t___a_n_d___s_r_v___t_y_p_e_s_ga886138f5d13e84ffaa3df5769830e1cd.html#ga886138f5d13e84ffaa3df5769830e1cd" title="Standard return codes used for synchronous response.">Ucs_Return_t</a> ret_value = <a class="code" href="group___g___u_c_s___r_o_u_t_i_n_g_gaaa23aca8279da197192210fe11889452.html#gaaa23aca8279da197192210fe11889452" title="Initializes the routing process with the given routes list information and starts the process to hand...">Ucs_Rm_Start</a>(ucs_inst_ptr, &amp;route_66[0], 1U);</div>
<div class="line">                <span class="keywordflow">if</span> (ret_value != <a class="code" href="group___g___u_c_s___i_n_i_t___a_n_d___s_r_v___t_y_p_e_s_ga886138f5d13e84ffaa3df5769830e1cd.html#gga886138f5d13e84ffaa3df5769830e1cda3fb51656e17ee4802f23706f35e349bc" title="Operation successfully completed.">UCS_RET_SUCCESS</a>)</div>
<div class="line">                {</div>
<div class="line">                    <span class="comment">/* Do whatever is necessary here */</span></div>
<div class="line">                }</div>
<div class="line">            }</div>
<div class="line"></div>
<div class="line">            <span class="keywordflow">if</span> (set_ampl_to_available)</div>
<div class="line">            {</div>
<div class="line">                <a class="code" href="group___g___u_c_s___r_o_u_t_i_n_g_ga57ca34a488f06d57f2219be23fa0259f.html#ga57ca34a488f06d57f2219be23fa0259f" title="Sets the availability attribute (available or not available) of the given node and triggers the routi...">Ucs_Rm_SetNodeAvailable</a>(ucs_inst_ptr, &amp;ampl_node, <span class="keyword">true</span>);</div>
<div class="line">            }</div>
<div class="line"></div>
<div class="line">            <span class="keywordflow">if</span> (ampl_is_discovered)</div>
<div class="line">            {</div>
<div class="line">                (void)<a class="code" href="group___g___u_c_s___x_r_m___s_t_r_e_a_m_ga481fb8455d6165c5913ead778765d46e.html#ga481fb8455d6165c5913ead778765d46e" title="This function is used to configure a Streaming Port.">Ucs_Xrm_Stream_SetPortConfig</a>(ampl_node.<a class="code" href="struct_ucs___rm___node__t_ae619e45bed87dee01aaf280635cf3911.html#ae619e45bed87dee01aaf280635cf3911" title="node signature.">signature_ptr</a>-&gt;<a class="code" href="struct_ucs___signature__t_a550e0ded0fb13bc58b087d3a162d43c7.html#a550e0ded0fb13bc58b087d3a162d43c7" title="NodeAddress.">node_address</a>, </div>
<div class="line">                                                   0x00U,</div>
<div class="line">                                                   <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_ga6ea92012ace1c507dab36b727698a08e.html#gga6ea92012ace1c507dab36b727698a08ea10bf424b1ddb5c25b7659991fa761946" title="If Index = PortB, data pins are linked to PortA clock configuration.">UCS_STREAM_PORT_OP_MODE_GENERIC</a>,</div>
<div class="line">                                                   <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_ga83e210aa76632ea2191bd59ef7894432.html#gga83e210aa76632ea2191bd59ef7894432a5953e1aaabaaa5ae4a74fe0ec5842246" title="Two serial interface pins are available; one for direction IN and one for direction OUT...">UCS_STREAM_PORT_OPT_IN_OUT</a>,</div>
<div class="line">                                                   <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_ga3139c2b4d435622104235bd9fd9f478c.html#gga3139c2b4d435622104235bd9fd9f478ca3c768bceb59f2b4ef488e285a9d11b20" title="INIC drives the FSY/SCK signals as outputs, frequency locked to the network clock.">UCS_STREAM_PORT_CLK_MODE_OUTPUT</a>,</div>
<div class="line">                                                   <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_ga16d6cd08e925676dfade13e980f460b0.html#gga16d6cd08e925676dfade13e980f460b0a4a03b7fe83667b4e5f2a355e2810ed6f" title="Data is not delayed by a single SCK clock delay.">UCS_STREAM_PORT_CLK_DLY_NONE</a>,</div>
<div class="line">                                                   &amp;App_XrmStreamPortCfgResCb);</div>
<div class="line">            }</div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Notifies initialization result */</span></div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> App_OnInitResult(<a class="code" href="group___g___u_c_s___i_n_i_t___a_n_d___s_r_v___t_y_p_e_s_ga0a933f34b9acbf21dc68f426c324e78c.html#ga0a933f34b9acbf21dc68f426c324e78c" title="Result values of initialization result callback function.">Ucs_InitResult_t</a> result, <span class="keywordtype">void</span> *user_ptr)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordflow">if</span> (result == <a class="code" href="group___g___u_c_s___i_n_i_t___a_n_d___s_r_v___t_y_p_e_s_ga0a933f34b9acbf21dc68f426c324e78c.html#gga0a933f34b9acbf21dc68f426c324e78cac4d2785b5c79a9b38389e08d30494714" title="Initialization succeeded.">UCS_INIT_RES_SUCCESS</a>)</div>
<div class="line">    {</div>
<div class="line">        ucs_is_running = <span class="keyword">true</span>;</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line">  </div>
<div class="line"><span class="comment">/* The report callback function for all routes */</span></div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> App_OnRoutingResult(<a class="code" href="struct_ucs___rm___route__t.html" title="Configuration structure of a Route.">Ucs_Rm_Route_t</a>* route_ptr, <a class="code" href="group___g___u_c_s___r_o_u_t_i_n_g___t_y_p_e_s_ga75ffbf28e4afc99a6abdbff0887baf9b.html#ga75ffbf28e4afc99a6abdbff0887baf9b" title="This enumerator specifies the possible route information returned via User callback function of Ucs_R...">Ucs_Rm_RouteInfos_t</a> route_infos, <span class="keywordtype">void</span> *user_ptr)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordflow">switch</span> (route_infos)</div>
<div class="line">    {</div>
<div class="line">        <span class="keywordflow">case</span> <a class="code" href="group___g___u_c_s___r_o_u_t_i_n_g___t_y_p_e_s_ga75ffbf28e4afc99a6abdbff0887baf9b.html#gga75ffbf28e4afc99a6abdbff0887baf9ba5778af29569eb74e7546749e93ed9c1e" title="Specifies that the route has been built.">UCS_RM_ROUTE_INFOS_BUILT</a>:</div>
<div class="line">            <span class="comment">/* Route has been built */</span></div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">        <span class="keywordflow">case</span> <a class="code" href="group___g___u_c_s___r_o_u_t_i_n_g___t_y_p_e_s_ga75ffbf28e4afc99a6abdbff0887baf9b.html#gga75ffbf28e4afc99a6abdbff0887baf9ba5458da57325825b8922710a90a9ea4d5" title="Specifies that the route has been destroyed.">UCS_RM_ROUTE_INFOS_DESTROYED</a>:</div>
<div class="line">            <span class="comment">/* Route has been destroyed */</span></div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">        <span class="keywordflow">case</span> <a class="code" href="group___g___u_c_s___r_o_u_t_i_n_g___t_y_p_e_s_ga75ffbf28e4afc99a6abdbff0887baf9b.html#gga75ffbf28e4afc99a6abdbff0887baf9bace1ac2f05b198d3d223baa33ca71493a" title="Specifies that the route cannot be processed anymore because of UNICENS Termination.">UCS_RM_ROUTE_INFOS_PROCESS_STOP</a>:</div>
<div class="line">            <span class="comment">/* Route cannot be processed anymore due to Unicens Termination */</span></div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">        <span class="keywordflow">default</span>:</div>
<div class="line">            <span class="comment">/* Route has been suspended */</span></div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* The result callback function for Streaming ports  */</span></div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> App_XrmStreamPortCfgResCb(uint16_t node_address,</div>
<div class="line">                                      uint8_t index,</div>
<div class="line">                                      <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_ga6ea92012ace1c507dab36b727698a08e.html#ga6ea92012ace1c507dab36b727698a08e" title="Operation mode of the Streaming Port.">Ucs_Stream_PortOpMode_t</a> op_mode,</div>
<div class="line">                                      <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_ga83e210aa76632ea2191bd59ef7894432.html#ga83e210aa76632ea2191bd59ef7894432" title="Direction of the physical pins of the indexed Streaming Port.">Ucs_Stream_PortOption_t</a> port_option,</div>
<div class="line">                                      <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_ga3139c2b4d435622104235bd9fd9f478c.html#ga3139c2b4d435622104235bd9fd9f478c" title="Indicates if FSY/SCK signals are configured as outputs or inputs.">Ucs_Stream_PortClockMode_t</a> clock_mode,</div>
<div class="line">                                      <a class="code" href="group___g___u_c_s___x_r_m___e_n_u_m_ga16d6cd08e925676dfade13e980f460b0.html#ga16d6cd08e925676dfade13e980f460b0" title="This setting is only applicable to data pins used for Generic Streaming including any linked pins to ...">Ucs_Stream_PortClockDataDelay_t</a> clock_data_delay,</div>
<div class="line">                                      <a class="code" href="struct_ucs___std_result__t.html" title="Standard result structure which provides fields for detailed status and error information.">Ucs_StdResult_t</a> result,</div>
<div class="line">                                      <span class="keywordtype">void</span> *user_ptr)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordflow">if</span> (result.<a class="code" href="struct_ucs___std_result__t_a02d8eefc721a797ac87f5030774972ef.html#a02d8eefc721a797ac87f5030774972ef" title="Result/Error code.">code</a> == <a class="code" href="group___g___u_c_s___i_n_i_t___a_n_d___s_r_v___t_y_p_e_s_gac844b77cf41aef663782bc0b43d3540c.html#ggac844b77cf41aef663782bc0b43d3540cae19d5a51de78bbf903a108a4e36a0fdf" title="Operation successfully completed.">UCS_RES_SUCCESS</a>)</div>
<div class="line">    {</div>
<div class="line">        set_ampl_to_available = <span class="keyword">true</span>;</div>
<div class="line">    }</div>
<div class="line">}</div>
</div><!-- fragment --><h1>Additional Routing API</h1>
<p>The Routing provides additional API functions to handle some runtime tasks. These functions are:</p>
<ul>
<li><a class="el" href="group___g___u_c_s___r_o_u_t_i_n_g_gabb9185254132bb29ee0af137c36f50b8.html#gabb9185254132bb29ee0af137c36f50b8" title="Sets the given route to active respectively inactive and triggers the routing process to handle the r...">Ucs_Rm_SetRouteActive()</a> : This functions sets a specific route to <code>"active"</code> or <code>"inactive"</code> at runtime.</li>
<li><a class="el" href="group___g___u_c_s___r_o_u_t_i_n_g_ga57ca34a488f06d57f2219be23fa0259f.html#ga57ca34a488f06d57f2219be23fa0259f" title="Sets the availability attribute (available or not available) of the given node and triggers the routi...">Ucs_Rm_SetNodeAvailable()</a> : This function sets the availability attribute (<code>available</code> or <code>not</code> <code>available</code>) of the given node and triggers the routing process to handle attached route(s).</li>
<li><a class="el" href="group___g___u_c_s___r_o_u_t_i_n_g_ga32d004eb96f434f379614b29fe2a486a.html#ga32d004eb96f434f379614b29fe2a486a" title="Retrieves the &quot;available&quot; flag information of the given node.">Ucs_Rm_GetNodeAvailable()</a> : This function retrieves the <code>"available"</code> flag information of a given node.</li>
<li><a class="el" href="group___g___u_c_s___r_o_u_t_i_n_g_gaf34398118f6a683a7e295f2fb89c5940.html#gaf34398118f6a683a7e295f2fb89c5940" title="Retrieves the reference(s) of the route(s) currently attached to the given endpoint and stores It int...">Ucs_Rm_GetAttachedRoutes()</a> : This function retrieves the references of the routes attached to the given endpoint.</li>
<li><a class="el" href="group___g___u_c_s___r_o_u_t_i_n_g_ga87a46a3aa0657e13f5884e5a04d16e17.html#ga87a46a3aa0657e13f5884e5a04d16e17" title="Retrieves the ConnectionLabel of the given route.">Ucs_Rm_GetConnectionLabel()</a>: This function retrieves the <code>ConnectionLabel</code> of the given route. </li>
</ul>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">&copy; 2017 Microchip Technology Inc. All rights reserved. <a href="http://www.microchip.com" target="_blank">www.microchip.com</a></li>
  </ul>
</div>
</body>
<!--
Generated on Mon Apr 3 2017 13:52:59 for UNICENS by
Doxygen 1.8.2
-->
<script language="javascript">
<!--
$('#MSearchResults').wrap('<div style="position: absolute; margin-left: 444px;"></div>');
-->
</script>
</html>