stm32f407VE+enc28j60+lwip2.0.2

来源:http://www.cnblogs.com/qiufengmuye/archive/2017/11/23/7887291.html
-Advertisement-
Play Games

407自帶乙太網mac模塊,一般外掛一個PHY晶元就可以實現乙太網物理層;以下是stm32f407VE+enc28j60+lwip2.0.2實現最基本的乙太網通信功能。 1. 新建工程,此處省略1000字。。。2. 在工程目錄下新建一個LWIP文件夾,將lwip-2.0.2.zip解壓,將src文件 ...


  407自帶乙太網mac模塊,一般外掛一個PHY晶元就可以實現乙太網物理層;以下是stm32f407VE+enc28j60+lwip2.0.2實現最基本的乙太網通信功能。

1. 新建工程,此處省略1000字。。。
2. 在工程目錄下新建一個LWIP文件夾,將lwip-2.0.2.zip解壓,將src文件夾裡面的core、include、netif文件夾放到LWIP文件夾下。
在LWIP目錄下新建一個arch文件夾待用。
3. 在\LWIP\arch根目錄下新建cc.h文件,內容如下:

  1 #include "stdio.h"
  2 
  3 typedef unsigned char u8_t;
  4 typedef signed char s8_t;
  5 typedef unsigned short u16_t;
  6 typedef signed short s16_t;
  7 typedef unsigned long u32_t;
  8 typedef signed long s32_t;
  9 
 10 typedef u32_t mem_ptr_t;
 11 
 12 /*************CPU存放數據定義為小段模式******************/
 13 #ifndef BYTE_ORDER
 14 #define BYTE_ORDER LITTLE_ENDIAN
 15 #endif
 16 
 17 /**********使用KEIL/RVMDK開發工具時的巨集定義**************/
 18 //#if defined(__arm__) && defined(__ARMCC_VERSION)
 19 #define PACK_STRUCT_BEGIN __packed
 20 #define PACK_STRUCT_STRUCT 
 21 #define PACK_STRUCT_END
 22 #define PACK_STRUCT_FIELD(x) x
 23 /*---define (sn)printf formatters for these lwip types, for lwip DEBUG/STATS--*/
 24 
 25 #define U16_F "4d"
 26 #define S16_F "4d"
 27 #define X16_F "4x"
 28 #define U32_F "8ld"
 29 #define S32_F "8ld"
 30 #define X32_F "8lx"
 31 
 32 #ifndef LWIP_PLATFORM_ASSERT
 33 #define LWIP_PLATFORM_ASSERT(x) \
 34 do \
 35 { printf("Assertion \"%s\" failed at line %d in %s\n", x, __LINE__, __FILE__); \
 36 } while(0)
 37 #endif
 38 
 39 #ifndef LWIP_PLATFORM_DIAG
 40 #define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0)
 41 #endif
 42 4.在LWIP\include根目錄下新建一個lwipopts.h文件,內容如下:
 43 #ifndef __LWIPOPTS_H__
 44 #define __LWIPOPTS_H__
 45 
 46 /**
 47 * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain
 48 * critical regions during buffer allocation, deallocation and memory
 49 * allocation and deallocation.
 50 */
 51 #define SYS_LIGHTWEIGHT_PROT 0
 52 
 53 /**
 54 * NO_SYS==1: Provides VERY minimal functionality. Otherwise,
 55 * use lwIP facilities.
 56 */
 57 #define NO_SYS 1 // 無操作系統
 58 /**
 59 * NO_SYS_NO_TIMERS==1: Drop support for sys_timeout when NO_SYS==1
 60 * Mainly for compatibility to old versions.
 61 */
 62 #define NO_SYS_NO_TIMERS 1 // 這樣就不需要定義sys_now函數
 63 
 64 /* ---------- Memory options ---------- */
 65 /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which
 66 lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
 67 byte alignment -> define MEM_ALIGNMENT to 2. */
 68 #define MEM_ALIGNMENT 4
 69 
 70 /* MEM_SIZE: the size of the heap memory. If the application will send
 71 a lot of data that needs to be copied, this should be set high. */
 72 #define MEM_SIZE (5 * 1024)
 73 
 74 /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
 75 sends a lot of data out of ROM (or other static memory), this
 76 should be set high. */
 77 #define MEMP_NUM_PBUF 10
 78 /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
 79 per active UDP "connection". */
 80 #define MEMP_NUM_UDP_PCB 6
 81 /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
 82 connections. */
 83 #define MEMP_NUM_TCP_PCB 10
 84 /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
 85 connections. */
 86 #define MEMP_NUM_TCP_PCB_LISTEN 6
 87 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
 88 segments. */
 89 #define MEMP_NUM_TCP_SEG 12
 90 /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active
 91 timeouts. */
 92 #define MEMP_NUM_SYS_TIMEOUT 3
 93 
 94 /* ---------- Pbuf options ---------- */
 95 /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
 96 #define PBUF_POOL_SIZE 10
 97 
 98 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
 99 #define PBUF_POOL_BUFSIZE 1500
