mirror of
https://github.com/espressif/openthread.git
synced 2026-07-29 15:17:47 +00:00
[ip6] add public API to convert otSockAddr to string (#6693)
This commit adds public API `otIp6SockAddrToString()` which converts an IPv6 socket address (`otSockAddr`) to human-readable string. The CLI modules (e.g. `ProcessNetStat()`) are then updated to use the new API.
This commit is contained in:
@@ -35,24 +35,24 @@ setup_leader
|
||||
send "udp open\n"
|
||||
expect_line "Done"
|
||||
send "netstat\n"
|
||||
expect "| Local Address | Peer Address |"
|
||||
expect "+-----------------------------------------------+-----------------------------------------------+"
|
||||
expect "| 0:0:0:0:0:0:0:0:* | 0:0:0:0:0:0:0:0:* |"
|
||||
expect "| Local Address | Peer Address |"
|
||||
expect "+-------------------------------------------------+-------------------------------------------------+"
|
||||
expect "| [0:0:0:0:0:0:0:0]:0 | [0:0:0:0:0:0:0:0]:0 |"
|
||||
expect_line "Done"
|
||||
send "udp bind :: 10001\n"
|
||||
expect_line "Done"
|
||||
send "netstat\n"
|
||||
expect "| Local Address | Peer Address |"
|
||||
expect "+-----------------------------------------------+-----------------------------------------------+"
|
||||
expect "| 0:0:0:0:0:0:0:0:10001 | 0:0:0:0:0:0:0:0:* |"
|
||||
expect "| Local Address | Peer Address |"
|
||||
expect "+-------------------------------------------------+-------------------------------------------------+"
|
||||
expect "| [0:0:0:0:0:0:0:0]:1001 | [0:0:0:0:0:0:0:0]:0 |"
|
||||
expect_line "Done"
|
||||
set addr [get_ipaddr mleid]
|
||||
send "udp connect $addr 10001\n"
|
||||
expect_line "Done"
|
||||
send "netstat\n"
|
||||
expect "| Local Address | Peer Address |"
|
||||
expect "+-----------------------------------------------+-----------------------------------------------+"
|
||||
expect -re "\\| 0:0:0:0:0:0:0:0:10001 +\\| $addr:10001 +\\|"
|
||||
expect "| Local Address | Peer Address |"
|
||||
expect "+-------------------------------------------------+-------------------------------------------------+"
|
||||
expect -re "\\| \\[0:0:0:0:0:0:0:0\\]:10001 +\\| \\[$addr\\]:10001 +\\|"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
Reference in New Issue
Block a user