openthread / ot-commissioner

OpenThread Commissioner, a Thread commissioner for joining new Thread devices and managing Thread networks.
https://openthread.io/
BSD 3-Clause "New" or "Revised" License
49 stars 36 forks source link

[api] remove the `XpanId` and `PanId` structs #264

Closed wgtdkp closed 3 months ago

wgtdkp commented 4 months ago

It's an overkill to define a dedicated class/struct for a simple uint16_t just for pretty print to json in HEX string.

The library interface should prefer native/primitive data types for better interoperability with other languages such as java and Objective-C

This commit basically reverts the XpanId and PanId changes introduced in https://github.com/openthread/ot-commissioner/pull/202

codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 76.08696% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 72.83%. Comparing base (79d1ddc) to head (143953c). Report is 1 commits behind head on main.

:exclamation: Current head 143953c differs from pull request most recent head 5cb6cc8. Consider uploading reports for the commit 5cb6cc8 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #264 +/- ## ========================================== - Coverage 72.88% 72.83% -0.05% ========================================== Files 72 72 Lines 7500 7476 -24 ========================================== - Hits 5466 5445 -21 + Misses 2034 2031 -3 ``` | [Files](https://app.codecov.io/gh/openthread/ot-commissioner/pull/264?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openthread) | Coverage Δ | | |---|---|---| | [src/app/commissioner\_app.hpp](https://app.codecov.io/gh/openthread/ot-commissioner/pull/264?src=pr&el=tree&filepath=src%2Fapp%2Fcommissioner_app.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openthread#diff-c3JjL2FwcC9jb21taXNzaW9uZXJfYXBwLmhwcA==) | `100.00% <ø> (ø)` | | | [src/app/json.cpp](https://app.codecov.io/gh/openthread/ot-commissioner/pull/264?src=pr&el=tree&filepath=src%2Fapp%2Fjson.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openthread#diff-c3JjL2FwcC9qc29uLmNwcA==) | `81.26% <100.00%> (-0.18%)` | :arrow_down: | | [src/app/ps/registry.cpp](https://app.codecov.io/gh/openthread/ot-commissioner/pull/264?src=pr&el=tree&filepath=src%2Fapp%2Fps%2Fregistry.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openthread#diff-c3JjL2FwcC9wcy9yZWdpc3RyeS5jcHA=) | `89.67% <100.00%> (+0.05%)` | :arrow_up: | | [src/app/ps/registry\_entries.cpp](https://app.codecov.io/gh/openthread/ot-commissioner/pull/264?src=pr&el=tree&filepath=src%2Fapp%2Fps%2Fregistry_entries.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openthread#diff-c3JjL2FwcC9wcy9yZWdpc3RyeV9lbnRyaWVzLmNwcA==) | `98.30% <100.00%> (+1.12%)` | :arrow_up: | | [src/app/ps/registry\_entries.hpp](https://app.codecov.io/gh/openthread/ot-commissioner/pull/264?src=pr&el=tree&filepath=src%2Fapp%2Fps%2Fregistry_entries.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openthread#diff-c3JjL2FwcC9wcy9yZWdpc3RyeV9lbnRyaWVzLmhwcA==) | `100.00% <ø> (ø)` | | | [src/common/error.cpp](https://app.codecov.io/gh/openthread/ot-commissioner/pull/264?src=pr&el=tree&filepath=src%2Fcommon%2Ferror.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openthread#diff-c3JjL2NvbW1vbi9lcnJvci5jcHA=) | `96.00% <100.00%> (ø)` | | | [src/common/utils.hpp](https://app.codecov.io/gh/openthread/ot-commissioner/pull/264?src=pr&el=tree&filepath=src%2Fcommon%2Futils.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openthread#diff-c3JjL2NvbW1vbi91dGlscy5ocHA=) | `100.00% <100.00%> (ø)` | | | [src/library/network\_data.cpp](https://app.codecov.io/gh/openthread/ot-commissioner/pull/264?src=pr&el=tree&filepath=src%2Flibrary%2Fnetwork_data.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openthread#diff-c3JjL2xpYnJhcnkvbmV0d29ya19kYXRhLmNwcA==) | `74.64% <ø> (-4.74%)` | :arrow_down: | | [src/app/cli/interpreter.cpp](https://app.codecov.io/gh/openthread/ot-commissioner/pull/264?src=pr&el=tree&filepath=src%2Fapp%2Fcli%2Finterpreter.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openthread#diff-c3JjL2FwcC9jbGkvaW50ZXJwcmV0ZXIuY3Bw) | `79.40% <75.00%> (-0.07%)` | :arrow_down: | | [src/app/ps/persistent\_storage\_json.cpp](https://app.codecov.io/gh/openthread/ot-commissioner/pull/264?src=pr&el=tree&filepath=src%2Fapp%2Fps%2Fpersistent_storage_json.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openthread#diff-c3JjL2FwcC9wcy9wZXJzaXN0ZW50X3N0b3JhZ2VfanNvbi5jcHA=) | `58.94% <50.00%> (ø)` | | | ... and [5 more](https://app.codecov.io/gh/openthread/ot-commissioner/pull/264?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openthread) | |
wgtdkp commented 3 months ago

@abtink I am not sure if you are willing to review the ot-commissioner changes :)

In case no, please feel free to remove yourself from the pending list, I can wait for rongli :)