100 
101 /* ---------- TCP options ---------- */
102 #define LWIP_TCP 1
103 #define TCP_TTL 255
104 
105 /* Controls if TCP should queue segments that arrive out of
106 order. Define to 0 if your device is low on memory. */
107 #define TCP_QUEUE_OOSEQ 0
108 
109 /* TCP Maximum segment size. */
110 #define TCP_MSS (1500 - 40) /* TCP_MSS = (Ethernet MTU - IP header size - TCP header size) */
111 
112 /* TCP sender buffer space (bytes). */
113 #define TCP_SND_BUF (2 * TCP_MSS)
114 
115 /* TCP sender buffer space (pbufs). This must be at least = 2 *
116 TCP_SND_BUF/TCP_MSS for things to work. */
117 #define TCP_SND_QUEUELEN (6 * TCP_SND_BUF) / TCP_MSS
118 
119 /* TCP receive window. */
120 #define TCP_WND (2 * TCP_MSS)
121 
122 /* ---------- ICMP options ---------- */
123 #define LWIP_ICMP 1
124 
125 /* ---------- DHCP options ---------- */
126 /* Define LWIP_DHCP to 1 if you want DHCP configuration of
127 interfaces. DHCP is not implemented in lwIP 0.5.1, however, so
128 turning this on does currently not work. */
129 #define LWIP_DHCP 0
130 
131 /* ---------- UDP options ---------- */
132 #define LWIP_UDP 1
133 #define UDP_TTL 255
134 
135 /* ---------- Statistics options ---------- */
136 #define LWIP_STATS 0
137 #define LWIP_PROVIDE_ERRNO 1
138 
139 // LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
140 #define LWIP_NETCONN 0
141 
142 // LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
143 #define LWIP_SOCKET 0
144 
145 // 這個必須要定義, 否則在執行lwip_init函數時會在串口中提示:
146 // Assertion "Struct packing not implemented correctly. Check your lwIP port." failed at line 345 in Library\lwip\core\init.c
147 #define PACK_STRUCT_BEGIN __packed
148 /*******************************************************************************************************************/
149 #define LWIP_DEBUG 1
150 #define LWIP_DBG_TYPES_ON LWIP_DBG_OFF
151 
152 /**
153 * ETHARP_DEBUG: Enable debugging in etharp.c.
154 */
155 #define ETHARP_DEBUG LWIP_DBG_OFF
156 
157 /**
158 * NETIF_DEBUG: Enable debugging in netif.c.
159 */
160 #define NETIF_DEBUG LWIP_DBG_OFF
161 
162 /**
163 * PBUF_DEBUG: Enable debugging in pbuf.c.
164 */
165 #define PBUF_DEBUG LWIP_DBG_OFF
166 
167 /**
168 * API_LIB_DEBUG: Enable debugging in api_lib.c.
169 */
170 #define API_LIB_DEBUG LWIP_DBG_OFF
171 
172 /**
173 * API_MSG_DEBUG: Enable debugging in api_msg.c.
174 */
175 #define API_MSG_DEBUG LWIP_DBG_OFF
176 
177 /**
178 * SOCKETS_DEBUG: Enable debugging in sockets.c.
179 */
180 #define SOCKETS_DEBUG LWIP_DBG_OFF
181 
182 /**
183 * ICMP_DEBUG: Enable debugging in icmp.c.
184 */
185 #define ICMP_DEBUG LWIP_DBG_OFF
186 
187 /**
188 * IGMP_DEBUG: Enable debugging in igmp.c.
189 */
190 #define IGMP_DEBUG LWIP_DBG_OFF
191 
192 /**
193 * INET_DEBUG: Enable debugging in inet.c.
194 */
195 #define INET_DEBUG LWIP_DBG_OFF
196 
197 /**
198 * IP_DEBUG: Enable debugging for IP.
199 */
200 #define IP_DEBUG LWIP_DBG_OFF
201 
202 /**
203 * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass.
204 */
205 #define IP_REASS_DEBUG LWIP_DBG_OFF
206 /**
207 * RAW_DEBUG: Enable debugging in raw.c.
208 */
209 #define RAW_DEBUG LWIP_DBG_OFF
210 
211 /**
212 * MEM_DEBUG: Enable debugging in mem.c.
213 */
214 #define MEM_DEBUG LWIP_DBG_OFF
215 
216 /**
217 * MEMP_DEBUG: Enable debugging in memp.c.
218 */
219 #define MEMP_DEBUG LWIP_DBG_OFF
220 
221 /**
222 * SYS_DEBUG: Enable debugging in sys.c.
223 */
224 #define SYS_DEBUG LWIP_DBG_OFF
225 
226 /**
227 * TCP_DEBUG: Enable debugging for TCP.
228 */
229 #define TCP_DEBUG LWIP_DBG_OFF
230 
231 /**
232 * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug.
233 */
234 #define TCP_INPUT_DEBUG LWIP_DBG_OFF
235 /**
236 * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit.
237 */
238 #define TCP_FR_DEBUG LWIP_DBG_OFF
239 
240 /**
241 * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit
242 * timeout.
243 */
244 #define TCP_RTO_DEBUG LWIP_DBG_OFF
245 
246 /**
247 * TCP_CWND_DEBUG: Enable debugging for TCP congestion window.
248 */
249 #define TCP_CWND_DEBUG LWIP_DBG_OFF
250 
251 /**
252 * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating.
253 */
254 #define TCP_WND_DEBUG LWIP_DBG_OFF
255 
256 /**
257 * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions.
258 */
259 #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF
260 /**
261 * TCP_RST_DEBUG: Enable debugging for TCP with the RST message.
262 */
263 #define TCP_RST_DEBUG LWIP_DBG_OFF
264 
265 /**
266 * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths.
267 */
268 #define TCP_QLEN_DEBUG LWIP_DBG_OFF
269 
270 /**
271 * UDP_DEBUG: Enable debugging in UDP.
272 */
273 #define UDP_DEBUG LWIP_DBG_OFF
274 
275 /**
276 * TCPIP_DEBUG: Enable debugging in tcpip.c.
277 */
278 #define TCPIP_DEBUG LWIP_DBG_OFF
279 
280 /**
281 * PPP_DEBUG: Enable debugging for PPP.
282 */
283 #define PPP_DEBUG LWIP_DBG_OFF
284 
285 /**
286 * SLIP_DEBUG: Enable debugging in slipif.c.
287 */
288 #define SLIP_DEBUG LWIP_DBG_OFF
289 
290 /**
291 * DHCP_DEBUG: Enable debugging in dhcp.c.
292 */
293 #define DHCP_DEBUG LWIP_DBG_OFF
294 
295 /**
296 * AUTOIP_DEBUG: Enable debugging in autoip.c.
297 */
298 #define AUTOIP_DEBUG LWIP_DBG_OFF
299 
300 /**
301 * SNMP_MSG_DEBUG: Enable debugging for SNMP messages.
302 */
303 #define SNMP_MSG_DEBUG LWIP_DBG_OFF
304 
305 /**
306 * SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs.
307 */
308 #define SNMP_MIB_DEBUG LWIP_DBG_OFF
309 
310 /**
311 * DNS_DEBUG: Enable debugging for DNS.
312 */
313 #define DNS_DEBUG LWIP_DBG_OFF
314 #endif /* __LWIPOPTS_H__ */
cc.h

