Google is committed to advancing racial equity for Black communities. See how.
此页面由 Cloud Translation API 翻译。
Switch to English

验证端口

必须进行基本验证,才能验证OpenThread是否成功移植到新的硬件平台示例。

针对目标平台进行编译

通过编译目标平台的示例OpenThread应用程序来演示成功的构建。

 ./bootstrap
make -f examples/Makefile-efr32 COMMISSIONER=1 JOINER=1

与CLI交互

通过与CLI交互来演示成功的OpenThread执行和UART功能。

打开一个终端到/dev/ttyACM0 (串行端口设置:115200 8-N-1)。键入help以获取命令列表。

 help
help
autostart
bufferinfo
...
version
whitelist 

形成线程网络

通过形成线程网络并验证节点已转换为Leader状态来演示成功的协议计时器。

 dataset init new
Done
dataset
Active Timestamp: 1
Channel: 13
Channel Mask: 07fff800
Ext PAN ID: d63e8e3e495ebbc3
Mesh Local Prefix: fd3d:b50b:f96d:722d/64
Master Key: dfd34f0f05cad978ec4e32b0413038ff
Network Name: OpenThread-8f28
PAN ID: 0x8f28
PSKc: c23a76e98f1a6483639b1ac1271e2e27
Security Policy: 0, onrcb
Done
dataset commit active
Done
ifconfig up
Done
thread start
Done

等待几秒钟...

 state
leader
Done 

附加第二个节点

通过使用与第一个节点相同的线程主密钥和PAN ID,将第二个节点连接到新形成的Thread网络,演示成功的无线电通信:

 dataset masterkey dfd34f0f05cad978ec4e32b0413038ff
Done
dataset panid 0x8f28
Done
dataset commit active
Done
routerselectionjitter 1
Done
ifconfig up
Done
thread start
Done

等待几秒钟...

 state
router
Done 

设备之间的Ping

通过发送/接收ICMPv6回显请求/响应消息来演示成功的数据路径通信。

列出Leader的所有IPv6地址:

 ipaddr
fdde:ad00:beef:0:0:ff:fe00:fc00
fdde:ad00:beef:0:0:ff:fe00:800
fdde:ad00:beef:0:5b:3bcd:deff:7786
fe80:0:0:0:6447:6e10:cf7:ee29
Done 

将ICMPv6 ping从路由器发送到Leader的Mesh-Local EID IPv6地址:

 ping fdde:ad00:beef:0:5b:3bcd:deff:7786
16 bytes from fdde:ad00:beef:0:5b:3bcd:deff:7786: icmp_seq=1 hlim=64 time=24ms 

重置设备并验证重新连接

通过重置设备并验证其重新连接到同一网络而无需用户干预,从而演示非易失性功能。

启动线程网络:

 dataset init new
Done
dataset
Active Timestamp: 1
Channel: 13
Channel Mask: 07fff800
Ext PAN ID: d63e8e3e495ebbc3
Mesh Local Prefix: fd3d:b50b:f96d:722d/64
Master Key: dfd34f0f05cad978ec4e32b0413038ff
Network Name: OpenThread-8f28
PAN ID: 0x8f28
PSKc: c23a76e98f1a6483639b1ac1271e2e27
Security Policy: 0, onrcb
Done
dataset commit active
Done
ifconfig up
Done
thread start
Done

等待几秒钟,并验证活动数据集是否已存储在非易失性存储中:

 dataset active
Active Timestamp: 1
Channel: 13
Channel Mask: 07fff800
Ext PAN ID: d63e8e3e495ebbc3
Mesh Local Prefix: fd3d:b50b:f96d:722d/64
Master Key: dfd34f0f05cad978ec4e32b0413038ff
Network Name: OpenThread-8f28
PAN ID: 0x8f28
PSKc: c23a76e98f1a6483639b1ac1271e2e27
Security Policy: 0, onrcb
Done

重置设备:

 reset
ifconfig up
Done
thread start
Done

等待几秒钟,然后确认设备已成功重新连接到网络:

 panid
0x8f28
Done
state
router
Done 

验证随机数生成

通过执行factoryreset命令并验证新的随机扩展地址来演示随机数生成。

 extaddr
a660421703f3fdc3
Done
factoryreset 

等待几秒钟...

 extaddr
9a8ed90715a5f7b6
Done