Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[api] enable DIAG_GET request command into commissioner #301

Closed
wants to merge 4 commits into from

Conversation

ZhangLe2016
Copy link
Contributor

This PR adds a DIAG_GET request command to the commissioner module, allowing users to request one or more diagnostic TLVs from a peer Thread device by setting the device's mesh local address and TLV mask bits flag.

Supported Diagnostic TLVs

ExtMacAddress
Rloc16
Mode
Route64
LeaderData
Eui64
Ipv6Address
ChildTable

Test:

config set pskc 445f2b5ca6f2a93a55ce570a70efeecb
[done]
start 192.168.9.2 49154
[done]
diag get leaderdata

{
"DataVersion": 70,
"PartitionId": 1612549395,
"RouterId": 51,
"StableDataVersion": 249,
"Weighting": 64
}
[done]
diag get ipaddr
{
"Ipv6 Addresses": [
"fdce:bb1d:37f6:6978:0000:00ff:fe00:fc31",
"fdce:bb1d:37f6:6978:0000:00ff:fe00:fc11",
"fdce:bb1d:37f6:6978:0000:00ff:fe00:fc10",
"fdce:bb1d:37f6:6978:0000:00ff:fe00:fc38",
"fd11:0022:0000:0000:0eff:b88e:150d:6192",
"fdce:bb1d:37f6:6978:0000:00ff:fe00:fc00",
"fdce:bb1d:37f6:6978:0000:00ff:fe00:cc00",
"fdce:bb1d:37f6:6978:6346:d247:62e8:7ba8",
"fe80:0000:0000:0000:bcda:4117:61f5:6516"
]
}
[done]

diag get rloc16

{
"Rloc16": "0xcc00"
}
[done]
diag get rloc16 fdce:bb1d:37f6:6978:0000:00ff:fe00:fc00

{
"Rloc16": "0xcc00"
}
diag get route64 fdce:bb1d:37f6:6978:0000:00ff:fe00:cc00

{
"IdSequence": 20,
"Mask": "0000000000001000",
"RouteData": [
"{\n "IncommingLinkQuality": 0,\n "OutgoingLinkQuality": 0,\n "RouteCost": 1,\n "RouterId": 51\n}"
]
}
[done]

This PR adds a DIAG_GET request command to the commissioner module,
allowing users to request one or more diagnostic TLVs from a peer Thread device
by setting the device's mesh local address and TLV mask bits flag.

Supported Diagnostic TLVs

ExtMacAddress
Rloc16
Mode
Route64
LeaderData
Eui64
Ipv6Address
ChildTable

Test:

config set pskc 445f2b5ca6f2a93a55ce570a70efeecb
[done]
start 192.168.9.2 49154
[done]
diag get leaderdata

{
    "DataVersion": 70,
    "PartitionId": 1612549395,
    "RouterId": 51,
    "StableDataVersion": 249,
    "Weighting": 64
}
[done]
diag get ipaddr
{
    "Ipv6 Addresses": [
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc31",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc11",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc10",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc38",
        "fd11:0022:0000:0000:0eff:b88e:150d:6192",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc00",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:cc00",
        "fdce:bb1d:37f6:6978:6346:d247:62e8:7ba8",
        "fe80:0000:0000:0000:bcda:4117:61f5:6516"
    ]
}
[done]

diag get rloc16

{
    "Rloc16": "0xcc00"
}
[done]
diag get rloc16 fdce:bb1d:37f6:6978:0000:00ff:fe00:fc00

{
    "Rloc16": "0xcc00"
}
diag get route64 fdce:bb1d:37f6:6978:0000:00ff:fe00:cc00

{
    "IdSequence": 20,
    "Mask": "0000000000001000",
    "RouteData": [
        "{\n    \"IncommingLinkQuality\": 0,\n    \"OutgoingLinkQuality\": 0,\n    \"RouteCost\": 1,\n    \"RouterId\": 51\n}"
    ]
}
[done]
This PR adds a DIAG_GET request command to the commissioner module,
allowing users to request one or more diagnostic TLVs from a peer Thread device
by setting the device's mesh local address and TLV mask bits flag.

Supported Diagnostic TLVs

ExtMacAddress
Rloc16
Mode
Route64
LeaderData
Eui64
Ipv6Address
ChildTable

Test:

config set pskc 445f2b5ca6f2a93a55ce570a70efeecb
[done]
start 192.168.9.2 49154
[done]
diag get leaderdata

{
    "DataVersion": 70,
    "PartitionId": 1612549395,
    "RouterId": 51,
    "StableDataVersion": 249,
    "Weighting": 64
}
[done]
diag get ipaddr
{
    "Ipv6 Addresses": [
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc31",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc11",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc10",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc38",
        "fd11:0022:0000:0000:0eff:b88e:150d:6192",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc00",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:cc00",
        "fdce:bb1d:37f6:6978:6346:d247:62e8:7ba8",
        "fe80:0000:0000:0000:bcda:4117:61f5:6516"
    ]
}
[done]

