Net_Config.c
4.15 KB
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
/*------------------------------------------------------------------------------
* MDK Middleware - Component ::Network
* Copyright (c) 2004-2019 Arm Limited (or its affiliates). All rights reserved.
*------------------------------------------------------------------------------
* Name: Net_Config.c
* Purpose: Network Configuration
* Rev.: V7.1.0
*----------------------------------------------------------------------------*/
//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
// <h>Network System Settings
// <i>Global Network System definitions
// <s.15>Local Host Name
// <i>This is the name under which embedded host can be
// <i>accessed on a local area network.
// <i>Default: "my_host"
#define NET_HOST_NAME "my_host"
// <o>Memory Pool Size <1536-262144:4>
// <i>This is the size of a memory pool in bytes. Buffers for
// <i>network packets are allocated from this memory pool.
// <i>Default: 12000 bytes
#define NET_MEM_POOL_SIZE 12000
// <q>Start System Services
// <i>If enabled, the system will automatically start server services
// <i>(HTTP, FTP, TFTP server, ...) when initializing the network system.
// <i>Default: Enabled
#define NET_START_SERVICE 1
// <h>OS Resource Settings
// <i>These settings are used to optimize usage of OS resources.
// <o>Core Thread Stack Size <512-65535:4>
// <i>Default: 1024 bytes
#define NET_THREAD_STACK_SIZE 1024
// Core Thread Priority
#define NET_THREAD_PRIORITY osPriorityNormal
// </h>
// </h>
//------------- <<< end of configuration section >>> ---------------------------
#include "RTE_Components.h"
#ifdef RTE_Network_Interface_ETH_0
#include "Net_Config_ETH_0.h"
#endif
#ifdef RTE_Network_Interface_ETH_1
#include "Net_Config_ETH_1.h"
#endif
#ifdef RTE_Network_Interface_WiFi_0
#include "Net_Config_WiFi_0.h"
#endif
#ifdef RTE_Network_Interface_WiFi_1
#include "Net_Config_WiFi_1.h"
#endif
#ifdef RTE_Network_Interface_PPP
#include "Net_Config_PPP.h"
#endif
#ifdef RTE_Network_Interface_SLIP
#include "Net_Config_SLIP.h"
#endif
#ifdef RTE_Network_Socket_UDP
#include "Net_Config_UDP.h"
#endif
#ifdef RTE_Network_Socket_TCP
#include "Net_Config_TCP.h"
#endif
#ifdef RTE_Network_Socket_BSD
#include "Net_Config_BSD.h"
#endif
#ifdef RTE_Network_Web_Server_RO
#include "Net_Config_HTTP_Server.h"
#endif
#ifdef RTE_Network_Web_Server_FS
#include "Net_Config_HTTP_Server.h"
#endif
#ifdef RTE_Network_Telnet_Server
#include "Net_Config_Telnet_Server.h"
#endif
#ifdef RTE_Network_TFTP_Server
#include "Net_Config_TFTP_Server.h"
#endif
#ifdef RTE_Network_TFTP_Client
#include "Net_Config_TFTP_Client.h"
#endif
#ifdef RTE_Network_FTP_Server
#include "Net_Config_FTP_Server.h"
#endif
#ifdef RTE_Network_FTP_Client
#include "Net_Config_FTP_Client.h"
#endif
#ifdef RTE_Network_DNS_Client
#include "Net_Config_DNS_Client.h"
#endif
#ifdef RTE_Network_SMTP_Client
#include "Net_Config_SMTP_Client.h"
#endif
#ifdef RTE_Network_SNMP_Agent
#include "Net_Config_SNMP_Agent.h"
#endif
#ifdef RTE_Network_SNTP_Client
#include "Net_Config_SNTP_Client.h"
#endif
#include "net_config.h"
/**
\addtogroup net_genFunc
@{
*/
/**
\fn void net_sys_error (NET_ERROR error)
\ingroup net_cores
\brief Network system error handler.
*/
void net_sys_error (NET_ERROR error) {
/* This function is called when a fatal error is encountered. */
/* The normal program execution is not possible anymore. */
switch (error) {
case NET_ERROR_MEM_ALLOC:
/* Out of memory */
break;
case NET_ERROR_MEM_FREE:
/* Trying to release non existing memory block */
break;
case NET_ERROR_MEM_CORRUPT:
/* Memory Link pointer corrupted */
/* More data written than the size of allocated memory block */
break;
case NET_ERROR_CONFIG:
/* Network configuration error detected */
break;
case NET_ERROR_UDP_ALLOC:
/* Out of UDP Sockets */
break;
case NET_ERROR_TCP_ALLOC:
/* Out of TCP Sockets */
break;
case NET_ERROR_TCP_STATE:
/* TCP State machine in undefined state */
break;
}
/* End-less loop */
while (1);
}
/**
@}
*/