mirror of
https://github.com/espressif/openthread.git
synced 2026-09-17 06:30:10 +00:00
[simulation] support simulating radio over IPv6 (#10194)
This commit adds support to simulate Thread radio over IPv6. With this commit, a simulation will be simulated over either IPv6 or IPv4. If it's simulated on IPv6, it communicates with other simulation nodes in IPv6 group `ff02::116`. And if it's simulated on IPv4, it communicates with other simulation nodes in IPv4 group `224.0.0.116`. Note that simulating virtual time is not included in this commit.
This commit is contained in:
@@ -84,6 +84,13 @@ proc spawn_node {id {type ""} {radio_url ""}} {
|
||||
set gcov_prefix "ot-run/$argv0/ot-gcda.$id"
|
||||
}
|
||||
|
||||
if {[info exists ::env(OT_SIMULATION_LOCAL_HOST)]} {
|
||||
set ot_simulation_local_host $::env(OT_SIMULATION_LOCAL_HOST)
|
||||
set radio_url "$radio_url&forkpty-arg=-L$ot_simulation_local_host"
|
||||
} else {
|
||||
set ot_simulation_local_host "127.0.0.1"
|
||||
}
|
||||
|
||||
switch -regexp ${type} {
|
||||
{rcp|rcp-cli} {
|
||||
# Sleep 0.2 seconds to ensure that the ot-rcp in the previous test has exited to
|
||||
@@ -97,7 +104,8 @@ proc spawn_node {id {type ""} {radio_url ""}} {
|
||||
expect_line "Done"
|
||||
}
|
||||
cli {
|
||||
spawn /usr/bin/env GCOV_PREFIX=$gcov_prefix $::env(OT_SIMULATION_APPS)/cli/ot-cli-ftd $id
|
||||
spawn /usr/bin/env GCOV_PREFIX=$gcov_prefix $::env(OT_SIMULATION_APPS)/cli/ot-cli-ftd \
|
||||
-L$ot_simulation_local_host $id
|
||||
send "factoryreset\n"
|
||||
wait_for "state" "disabled"
|
||||
expect_line "Done"
|
||||
@@ -105,7 +113,8 @@ proc spawn_node {id {type ""} {radio_url ""}} {
|
||||
expect_line "Done"
|
||||
}
|
||||
mtd {
|
||||
spawn /usr/bin/env GCOV_PREFIX=$gcov_prefix $::env(OT_SIMULATION_APPS)/cli/ot-cli-mtd $id
|
||||
spawn /usr/bin/env GCOV_PREFIX=$gcov_prefix $::env(OT_SIMULATION_APPS)/cli/ot-cli-mtd \
|
||||
-L$ot_simulation_local_host $id
|
||||
send "factoryreset\n"
|
||||
wait_for "state" "disabled"
|
||||
expect_line "Done"
|
||||
|
||||
Reference in New Issue
Block a user