agl-service-unicens: robustess measure for tx msg
[apps/agl-service-unicens.git] / ucs2-lib / cfg_agl / ucs_cfg.h
1 /*------------------------------------------------------------------------------------------------*/
2 /* UNICENS V2.1.0-3564                                                                            */
3 /* Copyright 2017, Microchip Technology Inc. and its subsidiaries.                                */
4 /*                                                                                                */
5 /* Redistribution and use in source and binary forms, with or without                             */
6 /* modification, are permitted provided that the following conditions are met:                    */
7 /*                                                                                                */
8 /* 1. Redistributions of source code must retain the above copyright notice, this                 */
9 /*    list of conditions and the following disclaimer.                                            */
10 /*                                                                                                */
11 /* 2. Redistributions in binary form must reproduce the above copyright notice,                   */
12 /*    this list of conditions and the following disclaimer in the documentation                   */
13 /*    and/or other materials provided with the distribution.                                      */
14 /*                                                                                                */
15 /* 3. Neither the name of the copyright holder nor the names of its                               */
16 /*    contributors may be used to endorse or promote products derived from                        */
17 /*    this software without specific prior written permission.                                    */
18 /*                                                                                                */
19 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"                    */
20 /* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE                      */
21 /* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE                 */
22 /* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE                   */
23 /* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL                     */
24 /* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR                     */
25 /* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER                     */
26 /* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,                  */
27 /* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE                  */
28 /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                           */
29 /*------------------------------------------------------------------------------------------------*/
30
31 #ifndef UCS_CFG_H
32 #define UCS_CFG_H
33
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38
39 /*------------------------------------------------------------------------------------------------*/
40 /* Includes                                                                                       */
41 /*------------------------------------------------------------------------------------------------*/
42 #include "ucs_types_cfg.h"
43
44 /*------------------------------------------------------------------------------------------------*/
45 /* Multi Instance API                                                                             */
46 /*------------------------------------------------------------------------------------------------*/
47 /* Number of API instances which can be created by function Ucs_CreateInstance().
48  * One API instance is used to communicate with one local INIC. In this case the application
49  * is connected to one network.
50  * It is possible access multiple networks by having multiple API instances. Each API instance
51  * requires communication with an exclusive INIC.
52  * Valid range: 1..10. Default value: 1.
53  */
54 #define UCS_NUM_INSTANCES                2
55
56 /*------------------------------------------------------------------------------------------------*/
57 /* Resources Management                                                                           */
58 /*------------------------------------------------------------------------------------------------*/
59 /* Maximum number of remote devices used by Resources Management modules.
60  * Valid range: 0..63. Default value: 0.
61  */
62 #define UCS_NUM_REMOTE_DEVICES            63
63
64 /*------------------------------------------------------------------------------------------------*/
65 /* Application Messages                                                                           */
66 /*------------------------------------------------------------------------------------------------*/
67 /* Defines the number of reserved Rx message objects.
68  * Valid values: 5..255. Default value: 20.
69  */
70 #define UCS_AMS_NUM_RX_MSGS              20
71
72 /* Defines the payload size in bytes which is available for every Rx message object.
73  * Valid values: 45..65535. Default value: 45.
74  */
75 #define UCS_AMS_SIZE_RX_MSG              512
76
77 /* Defines the number of reserved Tx message objects.
78  * Valid values: 5..255. Default value: 20.
79  */
80 #define UCS_AMS_NUM_TX_MSGS              20
81
82 /* Defines the payload size in bytes which is available for every Tx message object.
83  * Valid values: 45..65535. Default value: 45.
84  */
85 #define UCS_AMS_SIZE_TX_MSG              UCS_AMS_SIZE_RX_MSG
86
87 /*------------------------------------------------------------------------------------------------*/
88 /* Memory Optimization                                                                            */
89 /*------------------------------------------------------------------------------------------------*/
90 /* Define the following macros to reduces the RAM and ROM size of the UNICENS software by disabling
91  * certain features. If this macro is defined the following changes apply:
92  * - Reduction of low-level buffers
93  * - AMS does not support segmentation (payload > 45 bytes)
94  */
95 /* #define UCS_FOOTPRINT_TINY */
96
97 /*------------------------------------------------------------------------------------------------*/
98 /* Tracing & Debugging                                                                            */
99 /*------------------------------------------------------------------------------------------------*/
100 /* Define the following macros to map info and error trace output to user defined functions.
101  * The purpose of these functions is debugging. It is not recommended to define these functions
102  * in a production system.
103  */
104  #define UCS_TR_ERROR     App_TraceError
105  /*#define UCS_TR_INFO      App_TraceInfo*/
106
107 extern void App_TraceError(void *ucs_user_ptr, const char module_str[], const char entry_str[], uint16_t vargs_cnt, ...);
108 extern void App_TraceInfo(void *ucs_user_ptr, const char module_str[], const char entry_str[], uint16_t vargs_cnt, ...);
109
110 #ifdef __cplusplus
111 }
112 #endif
113
114 #endif /* UCS_CFG_H */
115
116 /*------------------------------------------------------------------------------------------------*/
117 /* End of file                                                                                    */
118 /*------------------------------------------------------------------------------------------------*/
119