下载 FreeRTOS
 

出色的 RTOS & 嵌入式软件

最新资讯
FreeRTOS-Plus-TCP 现具有统一的 IPv4 和 IPv6 功能,支持多接口。
为基于 FreeRTOS 的固件实现防砖化 MCU FOTA:
宣布停止支持 FreeRTOS 202012 LTS。
FreeRTOS 网站现已提供简体中文版本
新的 FreeRTOS Long Term Support 版本现已发布。

RA

RA 指的是路由器通告。

路由器通告是 IPv6 邻居发现协议的一部分。路由器定期发送多播消息, 告知设备其存在,同时告知网络配置。RA 允许动态地址配置,使设备更轻松地 连接到网络。

如果 ipconfigUSE_RAFreeRTOSIPConfig.h 中设置为 1 并且在端点初始化过程中设置了端点结构体 bits 字段中的 bWantRA 位, 则 FreeRTOS-Plus-TCP 将尝试通过路由器通告获取端点的 IP 地址。

以下是启用 RA 的端点初始化示例:

IPv6_Address_t xIPAddress;
IPv6_Address_t xPrefix;
IPv6_Address_t xGateWay;
IPv6_Address_t xDNSServer1, xDNSServer2;

FreeRTOS_inet_pton6( "2001:470:ed44::", xPrefix.ucBytes );

FreeRTOS_CreateIPv6Address( &xIPAddress, &xPrefix, 64, pdTRUE );
FreeRTOS_inet_pton6( "fe80::ba27:ebff:fe5a:d751", xGateWay.ucBytes );

FreeRTOS_FillEndPoint_IPv6( &( xInterfaces[ 0 ] ),
&( xEndPoints[ xEndPointCount ] ),
&( xIPAddress ),
&( xPrefix ),
64uL, /* Prefix length. */
&( xGateWay ),
NULL, /* pxDNSServerAddress: Not used yet. */
ucMACAddress );
FreeRTOS_inet_pton6( "2001:4860:4860::8888", xEndPoints[ xEndPointCount ].ipv6_settings.xDNSServerAddresses[ 0 ].ucBytes );
FreeRTOS_inet_pton6( "fe80::1", xEndPoints[ xEndPointCount ].ipv6_settings.xDNSServerAddresses[ 1 ].ucBytes );
FreeRTOS_inet_pton6( "2001:4860:4860::8888", xEndPoints[ xEndPointCount ].ipv6_defaults.xDNSServerAddresses[ 0 ].ucBytes );
FreeRTOS_inet_pton6( "fe80::1", xEndPoints[ xEndPointCount ].ipv6_defaults.xDNSServerAddresses[ 1 ].ucBytes );

#if ( ipconfigUSE_RA != 0 )
{
/* End-point wants to use RA. */
xEndPoints[ xEndPointCount ].bits.**bWantRA** = pdTRUE;
}
#endif /* ( ipconfigUSE_RA != 0 ) */
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.