4.在LWIP\include根目錄下新建一個lwipopts.h文件,內容如下:

  1 #ifndef __LWIPOPTS_H__
  2 #define __LWIPOPTS_H__
  3 
  4 /**
  5 * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain
  6 * critical regions during buffer allocation, deallocation and memory
  7 * allocation and deallocation.
  8 */
  9 #define SYS_LIGHTWEIGHT_PROT 0
 10 
 11 /**
 12 * NO_SYS==1: Provides VERY minimal functionality. Otherwise,
 13 * use lwIP facilities.
 14 */
 15 #define NO_SYS 1 // 無操作系統
 16 /**
 17 * NO_SYS_NO_TIMERS==1: Drop support for sys_timeout when NO_SYS==1
 18 * Mainly for compatibility to old versions.
 19 */
 20 #define NO_SYS_NO_TIMERS 1 // 這樣就不需要定義sys_now函數
 21 
 22 /* ---------- Memory options ---------- */
 23 /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which
 24 lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
 25 byte alignment -> define MEM_ALIGNMENT to 2. */
 26 #define MEM_ALIGNMENT 4
 27 
 28 /* MEM_SIZE: the size of the heap memory. If the application will send
 29 a lot of data that needs to be copied, this should be set high. */
 30 #define MEM_SIZE (5 * 1024)
 31 
 32 /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
 33 sends a lot of data out of ROM (or other static memory), this
 34 should be set high. */
 35 #define MEMP_NUM_PBUF 10
 36 /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
 37 per active UDP "connection". */
 38 #define MEMP_NUM_UDP_PCB 6
 39 /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
 40 connections. */
 41 #define MEMP_NUM_TCP_PCB 10
 42 /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
 43 connections. */
 44 #define MEMP_NUM_TCP_PCB_LISTEN 6
 45 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
 46 segments. */
 47 #define MEMP_NUM_TCP_SEG 12
 48 /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active
 49 timeouts. */
 50 #define MEMP_NUM_SYS_TIMEOUT 3
 51 
 52 /* ---------- Pbuf options ---------- */
 53 /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
 54 #define PBUF_POOL_SIZE 10
 55 
 56 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
 57 #define PBUF_POOL_BUFSIZE 1500
 58 
 59 /* ---------- TCP options ---------- */
 60 #define LWIP_TCP 1
 61 #define TCP_TTL 255
 62 
 63 /* Controls if TCP should queue segments that arrive out of
 64 order. Define to 0 if your device is low on memory. */
 65 #define TCP_QUEUE_OOSEQ 0
 66 
 67 /* TCP Maximum segment size. */
 68 #define TCP_MSS (1500 - 40) /* TCP_MSS = (Ethernet MTU - IP header size - TCP header size) */
 69 
 70 /* TCP sender buffer space (bytes). */
 71 #define TCP_SND_BUF (2 * TCP_MSS)
 72 
 73 /* TCP sender buffer space (pbufs). This must be at least = 2 *
 74 TCP_SND_BUF/TCP_MSS for things to work. */
 75 #define TCP_SND_QUEUELEN (6 * TCP_SND_BUF) / TCP_MSS
 76 
 77 /* TCP receive window. */
 78 #define TCP_WND (2 * TCP_MSS)
 79 
 80 /* ---------- ICMP options ---------- */
 81 #define LWIP_ICMP 1
 82 
 83 /* ---------- DHCP options ---------- */
 84 /* Define LWIP_DHCP to 1 if you want DHCP configuration of
 85 interfaces. DHCP is not implemented in lwIP 0.5.1, however, so
 86 turning this on does currently not work. */
 87 #define LWIP_DHCP 0
 88 
 89 /* ---------- UDP options ---------- */
 90 #define LWIP_UDP 1
 91 #define UDP_TTL 255
 92 
 93 /* ---------- Statistics options ---------- */
 94 #define LWIP_STATS 0
 95 #define LWIP_PROVIDE_ERRNO 1
 96 
 97 // LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
 98 #define LWIP_NETCONN 0
 99 
100 // LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
101 #define LWIP_SOCKET 0
102 
103 // 這個必須要定義, 否則在執行lwip_init函數時會在串口中提示:
104 // Assertion "Struct packing not implemented correctly. Check your lwIP port." failed at line 345 in Library\lwip\core\init.c
105 #define PACK_STRUCT_BEGIN __packed
106 /*******************************************************************************************************************/
107 #define LWIP_DEBUG 1
108 #define LWIP_DBG_TYPES_ON LWIP_DBG_OFF
109 
110 /**
111 * ETHARP_DEBUG: Enable debugging in etharp.c.
112 */
113 #define ETHARP_DEBUG LWIP_DBG_OFF
114 
115 /**
116 * NETIF_DEBUG: Enable debugging in netif.c.
117 */
118 #define NETIF_DEBUG LWIP_DBG_OFF
119 
120 /**
121 * PBUF_DEBUG: Enable debugging in pbuf.c.
122 */
123 #define PBUF_DEBUG LWIP_DBG_OFF
124 
125 /**
126 * API_LIB_DEBUG: Enable debugging in api_lib.c.
127 */
128 #define API_LIB_DEBUG LWIP_DBG_OFF
129 
130 /**
131 * API_MSG_DEBUG: Enable debugging in api_msg.c.
132 */
133 #define API_MSG_DEBUG LWIP_DBG_OFF
134 
135 /**
136 * SOCKETS_DEBUG: Enable debugging in sockets.c.
137 */
138 #define SOCKETS_DEBUG LWIP_DBG_OFF
139 
140 /**
141 * ICMP_DEBUG: Enable debugging in icmp.c.
142 */
143 #define ICMP_DEBUG LWIP_DBG_OFF
144 
145 /**
146 * IGMP_DEBUG: Enable debugging in igmp.c.
147 */
148 #define IGMP_DEBUG LWIP_DBG_OFF
149 
150 /**
151 * INET_DEBUG: Enable debugging in inet.c.
152 */
153 #define INET_DEBUG LWIP_DBG_OFF
154 
155 /**
156 * IP_DEBUG: Enable debugging for IP.
157 */
158 #define IP_DEBUG LWIP_DBG_OFF
159 
160 /**
161 * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass.
162 */
163 #define IP_REASS_DEBUG LWIP_DBG_OFF
164 /**
165 * RAW_DEBUG: Enable debugging in raw.c.
166 */
167 #define RAW_DEBUG LWIP_DBG_OFF
168 
169 /**
170 * MEM_DEBUG: Enable debugging in mem.c.
171 */
172 #define MEM_DEBUG LWIP_DBG_OFF
173 
174 /**
175 * MEMP_DEBUG: Enable debugging in memp.c.
176 */
177 #define MEMP_DEBUG LWIP_DBG_OFF
178 
179 /**
180 * SYS_DEBUG: Enable debugging in sys.c.
181 */
182 #define SYS_DEBUG LWIP_DBG_OFF
183 
184 /**
185 * TCP_DEBUG: Enable debugging for TCP.
186 */
187 #define TCP_DEBUG LWIP_DBG_OFF
188 
189 /**
190 * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug.
191 */
192 #define TCP_INPUT_DEBUG LWIP_DBG_OFF
193 /**
194 * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit.
195 */
196 #define TCP_FR_DEBUG LWIP_DBG_OFF
197 
198 /**
199 * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit
200 * timeout.
201 */
202 #define TCP_RTO_DEBUG LWIP_DBG_OFF
203 
204 /**
205 * TCP_CWND_DEBUG: Enable debugging for TCP congestion window.
206 */
207 #define TCP_CWND_DEBUG LWIP_DBG_OFF
208 
209 /**
210 * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating.
211 */
212 #define TCP_WND_DEBUG LWIP_DBG_OFF
213 
214 /**
215 * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions.
216 */
217 #define TCP_OUTPUT_DEBUG LWIP_DBG_OFF
218 /**
219 * TCP_RST_DEBUG: Enable debugging for TCP with the RST message.
220 */
221 #define TCP_RST_DEBUG LWIP_DBG_OFF
222 
223 /**
224 * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths.
225 */
226 #define TCP_QLEN_DEBUG LWIP_DBG_OFF
227 
228 /**
229 * UDP_DEBUG: Enable debugging in UDP.
230 */
231 #define UDP_DEBUG LWIP_DBG_OFF
232 
233 /**
234 * TCPIP_DEBUG: Enable debugging in tcpip.c.
235 */
236 #define TCPIP_DEBUG LWIP_DBG_OFF
237 
238 /**
239 * PPP_DEBUG: Enable debugging for PPP.
240 */
241 #define PPP_DEBUG LWIP_DBG_OFF
242 
243 /**
244 * SLIP_DEBUG: Enable debugging in slipif.c.
245 */
246 #define SLIP_DEBUG LWIP_DBG_OFF
247 
248 /**
249 * DHCP_DEBUG: Enable debugging in dhcp.c.
250 */
251 #define DHCP_DEBUG LWIP_DBG_OFF
252 
253 /**
254 * AUTOIP_DEBUG: Enable debugging in autoip.c.
255 */
256 #define AUTOIP_DEBUG LWIP_DBG_OFF
257 
258 /**
259 * SNMP_MSG_DEBUG: Enable debugging for SNMP messages.
260 */
261 #define SNMP_MSG_DEBUG LWIP_DBG_OFF
262 
263 /**
264 * SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs.
265 */
266 #define SNMP_MIB_DEBUG LWIP_DBG_OFF
267 
268 /**
269 * DNS_DEBUG: Enable debugging for DNS.
270 */
271 #define DNS_DEBUG LWIP_DBG_OFF
272 #endif /* __LWIPOPTS_H__ */
lwipopt.h

