-
Notifications
You must be signed in to change notification settings - Fork 37
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 query function into commissioner #298
Conversation
This PR adds DIAG_GET query command into the commissioner module, allowing users to query one or more diagnostic TLVs from a peer Thread device by setting the device's mesh local address than TLV mask bits flag. Test: config set pskc 445f2b5ca6f2a93a55ce570a70efeecb [done] start 192.168.9.2 49154 [done] diag query ipaddr fdce:bb1d:37f6:6978:0:ff:fe00:cc00 { "Ipv6 Addresses": [ "fdcebb1d37f66978000000fffe00fc31", "fdcebb1d37f66978000000fffe00fc11", "fdcebb1d37f66978000000fffe00fc10", "fdcebb1d37f66978000000fffe00fc38", "fd110022000000000effb88e150d6192", "fdcebb1d37f66978000000fffe00fc00", "fdcebb1d37f66978000000fffe00cc00", "fdcebb1d37f669786346d24762e87ba8", "fe80000000000000bcda411761f56516" ] } [done]
This PR adds DIAG_GET query command into the commissioner module, allowing users to query one or more diagnostic TLVs from a peer Thread device by setting the device's mesh local address than TLV mask bits flag. Test: config set pskc 445f2b5ca6f2a93a55ce570a70efeecb [done] start 192.168.9.2 49154 [done] diag query ipaddr fdce:bb1d:37f6:6978:0:ff:fe00:cc00 { "Ipv6 Addresses": [ "fdcebb1d37f66978000000fffe00fc31", "fdcebb1d37f66978000000fffe00fc11", "fdcebb1d37f66978000000fffe00fc10", "fdcebb1d37f66978000000fffe00fc38", "fd110022000000000effb88e150d6192", "fdcebb1d37f66978000000fffe00fc00", "fdcebb1d37f66978000000fffe00cc00", "fdcebb1d37f669786346d24762e87ba8", "fe80000000000000bcda411761f56516" ] } [done]
This PR adds DIAG_GET query command into the commissioner module, allowing users to query one or more diagnostic TLVs from a peer Thread device by setting the device's mesh local address than TLV mask bits flag. Test: config set pskc 445f2b5ca6f2a93a55ce570a70efeecb [done] start 192.168.9.2 49154 [done] diag query ipaddr fdce:bb1d:37f6:6978:0:ff:fe00:cc00 { "Ipv6 Addresses": [ "fdcebb1d37f66978000000fffe00fc31", "fdcebb1d37f66978000000fffe00fc11", "fdcebb1d37f66978000000fffe00fc10", "fdcebb1d37f66978000000fffe00fc38", "fd110022000000000effb88e150d6192", "fdcebb1d37f66978000000fffe00fc00", "fdcebb1d37f66978000000fffe00cc00", "fdcebb1d37f669786346d24762e87ba8", "fe80000000000000bcda411761f56516" ] } [done]
This PR adds DIAG_GET query command into the commissioner module, allowing users to query one or more diagnostic TLVs from a peer Thread device by setting the device's mesh local address than TLV mask bits flag. Test: config set pskc 445f2b5ca6f2a93a55ce570a70efeecb [done] start 192.168.9.2 49154 [done] diag query ipaddr fdce:bb1d:37f6:6978:0:ff:fe00:cc00 { "Ipv6 Addresses": [ "fdcebb1d37f66978000000fffe00fc31", "fdcebb1d37f66978000000fffe00fc11", "fdcebb1d37f66978000000fffe00fc10", "fdcebb1d37f66978000000fffe00fc38", "fd110022000000000effb88e150d6192", "fdcebb1d37f66978000000fffe00fc00", "fdcebb1d37f66978000000fffe00cc00", "fdcebb1d37f669786346d24762e87ba8", "fe80000000000000bcda411761f56516" ] } [done]
This PR adds DIAG_GET query command into the commissioner module, allowing users to query one or more diagnostic TLVs from a peer Thread device by setting the device's mesh local address than TLV mask bits flag. Test: config set pskc 445f2b5ca6f2a93a55ce570a70efeecb [done] start 192.168.9.2 49154 [done] diag query ipaddr fdce:bb1d:37f6:6978:0:ff:fe00:cc00 { "Ipv6 Addresses": [ "fdcebb1d37f66978000000fffe00fc31", "fdcebb1d37f66978000000fffe00fc11", "fdcebb1d37f66978000000fffe00fc10", "fdcebb1d37f66978000000fffe00fc38", "fd110022000000000effb88e150d6192", "fdcebb1d37f66978000000fffe00fc00", "fdcebb1d37f66978000000fffe00cc00", "fdcebb1d37f669786346d24762e87ba8", "fe80000000000000bcda411761f56516" ] } [done]
This PR adds DIAG_GET query command into the commissioner module, allowing users to query one or more diagnostic TLVs from a peer Thread device by setting the device's mesh local address than TLV mask bits flag. Test: config set pskc 445f2b5ca6f2a93a55ce570a70efeecb [done] start 192.168.9.2 49154 [done] diag query ipaddr fdce:bb1d:37f6:6978:0:ff:fe00:cc00 { "Ipv6 Addresses": [ "fdcebb1d37f66978000000fffe00fc31", "fdcebb1d37f66978000000fffe00fc11", "fdcebb1d37f66978000000fffe00fc10", "fdcebb1d37f66978000000fffe00fc38", "fd110022000000000effb88e150d6192", "fdcebb1d37f66978000000fffe00fc00", "fdcebb1d37f66978000000fffe00cc00", "fdcebb1d37f669786346d24762e87ba8", "fe80000000000000bcda411761f56516" ] } [done]
This PR adds DIAG_GET query command into the commissioner module, allowing users to query one or more diagnostic TLVs from a peer Thread device by setting the device's mesh local address than TLV mask bits flag. Test: config set pskc 445f2b5ca6f2a93a55ce570a70efeecb [done] start 192.168.9.2 49154 [done] diag query ipaddr fdce:bb1d:37f6:6978:0:ff:fe00:cc00 { "Ipv6 Addresses": [ "fdcebb1d37f66978000000fffe00fc31", "fdcebb1d37f66978000000fffe00fc11", "fdcebb1d37f66978000000fffe00fc10", "fdcebb1d37f66978000000fffe00fc38", "fd110022000000000effb88e150d6192", "fdcebb1d37f66978000000fffe00fc00", "fdcebb1d37f66978000000fffe00cc00", "fdcebb1d37f669786346d24762e87ba8", "fe80000000000000bcda411761f56516" ] } [done]
This PR adds DIAG_GET query command into the commissioner module, allowing users to query one or more diagnostic TLVs from a peer Thread device by setting the device's mesh local address than TLV mask bits flag. Test: config set pskc 445f2b5ca6f2a93a55ce570a70efeecb [done] start 192.168.9.2 49154 [done] diag query ipaddr fdce:bb1d:37f6:6978:0:ff:fe00:cc00 Peer Address: fd74:95e3:6ec:feee:0:ff:fe00:ac00 Content: { "Ipv6 Addresses": [ "fd74:95e3:06ec:feee:0000:00ff:fe00:fc36", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc11", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc10", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc38", "fd11:0022:0000:0000:99e7:cece:d50d:ae6b", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc00", "fd74:95e3:06ec:feee:0000:00ff:fe00:ac00", "fd74:95e3:06ec:feee:6142:033d:b087:2845", "fe80:0000:0000:0000:9cbb:e247:df46:9e70" ] } [done]
This PR adds DIAG_GET query command into the commissioner module, allowing users to query one or more diagnostic TLVs from a peer Thread device by setting the device's mesh local address than TLV mask bits flag. Test: config set pskc 445f2b5ca6f2a93a55ce570a70efeecb [done] start 192.168.9.2 49154 [done] diag query ipaddr fdce:bb1d:37f6:6978:0:ff:fe00:cc00 Peer Address: fd74:95e3:6ec:feee:0:ff:fe00:ac00 Content: { "Ipv6 Addresses": [ "fd74:95e3:06ec:feee:0000:00ff:fe00:fc36", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc11", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc10", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc38", "fd11:0022:0000:0000:99e7:cece:d50d:ae6b", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc00", "fd74:95e3:06ec:feee:0000:00ff:fe00:ac00", "fd74:95e3:06ec:feee:6142:033d:b087:2845", "fe80:0000:0000:0000:9cbb:e247:df46:9e70" ] } [done]
This PR adds DIAG_GET query command into the commissioner module, allowing users to query one or more diagnostic TLVs from a peer Thread device by setting the device's mesh local address than TLV mask bits flag. Test: config set pskc 445f2b5ca6f2a93a55ce570a70efeecb [done] start 192.168.9.2 49154 [done] diag query ipaddr fdce:bb1d:37f6:6978:0:ff:fe00:cc00 Peer Address: fd74:95e3:6ec:feee:0:ff:fe00:ac00 Content: { "Ipv6 Addresses": [ "fd74:95e3:06ec:feee:0000:00ff:fe00:fc36", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc11", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc10", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc38", "fd11:0022:0000:0000:99e7:cece:d50d:ae6b", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc00", "fd74:95e3:06ec:feee:0000:00ff:fe00:ac00", "fd74:95e3:06ec:feee:6142:033d:b087:2845", "fe80:0000:0000:0000:9cbb:e247:df46:9e70" ] } [done]
This PR adds DIAG_GET query command into the commissioner module, allowing users to query one or more diagnostic TLVs from a peer Thread device by setting the device's mesh local address than TLV mask bits flag. Test: config set pskc 445f2b5ca6f2a93a55ce570a70efeecb [done] start 192.168.9.2 49154 [done] diag query ipaddr fdce:bb1d:37f6:6978:0:ff:fe00:cc00 Peer Address: fd74:95e3:6ec:feee:0:ff:fe00:ac00 Content: { "Ipv6 Addresses": [ "fd74:95e3:06ec:feee:0000:00ff:fe00:fc36", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc11", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc10", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc38", "fd11:0022:0000:0000:99e7:cece:d50d:ae6b", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc00", "fd74:95e3:06ec:feee:0000:00ff:fe00:ac00", "fd74:95e3:06ec:feee:6142:033d:b087:2845", "fe80:0000:0000:0000:9cbb:e247:df46:9e70" ] } [done]
This PR adds DIAG_GET query command into the commissioner module, allowing users to query one or more diagnostic TLVs from a peer Thread device by setting the device's mesh local address than TLV mask bits flag. Test: config set pskc 445f2b5ca6f2a93a55ce570a70efeecb [done] start 192.168.9.2 49154 [done] diag query ipaddr fdce:bb1d:37f6:6978:0:ff:fe00:cc00 Peer Address: fd74:95e3:6ec:feee:0:ff:fe00:ac00 Content: { "Ipv6 Addresses": [ "fd74:95e3:06ec:feee:0000:00ff:fe00:fc36", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc11", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc10", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc38", "fd11:0022:0000:0000:99e7:cece:d50d:ae6b", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc00", "fd74:95e3:06ec:feee:0000:00ff:fe00:ac00", "fd74:95e3:06ec:feee:6142:033d:b087:2845", "fe80:0000:0000:0000:9cbb:e247:df46:9e70" ] } [done]
This PR adds DIAG_GET query command into the commissioner module, allowing users to query diagnostic TLV (ipv6Address) from a peer Thread device by setting the device's mesh local address than TLV mask bits flag. Test: config set pskc 445f2b5ca6f2a93a55ce570a70efeecb [done] start 192.168.9.2 49154 [done] diag query ipaddr fdce:bb1d:37f6:6978:0:ff:fe00:cc00 Peer Address: fd74:95e3:6ec:feee:0:ff:fe00:ac00 Content: { "Ipv6 Addresses": [ "fd74:95e3:06ec:feee:0000:00ff:fe00:fc36", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc11", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc10", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc38", "fd11:0022:0000:0000:99e7:cece:d50d:ae6b", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc00", "fd74:95e3:06ec:feee:0000:00ff:fe00:ac00", "fd74:95e3:06ec:feee:6142:033d:b087:2845", "fe80:0000:0000:0000:9cbb:e247:df46:9e70" ] } [done]
This PR adds DIAG_GET query command into the commissioner module, allowing users to query diagnostic TLV (ipv6Address) from a peer Thread device by setting the device's mesh local address than TLV mask bits flag. Test: config set pskc 445f2b5ca6f2a93a55ce570a70efeecb [done] start 192.168.9.2 49154 [done] diag query ipaddr fdce:bb1d:37f6:6978:0:ff:fe00:cc00 Peer Address: fd74:95e3:6ec:feee:0:ff:fe00:ac00 Content: { "Ipv6 Addresses": [ "fd74:95e3:06ec:feee:0000:00ff:fe00:fc36", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc11", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc10", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc38", "fd11:0022:0000:0000:99e7:cece:d50d:ae6b", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc00", "fd74:95e3:06ec:feee:0000:00ff:fe00:ac00", "fd74:95e3:06ec:feee:6142:033d:b087:2845", "fe80:0000:0000:0000:9cbb:e247:df46:9e70" ] } [done]
This PR adds DIAG_GET query command into the commissioner module, allowing users to query diagnostic TLV (ipv6Address) from a peer Thread device by setting the device's mesh local address than TLV mask bits flag. Test: config set pskc 445f2b5ca6f2a93a55ce570a70efeecb [done] start 192.168.9.2 49154 [done] diag query ipaddr fdce:bb1d:37f6:6978:0:ff:fe00:cc00 Peer Address: fd74:95e3:6ec:feee:0:ff:fe00:ac00 Content: { "Ipv6 Addresses": [ "fd74:95e3:06ec:feee:0000:00ff:fe00:fc36", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc11", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc10", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc38", "fd11:0022:0000:0000:99e7:cece:d50d:ae6b", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc00", "fd74:95e3:06ec:feee:0000:00ff:fe00:ac00", "fd74:95e3:06ec:feee:6142:033d:b087:2845", "fe80:0000:0000:0000:9cbb:e247:df46:9e70" ] } [done]
This PR adds DIAG_GET query command into the commissioner module, allowing users to query diagnostic TLV (ipv6Address) from a peer Thread device by setting the device's mesh local address than TLV mask bits flag. Test: config set pskc 445f2b5ca6f2a93a55ce570a70efeecb [done] start 192.168.9.2 49154 [done] diag query ipaddr fdce:bb1d:37f6:6978:0:ff:fe00:cc00 Peer Address: fd74:95e3:6ec:feee:0:ff:fe00:ac00 Content: { "Ipv6 Addresses": [ "fd74:95e3:06ec:feee:0000:00ff:fe00:fc36", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc11", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc10", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc38", "fd11:0022:0000:0000:99e7:cece:d50d:ae6b", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc00", "fd74:95e3:06ec:feee:0000:00ff:fe00:ac00", "fd74:95e3:06ec:feee:6142:033d:b087:2845", "fe80:0000:0000:0000:9cbb:e247:df46:9e70" ] } [done]
* @param[in] aDiagAnsMsg Parsed DiagTlvs data. | ||
* | ||
*/ | ||
virtual void OnDiagGetAnswerMessage(const std::string &aDestAddress, const NetDiagData &aDiagAnsMsg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other callbacks use the name aPeerAddr
for the device which sends the response, can we follow the naming here?
virtual void OnDiagGetAnswerMessage(const std::string &aDestAddress, const NetDiagData &aDiagAnsMsg) | |
virtual void OnDiagGetAnswerMessage(const std::string &aPeerAddr, const NetDiagData &aDiagAnsMsg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
/** | ||
* @brief IPv6 Addresses List | ||
*/ | ||
struct Ipv6AddressList |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class is not necessary, please remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this data structure will be reused into the ChildIpv6Address
, which includes the child's rloc16
and Ipv6AddressList
two fields, we could reuse this data structure decode function into the ChildIpv6Address
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't ChildIpv6Address
use std::vector<std::string>
directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is more reasonable for Ipv6AddressList
as a sub structure of ChildIpv6Address
and NetDiagData
.
* meaningful only when associative PresentFlags is included in | ||
* `mPresentFlags`. | ||
*/ | ||
struct NetDiagData |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intended that this class is almost empty? I think it should include all possible fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the previous PR is too large with all possible fields, can we split them into some small PR for code review?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
But it's better to review and submit the NetDiagData definition and decoding before providing an API to request for NetDiagData. Let me know when you get the NetDiagData class PR ready.
I am stopping reviewing this CL now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, let me provide a new PR for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new PR #303 is ready for your comments, Thanks.
This PR adds DIAG_GET query command into the commissioner module, allowing users to query diagnostic TLV (ipv6Address) from a peer Thread device by setting the device's mesh local address than TLV mask bits flag. Test: config set pskc 445f2b5ca6f2a93a55ce570a70efeecb [done] start 192.168.9.2 49154 [done] diag query ipaddr fdce:bb1d:37f6:6978:0:ff:fe00:cc00 Peer Address: fd74:95e3:6ec:feee:0:ff:fe00:ac00 Content: { "Ipv6 Addresses": [ "fd74:95e3:06ec:feee:0000:00ff:fe00:fc36", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc11", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc10", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc38", "fd11:0022:0000:0000:99e7:cece:d50d:ae6b", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc00", "fd74:95e3:06ec:feee:0000:00ff:fe00:ac00", "fd74:95e3:06ec:feee:6142:033d:b087:2845", "fe80:0000:0000:0000:9cbb:e247:df46:9e70" ] } [done]
This PR adds DIAG_GET query command into the commissioner module, allowing users to query diagnostic TLV (ipv6Address) from a peer Thread device by setting the device's mesh local address than TLV mask bits flag. Test: config set pskc 445f2b5ca6f2a93a55ce570a70efeecb [done] start 192.168.9.2 49154 [done] diag query ipaddr fdce:bb1d:37f6:6978:0:ff:fe00:cc00 Peer Address: fd74:95e3:6ec:feee:0:ff:fe00:ac00 Content: { "Ipv6 Addresses": [ "fd74:95e3:06ec:feee:0000:00ff:fe00:fc36", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc11", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc10", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc38", "fd11:0022:0000:0000:99e7:cece:d50d:ae6b", "fd74:95e3:06ec:feee:0000:00ff:fe00:fc00", "fd74:95e3:06ec:feee:0000:00ff:fe00:ac00", "fd74:95e3:06ec:feee:6142:033d:b087:2845", "fe80:0000:0000:0000:9cbb:e247:df46:9e70" ] } [done]
…pdated accordingly
closed this PR and created a new PR #304 |
This PR adds DIAG_GET query command into the commissioner module, allowing users to query diagnostic TLV (Ipv6Address) from a peer Thread device by setting the device's mesh local address than TLV mask bits flag.
Test:
config set pskc 445f2b5ca6f2a93a55ce570a70efeecb
[done]
start 192.168.9.2 49154
[done]
diag query ipaddr fdce:bb1d:37f6:6978:0:ff:fe00:cc00
Peer Address: fd74:95e3:6ec:feee:0:ff:fe00:ac00
Content: {
"Ipv6 Addresses": [
"fd74:95e3:06ec:feee:0000:00ff:fe00:fc36",
"fd74:95e3:06ec:feee:0000:00ff:fe00:fc11",
"fd74:95e3:06ec:feee:0000:00ff:fe00:fc10",
"fd74:95e3:06ec:feee:0000:00ff:fe00:fc38",
"fd11:0022:0000:0000:99e7:cece:d50d:ae6b",
"fd74:95e3:06ec:feee:0000:00ff:fe00:fc00",
"fd74:95e3:06ec:feee:0000:00ff:fe00:ac00",
"fd74:95e3:06ec:feee:6142:033d:b087:2845",
"fe80:0000:0000:0000:9cbb:e247:df46:9e70"
]
}
[done]