当前位置: 首页 > news >正文

4G PPP模式与以太网接口在LwIP中的融合应用

复制代码另存为html文件 打开即可
全部由AI工具产生 此博客只是为了记录 以方便查阅

<!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>4G PPP模式与以太网接口在LwIP中的融合应用</title><script src="https://cdn.tailwindcss.com"></script><link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet"><script>tailwind.config = {theme: {extend: {colors: {primary: '#2c3e50',secondary: '#3498db',accent: '#e74c3c',success: '#27ae60',dark: '#34495e',light: '#ecf0f1',code: '#2d2d2d'},fontFamily: {sans: ['Segoe UI', 'Tahoma', 'Geneva', 'Verdana', 'sans-serif'],mono: ['Fira Code', 'Consolas', 'monospace']}}}}</script><style type="text/tailwindcss">@layer utilities {.content-auto {content-visibility: auto;}.text-shadow {text-shadow: 0 2px 4px rgba(0,0,0,0.1);}.card-hover {transition: transform 0.3s ease, box-shadow 0.3s ease;}.card-hover:hover {transform: translateY(-5px);box-shadow: 0 10px 20px rgba(0,0,0,0.08);}.gradient-bg {background: linear-gradient(135deg, var(--tw-gradient-stops));}.code-block {@apply bg-code text-white p-5 rounded-lg overflow-x-auto font-mono text-sm leading-relaxed;}.section-header {@apply text-primary font-bold text-2xl mb-6 pb-3 border-b-2 border-secondary;}.comparison-card {@apply bg-light rounded-lg p-6 border-t-4 card-hover;}.performance-card {@apply bg-white rounded-lg p-6 shadow-md border-t-4 text-center;}}</style>
</head>
<body class="bg-gray-50 text-gray-800 font-sans"><!-- 导航栏 --><nav class="fixed w-full bg-primary/95 text-white z-50 transition-all duration-300 shadow-md"><div class="container mx-auto px-4 py-3 flex justify-between items-center"><div class="flex items-center space-x-2"><i class="fa fa-ethernet text-secondary text-xl"></i><span class="font-bold text-xl">嵌入式网络技术</span></div><div class="hidden md:flex space-x-6"><a href="#introduction" class="hover:text-secondary transition-colors">概述</a><a href="#comparison" class="hover:text-secondary transition-colors">技术对比</a><a href="#scenarios" class="hover:text-secondary transition-colors">适用场景</a><a href="#porting" class="hover:text-secondary transition-colors">移植实现</a><a href="#application" class="hover:text-secondary transition-colors">上层应用</a><a href="#integration" class="hover:text-secondary transition-colors">双模式融合</a><a href="#performance" class="hover:text-secondary transition-colors">性能对比</a></div><button class="md:hidden text-white text-xl"><i class="fa fa-bars"></i></button></div></nav><!-- 头部区域 --><header class="pt-24 pb-16 gradient-bg from-primary to-dark text-white text-center shadow-lg"><div class="container mx-auto px-4"><h1 class="text-[clamp(2rem,5vw,3.5rem)] font-bold mb-4 text-shadow">4G PPP模式与以太网接口在LwIP中的融合应用</h1><p class="text-[clamp(1rem,2vw,1.25rem)] opacity-90 max-w-3xl mx-auto">基于FreeRTOS的嵌入式网络解决方案 - 技术对比、移植实现与上层应用</p></div></header><!-- 主要内容 --><main class="container mx-auto px-4 py-12"><!-- 技术概述 --><section id="introduction" class="bg-white rounded-xl shadow-sm p-8 mb-10 transform transition-all duration-500 hover:shadow-md"><h2 class="section-header">技术概述</h2><p class="mb-4">在嵌入式系统中,将4G PPP模式与以太网接口(ETH)集成到LwIP协议栈中,可以创建灵活强大的网络解决方案。本文详细分析两者的技术差异、适用场景、移植方法以及上层应用实现。</p><p>这两种接入方式均基于LwIP协议栈实现TCP/IP网络功能,运行在FreeRTOS实时操作系统上,但在物理层实现、性能特性和适用场景上有显著区别。</p></section><!-- 技术对比 --><section id="comparison" class="bg-white rounded-xl shadow-sm p-8 mb-10 transform transition-all duration-500 hover:shadow-md"><h2 class="section-header">技术对比</h2><div class="grid grid-cols-1 md:grid-cols-2 gap-6 mt-6"><div class="comparison-card border-t-accent"><h3 class="text-xl font-bold text-dark mb-4">4G PPP模式</h3><ul class="space-y-2"><li><strong>物理层:</strong>无线蜂窝网络 (4G LTE)</li><li><strong>数据链路层:</strong>PPP协议 (串行链路封装)</li><li><strong>硬件接口:</strong>UART/USB串口</li><li><strong>IP获取:</strong>动态IP (PPP拨号分配)</li><li><strong>带宽/延迟:</strong>5-50Mbps, 30-100ms</li><li><strong>功耗:</strong>中 (射频功耗)</li><li><strong>移动性:</strong>支持移动场景</li></ul></div><div class="comparison-card border-t-success"><h3 class="text-xl font-bold text-dark mb-4">以太网接口</h3><ul class="space-y-2"><li><strong>物理层:</strong>有线以太网 (IEEE 802.3)</li><li><strong>数据链路层:</strong>Ethernet MAC帧</li><li><strong>硬件接口:</strong>RMII/MII + PHY芯片</li><li><strong>IP获取:</strong>DHCP/静态IP</li><li><strong>带宽/延迟:</strong>10/100/1000Mbps, &lt;1ms</li><li><strong>功耗:</strong>低 (物理层传输)</li><li><strong>移动性:</strong>固定位置</li></ul></div></div><h3 class="text-xl font-bold text-secondary mt-8 mb-4">相同点</h3><ul class="space-y-2 pl-4 list-disc"><li><strong>协议栈统一性:</strong>两者均基于LwIP协议栈实现TCP/IP网络功能</li><li><strong>操作系统支持:</strong>均运行在FreeRTOS实时操作系统上</li><li><strong>网络功能一致性:</strong>支持相同的传输层协议(TCP/UDP)和应用层协议(HTTP/MQTT/DNS)</li><li><strong>IP层管理:</strong>使用相同的IP路由机制和数据包处理流程</li></ul></section><!-- 适用场景对比 --><section id="scenarios" class="bg-white rounded-xl shadow-sm p-8 mb-10 transform transition-all duration-500 hover:shadow-md"><h2 class="section-header">适用场景对比</h2><div class="overflow-x-auto"><table class="w-full min-w-[640px] border-collapse"><thead><tr class="bg-primary text-white"><th class="px-6 py-4 text-left">应用场景</th><th class="px-6 py-4 text-left">推荐方案</th><th class="px-6 py-4 text-left">理由</th></tr></thead><tbody><tr class="hover:bg-gray-50 transition-colors"><td class="px-6 py-4">移动设备(车载/无人机)</td><td class="px-6 py-4">4G PPP模式</td><td class="px-6 py-4">支持移动通信,无需固定网络接入点</td></tr><tr class="hover:bg-gray-50 transition-colors"><td class="px-6 py-4">野外监测站/临时部署设备</td><td class="px-6 py-4">4G PPP模式</td><td class="px-6 py-4">在无网络基础设施环境下提供可靠连接</td></tr><tr class="hover:bg-gray-50 transition-colors"><td class="px-6 py-4">工业固定设备(PLC控制器)</td><td class="px-6 py-4">以太网接口</td><td class="px-6 py-4">提供高速、稳定的数据传输能力</td></tr><tr class="hover:bg-gray-50 transition-colors"><td class="px-6 py-4">机器视觉系统/视频监控</td><td class="px-6 py-4">以太网接口</td><td class="px-6 py-4">高带宽支持视频流传输</td></tr><tr class="hover:bg-gray-50 transition-colors"><td class="px-6 py-4">灾备冗余链路</td><td class="px-6 py-4">双模式融合</td><td class="px-6 py-4">以太网为主链路,4G PPP为备份提供冗余</td></tr></tbody></table></div></section><!-- LwIP移植实现 --><section id="porting" class="bg-white rounded-xl shadow-sm p-8 mb-10 transform transition-all duration-500 hover:shadow-md"><h2 class="section-header">LwIP移植实现(FreeRTOS环境)</h2><h3 class="text-xl font-bold text-secondary mt-6 mb-4">4G PPP模式移植</h3><div class="mb-8"><div class="bg-gray-800 text-gray-300 px-4 py-2 rounded-t-lg flex justify-between items-center"><span class="font-mono">lwipopts.h 配置</span><button class="text-xs bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded transition-colors"><i class="fa fa-copy mr-1"></i>复制</button></div><div class="code-block"><pre>#define PPP_SUPPORT 1
#define PPPOS_SUPPORT 1
#define PAP_SUPPORT 1
#define MEM_SIZE (16*1024)  // 16KB RAM</pre></div></div><div class="mb-8"><div class="bg-gray-800 text-gray-300 px-4 py-2 rounded-t-lg flex justify-between items-center"><span class="font-mono">ppp_driver.c - PPP驱动实现</span><button class="text-xs bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded transition-colors"><i class="fa fa-copy mr-1"></i>复制</button></div><div class="code-block"><pre>#include "lwip/ppp.h"
#include "lwip/netif.h"ppp_pcb *ppp;
struct netif ppp_netif;// PPP数据输出回调
static u32_t ppp_output_cb(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx) {HAL_UART_Transmit(&huart3, data, len, 100);return len;
}// PPP状态回调
static void ppp_link_status_cb(ppp_pcb *pcb, int err_code, void *ctx) {if(err_code == PPPERR_NONE) {printf("PPP Connected! IP: %s\n", ip4addr_ntoa(netif_ip4_addr(&ppp_netif)));}
}// PPP初始化
void PPP_Init(void) {ppp = pppos_create(&ppp_netif, ppp_output_cb, ppp_link_status_cb, NULL);ppp_set_auth(ppp, PPPAUTHTYPE_PAP, "username", "password");ppp_connect(ppp, 0);
}// 串口中断处理
void USART3_IRQHandler(void) {if(__HAL_UART_GET_FLAG(&huart3, UART_FLAG_RXNE)) {uint8_t data = (uint8_t)(huart3.Instance->RDR & 0xFF);pppos_input(ppp, &data, 1); // 数据传入LwIP}HAL_UART_IRQHandler(&huart3);
}</pre></div></div><h3 class="text-xl font-bold text-secondary mt-8 mb-4">以太网接口移植</h3><div class="mb-8"><div class="bg-gray-800 text-gray-300 px-4 py-2 rounded-t-lg flex justify-between items-center"><span class="font-mono">lwipopts.h 配置</span><button class="text-xs bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded transition-colors"><i class="fa fa-copy mr-1"></i>复制</button></div><div class="code-block"><pre>#define LWIP_ARP 1
#define LWIP_ETHERNET 1
#define MEM_SIZE (12*1024)  // 12KB RAM</pre></div></div><div class="mb-8"><div class="bg-gray-800 text-gray-300 px-4 py-2 rounded-t-lg flex justify-between items-center"><span class="font-mono">ethernetif.c - 以太网驱动实现</span><button class="text-xs bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded transition-colors"><i class="fa fa-copy mr-1"></i>复制</button></div><div class="code-block"><pre>#include "lwip/etharp.h"
#include "stm32f7xx_hal_eth.h"extern ETH_HandleTypeDef heth;// 底层数据发送
static err_t low_level_output(struct netif *netif, struct pbuf *p) {struct pbuf *q;uint8_t *buffer = (uint8_t *)heth.TxDesc->Buffer1Addr;for(q = p; q != NULL; q = q->next) {memcpy(buffer, q->payload, q->len);buffer += q->len;}HAL_ETH_TransmitFrame(&heth, p->tot_len);return ERR_OK;
}// ETH接收中断回调
void HAL_ETH_RxCpltCallback(ETH_HandleTypeDef *heth) {struct pbuf *p;p = low_level_input(&eth_netif);if (p != NULL) {if (netif.input(p, &eth_netif) != ERR_OK) {pbuf_free(p);}}
}// 网卡初始化
void ETH_Netif_Init(void) {ip_addr_t ipaddr, netmask, gw;IP4_ADDR(&ipaddr, 192, 168, 1, 10);IP4_ADDR(&netmask, 255, 255, 255, 0);IP4_ADDR(&gw, 192, 168, 1, 1);netif_add(&eth_netif, &ipaddr, &netmask, &gw, NULL, ðernetif_init, &tcpip_input);netif_set_default(&eth_netif);netif_set_up(&eth_netif);
}</pre></div></div></section><!-- 上层应用实现 --><section id="application" class="bg-white rounded-xl shadow-sm p-8 mb-10 transform transition-all duration-500 hover:shadow-md"><h2 class="section-header">上层应用实现(两者通用)</h2><h3 class="text-xl font-bold text-secondary mt-6 mb-4">TCP连接与通信</h3><div class="mb-8"><div class="bg-gray-800 text-gray-300 px-4 py-2 rounded-t-lg flex justify-between items-center"><span class="font-mono">TCP通信实现</span><button class="text-xs bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded transition-colors"><i class="fa fa-copy mr-1"></i>复制</button></div><div class="code-block"><pre>// 创建TCP Socket
int tcp_connect(const char *ip, uint16_t port) {int sock = lwip_socket(AF_INET, SOCK_STREAM, 0);if (sock < 0) return -1;struct sockaddr_in serv_addr;memset(&serv_addr, 0, sizeof(serv_addr));serv_addr.sin_family = AF_INET;serv_addr.sin_port = htons(port);inet_pton(AF_INET, ip, &serv_addr.sin_addr);if (lwip_connect(sock, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) {lwip_close(sock);return -1;}return sock;
}// TCP数据发送
void tcp_send(int sock, const char *data) {lwip_send(sock, data, strlen(data), 0);
}// TCP数据接收
void tcp_receive(int sock) {char buffer[1024];int len = lwip_recv(sock, buffer, sizeof(buffer)-1, 0);if (len > 0) {buffer[len] = '\0';printf("Received: %s\n", buffer);}
}</pre></div></div><h3 class="text-xl font-bold text-secondary mt-8 mb-4">MQTT通信实现</h3><div class="mb-8"><div class="bg-gray-800 text-gray-300 px-4 py-2 rounded-t-lg flex justify-between items-center"><span class="font-mono">MQTT通信实现</span><button class="text-xs bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded transition-colors"><i class="fa fa-copy mr-1"></i>复制</button></div><div class="code-block"><pre>#include "mqtt.h"mqtt_client_t *mqtt_client;// MQTT连接回调
void mqtt_connection_cb(mqtt_client_t *client, void *arg, mqtt_connection_status_t status) {if (status == MQTT_CONNECT_ACCEPTED) {printf("MQTT Connected!\n");// 订阅主题mqtt_subscribe(client, "topic/status", 0, NULL);}
}// 消息接收回调
void mqtt_msg_cb(void *arg, const char *topic, u32_t tot_len) {printf("Message received on topic: %s\n", topic);
}// MQTT初始化
void mqtt_init(void) {mqtt_client = mqtt_client_new();ip_addr_t broker_ip;IP4_ADDR(&broker_ip, 192, 168, 1, 100);mqtt_client_connect(mqtt_client, &broker_ip, 1883, mqtt_connection_cb, NULL, "client_id");// 设置消息回调mqtt_set_inpub_callback(mqtt_client, mqtt_msg_cb, NULL, NULL);
}// MQTT发布消息
void mqtt_publish(const char *topic, const char *message) {mqtt_publish(mqtt_client, topic, message, strlen(message), 0, 0, NULL, NULL);
}</pre></div></div><h3 class="text-xl font-bold text-secondary mt-8 mb-4">HTTP GET请求</h3><div class="mb-8"><div class="bg-gray-800 text-gray-300 px-4 py-2 rounded-t-lg flex justify-between items-center"><span class="font-mono">HTTP请求实现</span><button class="text-xs bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded transition-colors"><i class="fa fa-copy mr-1"></i>复制</button></div><div class="code-block"><pre>// HTTP GET请求
void http_get_request(const char *host, const char *path) {int sock = tcp_connect(host, 80);if (sock < 0) return;char request[256];snprintf(request, sizeof(request), "GET %s HTTP/1.1\r\nHost: %s\r\nConnection: close\r\n\r\n", path, host);lwip_send(sock, request, strlen(request), 0);char response[1024];int total_received = 0;int len;while ((len = lwip_recv(sock, response + total_received, sizeof(response) - total_received - 1, 0)) > 0) {total_received += len;if (total_received >= sizeof(response) - 1) break;}if (total_received > 0) {response[total_received] = '\0';printf("HTTP Response:\n%s\n", response);}lwip_close(sock);
}</pre></div></div></section><!-- 双模式融合实现 --><section id="integration" class="bg-white rounded-xl shadow-sm p-8 mb-10 transform transition-all duration-500 hover:shadow-md"><h2 class="section-header">双模式融合实现</h2><div class="mb-8"><div class="bg-gray-800 text-gray-300 px-4 py-2 rounded-t-lg flex justify-between items-center"><span class="font-mono">双网络接口管理</span><button class="text-xs bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded transition-colors"><i class="fa fa-copy mr-1"></i>复制</button></div><div class="code-block"><pre>// 网络接口管理
struct netif eth_netif;
struct netif ppp_netif;// 初始化双网络接口
void network_init(void) {// 初始化以太网ETH_Netif_Init();// 初始化4G PPPPPP_Init();// 设置默认路由为以太网netif_set_default(&eth_netif);
}// 网络状态监控任务
void network_monitor_task(void *arg) {for (;;) {// 检查以太网连接状态if (!netif_is_up(&eth_netif)) {printf("ETH down! Switching to 4G...\n");netif_set_default(&ppp_netif);} // 当以太网恢复时切换回来else if (netif_is_up(&eth_netif) && netif_default != &eth_netif) {printf("ETH restored. Switching back.\n");netif_set_default(&eth_netif);}vTaskDelay(pdMS_TO_TICKS(5000));}
}// 创建监控任务(在FreeRTOS中)
xTaskCreate(network_monitor_task, "NetMonitor", 1024, NULL, 3, NULL);</pre></div></div><h3 class="text-xl font-bold text-secondary mt-8 mb-4">融合架构示意图</h3><div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200 my-6"><svg width="100%" height="300" viewBox="0 0 800 300" xmlns="http://www.w3.org/2000/svg"><rect x="50" y="50" width="150" height="60" rx="5" fill="#3498db" stroke="#2980b9" stroke-width="2" /><text x="125" y="85" text-anchor="middle" fill="white" font-weight="bold">应用层</text><rect x="250" y="50" width="150" height="60" rx="5" fill="#2ecc71" stroke="#27ae60" stroke-width="2" /><text x="325" y="85" text-anchor="middle" fill="white" font-weight="bold">LwIP协议栈</text><rect x="50" y="150" width="150" height="60" rx="5" fill="#9b59b6" stroke="#8e44ad" stroke-width="2" /><text x="125" y="185" text-anchor="middle" fill="white" font-weight="bold">以太网接口</text><rect x="250" y="150" width="150" height="60" rx="5" fill="#e74c3c" stroke="#c0392b" stroke-width="2" /><text x="325" y="185" text-anchor="middle" fill="white" font-weight="bold">4G PPP模式</text><rect x="450" y="150" width="150" height="60" rx="5" fill="#1abc9c" stroke="#16a085" stroke-width="2" /><text x="525" y="185" text-anchor="middle" fill="white" font-weight="bold">网络监控</text><!-- 连接线 --><line x1="200" y1="80" x2="250" y2="80" stroke="#7f8c8d" stroke-width="2" /><line x1="400" y1="80" x2="450" y2="80" stroke="#7f8c8d" stroke-width="2" stroke-dasharray="5,5" /><line x1="125" y1="110" x2="125" y2="150" stroke="#7f8c8d" stroke-width="2" /><line x1="325" y1="110" x2="325" y2="150" stroke="#7f8c8d" stroke-width="2" /><line x1="125" y1="210" x2="50" y2="250" stroke="#7f8c8d" stroke-width="2" /><text x="80" y="240" text-anchor="middle" fill="#7f8c8d">工业网络</text><line x1="325" y1="210" x2="325" y2="250" stroke="#7f8c8d" stroke-width="2" /><text x="325" y="270" text-anchor="middle" fill="#7f8c8d">4G网络</text><line x1="525" y1="210" x2="600" y2="250" stroke="#7f8c8d" stroke-width="2" /><text x="560" y="240" text-anchor="middle" fill="#7f8c8d">管理接口</text></svg></div></section><!-- 性能对比与优化建议 --><section id="performance" class="bg-white rounded-xl shadow-sm p-8 mb-10 transform transition-all duration-500 hover:shadow-md"><h2 class="section-header">性能对比与优化建议</h2><div class="grid grid-cols-1 md:grid-cols-2 gap-6 mt-6"><div class="performance-card border-t-accent"><h3 class="text-xl font-bold text-dark mb-2">4G PPP模式</h3><div class="space-y-4 mt-4"><div><div class="text-2xl font-bold text-primary">18-22KB</div><div class="text-gray-600 text-sm">RAM占用</div></div><div><div class="text-2xl font-bold text-primary">80-100KB</div><div class="text-gray-600 text-sm">Flash占用</div></div><div><div class="text-2xl font-bold text-primary">15-25%</div><div class="text-gray-600 text-sm">CPU负载 @72MHz</div></div><div><div class="text-2xl font-bold text-primary">30-100ms</div><div class="text-gray-600 text-sm">网络延迟</div></div></div></div><div class="performance-card border-t-success"><h3 class="text-xl font-bold text-dark mb-2">以太网接口</h3><div class="space-y-4 mt-4"><div><div class="text-2xl font-bold text-primary">12-16KB</div><div class="text-gray-600 text-sm">RAM占用</div></div><div><div class="text-2xl font-bold text-primary">70-90KB</div><div class="text-gray-600 text-sm">Flash占用</div></div><div><div class="text-2xl font-bold text-primary">5-10%</div><div class="text-gray-600 text-sm">CPU负载 @72MHz</div></div><div><div class="text-2xl font-bold text-primary">&lt;1ms</div><div class="text-gray-600 text-sm">网络延迟</div></div></div></div></div><h3 class="text-xl font-bold text-secondary mt-8 mb-4">优化建议</h3><div class="space-y-6"><div><h4 class="font-bold text-lg mb-2">内存管理</h4><p>根据应用需求调整MEM_SIZE,使用内存池优化(MEMP_NUM_PBUF=16, PBUF_POOL_SIZE=8)</p><div class="bg-gray-800 text-gray-300 px-4 py-2 rounded-t-lg mt-4"><span class="font-mono">lwipopts.h 配置</span></div><div class="code-block"><pre>#define TCP_WND 2048    // 增大TCP窗口提高吞吐量
#define TCP_MSS 1460    // 最大分段大小
#define LWIP_TCP_TIMESTAMPS 1 // 启用时间戳选项</pre></div></div><div><h4 class="font-bold text-lg mb-2">功耗管理</h4><p>4G模块在空闲时进入休眠模式</p><div class="bg-gray-800 text-gray-300 px-4 py-2 rounded-t-lg mt-4"><span class="font-mono">4G模块休眠</span></div><div class="code-block"><pre>// 4G模块休眠
void ppp_sleep_mode(void) {ppp_close(ppp, 1);HAL_UART_Transmit(&huart3, "AT+QSCLK=1\r\n", 12, 100);
}</pre></div></div></div></section><!-- 结论 --><section class="bg-gradient-to-br from-primary to-dark text-white rounded-xl shadow-sm p-8 mb-10 transform transition-all duration-500 hover:shadow-md"><h2 class="text-2xl font-bold mb-6 pb-3 border-b-2 border-secondary">结论</h2><ul class="space-y-3 pl-5 list-disc"><li><strong>4G PPP模式</strong> 是移动场景和无固定网络接入环境的理想选择,提供灵活的网络接入能力</li><li><strong>以太网接口</strong> 在固定位置的高带宽、低延迟应用场景中具有明显优势</li><li><strong>双模式融合</strong> 方案可提供网络冗余,显著增强系统可靠性</li><li>上层应用通过统一的LwIP API实现,保证了代码的可移植性</li><li>在资源受限的嵌入式系统中,可根据具体需求选择适合的网络接入方式</li></ul><p class="mt-6">完整工程示例参考:</p><div class="flex flex-wrap gap-4 mt-2"><a href="https://www.armbbs.cn/forum.php?tid=96082" class="text-blue-300 hover:text-blue-200 transition-colors"><i class="fa fa-link mr-1"></i>STM32F4 PPP示例</a><a href="http://www.mzph.cn/news/903942.shtml" class="text-blue-300 hover:text-blue-200 transition-colors"><i class="fa fa-link mr-1"></i>以太网移植指南</a></div></section></main><!-- 页脚 --><footer class="bg-gray-900 text-gray-400 py-8"><div class="container mx-auto px-4"><div class="flex flex-col md:flex-row justify-between items-center"><div class="mb-4 md:mb-0"><div class="flex items-center"><i class="fa fa-ethernet text-secondary text-xl mr-2"></i><span class="text-white font-bold">嵌入式网络技术</span></div><p class="mt-2 text-sm">© 2025 技术文档</p></div><div class="flex space-x-6"><a href="#" class="hover:text-white transition-colors"><i class="fa fa-github text-xl"></i></a><a href="#" class="hover:text-white transition-colors"><i class="fa fa-linkedin text-xl"></i></a><a href="#" class="hover:text-white transition-colors"><i class="fa fa-twitter text-xl"></i></a></div></div></div></footer><script>// 平滑滚动document.querySelectorAll('a[href^="#"]').forEach(anchor => {anchor.addEventListener('click', function (e) {e.preventDefault();const targetId = this.getAttribute('href');const targetElement = document.querySelector(targetId);if (targetElement) {window.scrollTo({top: targetElement.offsetTop - 80,behavior: 'smooth'});}});});// 导航栏滚动效果window.addEventListener('scroll', function() {const nav = document.querySelector('nav');if (window.scrollY > 100) {nav.classList.add('py-2', 'shadow-md');nav.classList.remove('py-3');} else {nav.classList.add('py-3');nav.classList.remove('py-2', 'shadow-md');}});// 代码复制功能document.querySelectorAll('.code-block').forEach((codeBlock, index) => {const button = document.querySelectorAll('.code-block').length > 1 ? document.querySelectorAll('.code-block')[index].parentElement.querySelector('button'): document.querySelector('.code-block').parentElement.querySelector('button');if (button) {button.addEventListener('click', () => {const text = codeBlock.textContent;navigator.clipboard.writeText(text).then(() => {const originalText = button.innerHTML;button.innerHTML = '<i class="fa fa-check mr-1"></i>已复制';button.classList.add('bg-green-600');setTimeout(() => {button.innerHTML = originalText;button.classList.remove('bg-green-600');}, 2000);});});}});</script>
</body>
</html>
http://www.dtcms.com/a/277809.html

相关文章:

  • JAVA AI智能体——1 入门
  • Redis 基础详细介绍(Redis简单介绍,命令行客户端,Redis 命令,Java客户端)
  • day5--上传视频
  • AI赋能ERP:从自动化到智能化,企业运营的未来已来
  • 【SpringBoot】注册条件+自动配置原理+自定义starter
  • 每天学习一个Python第三方库之jieba库
  • 【DVWA系列】——File Upload——low详细教程(webshell工具冰蝎)
  • on-policy和offpolicy算法
  • 计算机时钟演进:从毫秒到纳秒的精密革命
  • 动态规划题解_零钱兑换【LeetCode】
  • AV1序列头信息
  • Leetcode 3615. Longest Palindromic Path in Graph
  • [Dify]-基础入门5- Dify 中角色设定的正确方式与常见误区
  • SpringBoot3-Flowable7初体验
  • 谷歌在软件工程领域应用AI的进展与未来展望
  • v-for中key值的作用:为什么我总被要求加这个‘没用的‘属性?
  • Linux-网络管理
  • OneCode 3.0 权限引擎实现详解:基于esdright模块的设计与架构
  • 【micro:bit】从入门到放弃(一):在线、离线版本的使用
  • 代码部落 20250713 CSP-J复赛 模拟赛
  • 适配器模式:兼容不兼容接口
  • C++--unordered_set和unordered_map的使用
  • C#接口进阶:继承与多态实战解析
  • DVWA靶场通关笔记-XSS DOM(Medium级别)
  • 在人工智能自动化编程时代:AI驱动开发和传统软件开发的分析对比
  • 如何自动化处理TXT日志,提升工作效率新方式
  • Autotab:用“屏幕录制”训练AI助手,解锁企业级自动化新范式
  • Springboot实现一个接口加密
  • 免费证件照工具,一键制作超方便
  • Linux驱动开发2:字符设备驱动