5.修改\LWIP\netif目錄下的ethernetif.c文件,按中文提示修改:

  1 /**
  2 * @file
  3 * Ethernet Interface Skeleton
  4 *
  5 */
  6 
  7 /*
  8 * Copyright (c) 2001-2004 

您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 這個系列大致想跟大家分享以下篇章(我會持續更新的↖(^ω^)↗): 1、mongo 3.4分片集群系列之一:淺談分片集群 2、mongo 3.4分片集群系列之二:搭建分片集群--哈希分片 3、mongo 3.4分片集群系列之三:搭建分片集群--哈希分片 + 安全 4、mongo 3.4分片集群系列之 ...
  • 直接上例子,即SQL語法: DECLARE @Text NVARCHAR(MAX) = N'192 168-0 101 34--96' WHILE (CHARINDEX('--',@Text) <> 0) SET @Text = REPLACE(@Text,'--','-') SELECT @Tex ...
  • HiveServer2是經常與beeline一起使用,可以用jdbc客戶端遠程連接,一般用於生產環境。 在提供傳統客服端的功能之外,還提供其他功能。 Beeline連接 啟動命令:HiveServer2 啟動日誌在hive.log中查看 命令: Beeline !connect jdbc:hive2 ...
  • 有朋友需求一個問題,就是處理一張表中某一欄位,從這個欄位中去截取內容中最後一個中文詞語。 ID SourceText Result 1 張達:U:1楊英蘋:U:1,周忱:U:1,;苗橋:U:1,章瑋:U:1,; 2 gaoying,高穎:U; 3 gaoying,高穎:U; 4 mq,苗橋;ding ...
  • 1、創建項目:File-->new-->Project; 2、選擇maven,SDK選擇自己的Java安裝路徑; 3、這個隨意了,寫個比較有意義的就行,然後就按照圖片操作。 4、上圖點擊finish後,出現下麵的pom.xml,這個就是後續需要mvn依賴的地方。 5、我的hadoop版本是:CDH的 ...
  • 查詢結果: ...
  • 死鎖是指多個進程(線程)因為長久等待已被其他進程占有的的資源而陷入阻塞的一種狀態。當等待的資源一直得不到釋放,死鎖會一直持續下去。死鎖一旦發生,程式本身是解決不了的,只能依靠外部力量使得程式恢復運行,例如重啟,開門狗複位等。 所以內核中設計了內核死鎖檢測機制,一旦發現死鎖進程,就重啟OS,快刀斬亂麻 ...
  • 第1章 sed命令詳解 1.1 查找固定的某一行 1.1.1 awk命令方法 1.1.2 grep方法 1.1.3 sed方法 1.2 sed的替換 s為 sub(substitute)替換 g global 表示全局替換 1.2.1 將oldboy替換程oldboyedu &表示前面找到的東西。 ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...