diag get rloc16

{
    "Rloc16": "0xcc00"
}
[done]
diag get rloc16 fdce:bb1d:37f6:6978:0000:00ff:fe00:fc00

{
    "Rloc16": "0xcc00"
}
diag get route64 fdce:bb1d:37f6:6978:0000:00ff:fe00:cc00

{
    "IdSequence": 20,
    "Mask": "0000000000001000",
    "RouteData": [
        "{\n    \"IncommingLinkQuality\": 0,\n    \"OutgoingLinkQuality\": 0,\n    \"RouteCost\": 1,\n    \"RouterId\": 51\n}"
    ]
}
[done]
This PR adds a DIAG_GET request command to the commissioner module,
allowing users to request one or more diagnostic TLVs from a peer Thread device
by setting the device's mesh local address and TLV mask bits flag.

Supported Diagnostic TLVs

ExtMacAddress
Rloc16
Mode
Route64
LeaderData
Eui64
Ipv6Address
ChildTable

Test:

config set pskc 445f2b5ca6f2a93a55ce570a70efeecb
[done]
start 192.168.9.2 49154
[done]
diag get leaderdata

{
    "DataVersion": 70,
    "PartitionId": 1612549395,
    "RouterId": 51,
    "StableDataVersion": 249,
    "Weighting": 64
}
[done]
diag get ipaddr
{
    "Ipv6 Addresses": [
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc31",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc11",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc10",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc38",
        "fd11:0022:0000:0000:0eff:b88e:150d:6192",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc00",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:cc00",
        "fdce:bb1d:37f6:6978:6346:d247:62e8:7ba8",
        "fe80:0000:0000:0000:bcda:4117:61f5:6516"
    ]
}
[done]

diag get rloc16

{
    "Rloc16": "0xcc00"
}
[done]
diag get rloc16 fdce:bb1d:37f6:6978:0000:00ff:fe00:fc00

{
    "Rloc16": "0xcc00"
}
diag get route64 fdce:bb1d:37f6:6978:0000:00ff:fe00:cc00

{
    "IdSequence": 20,
    "Mask": "0000000000001000",
    "RouteData": [
        "{\n    \"IncommingLinkQuality\": 0,\n    \"OutgoingLinkQuality\": 0,\n    \"RouteCost\": 1,\n    \"RouterId\": 51\n}"
    ]
}
[done]
This PR adds a DIAG_GET request command to the commissioner module,
allowing users to request one or more diagnostic TLVs from a peer Thread device
by setting the device's mesh local address and TLV mask bits flag.

Supported Diagnostic TLVs

ExtMacAddress
Rloc16
Mode
Route64
LeaderData
Eui64
Ipv6Address
ChildTable

Test:

config set pskc 445f2b5ca6f2a93a55ce570a70efeecb
[done]
start 192.168.9.2 49154
[done]
diag get leaderdata

{
    "DataVersion": 70,
    "PartitionId": 1612549395,
    "RouterId": 51,
    "StableDataVersion": 249,
    "Weighting": 64
}
[done]
diag get ipaddr
{
    "Ipv6 Addresses": [
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc31",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc11",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc10",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc38",
        "fd11:0022:0000:0000:0eff:b88e:150d:6192",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:fc00",
        "fdce:bb1d:37f6:6978:0000:00ff:fe00:cc00",
        "fdce:bb1d:37f6:6978:6346:d247:62e8:7ba8",
        "fe80:0000:0000:0000:bcda:4117:61f5:6516"
    ]
}
[done]

diag get rloc16

{
    "Rloc16": "0xcc00"
}
[done]
diag get rloc16 fdce:bb1d:37f6:6978:0000:00ff:fe00:fc00

{
    "Rloc16": "0xcc00"
}
diag get route64 fdce:bb1d:37f6:6978:0000:00ff:fe00:cc00

{
    "IdSequence": 20,
    "Mask": "0000000000001000",
    "RouteData": [
        "{\n    \"IncommingLinkQuality\": 0,\n    \"OutgoingLinkQuality\": 0,\n    \"RouteCost\": 1,\n    \"RouterId\": 51\n}"
    ]
}
[done]
@ZhangLe2016 ZhangLe2016 requested review from wgtdkp and lanyuwen October 9, 2024 08:51
std::string ToString() const;
};

struct Child
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if the child data could be obtained by OT code

@wgtdkp
Copy link
Member

wgtdkp commented Dec 11, 2024

Is this PR obsoleted now? @ZhangLe2016

If true, could you close it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants