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

TLV to JSON Converter #15440

Merged
merged 2 commits into from
Mar 3, 2022
Merged

Conversation

mrjerryjohns
Copy link
Contributor

This adds a TLV to JSON converter to provide a means to deal with TLV in a more human-readable format. This does not rely on any schema information and instead, just dumps out raw TLV present in cluster payloads into a JSON format.

This relies on the jsoncpp third party library.

Testing

Added a unit-test.

This adds a TLV to JSON converter to provide a means to deal with TLV in
a more human-readable format for various purposes.
@github-actions
Copy link

github-actions bot commented Feb 23, 2022

PR #15440: Size comparison from 1fc5eed to 2a76f5c

Full report (26 builds for cyw30739, efr32, k32w, linux, p6, qpg, telink)
platform target config section 1fc5eed 2a76f5c change % change
cyw30739 light cyw930739m2evb_01 (read/write) 598686 598686 0 0.0
.app_xip_area 503492 503492 0 0.0
.bss 77884 77884 0 0.0
.data 652 652 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 556722 556722 0 0.0
.app_xip_area 463072 463072 0 0.0
.bss 76380 76380 0 0.0
.data 616 616 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 577778 577778 0 0.0
.app_xip_area 474696 474696 0 0.0
.bss 85484 85484 0 0.0
.data 560 560 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 915732 915732 0 0.0
(read/write) 128648 128648 0 0.0
.bss 126600 126600 0 0.0
.data 2048 2048 0 0.0
.text 915724 915724 0 0.0
BRD4161A+rpc (read only) 944432 944432 0 0.0
(read/write) 145568 145568 0 0.0
.bss 143376 143376 0 0.0
.data 2188 2188 0 0.0
.text 944424 944424 0 0.0
window-app BRD4161A (read only) 850024 850024 0 0.0
(read/write) 126552 126552 0 0.0
.bss 124632 124632 0 0.0
.data 1916 1916 0 0.0
.text 850016 850016 0 0.0
k32w light k32w061+release (read/write) 691420 691420 0 0.0
.bss 77520 77520 0 0.0
.data 1924 1924 0 0.0
.text 606176 606176 0 0.0
lock k32w061+release (read/write) 694180 694180 0 0.0
.bss 77720 77720 0 0.0
.data 1964 1964 0 0.0
.text 608696 608696 0 0.0
linux all-clusters-app debug (read only) 2393137 2393137 0 0.0
(read/write) 148560 148560 0 0.0
.bss 62944 62944 0 0.0
.data 1360 1360 0 0.0
.data.rel.ro 78552 78552 0 0.0
.dynamic 592 592 0 0.0
.got 4160 4160 0 0.0
.init 27 27 0 0.0
.init_array 904 904 0 0.0
.rodata 206501 206501 0 0.0
.text 2023314 2023314 0 0.0
bridge-app debug+rpc (read only) 1716293 1716293 0 0.0
(read/write) 93824 93824 0 0.0
.bss 48480 48480 0 0.0
.data 2042 2042 0 0.0
.data.rel.ro 38232 38232 0 0.0
.dynamic 592 592 0 0.0
.got 3912 3912 0 0.0
.init 27 27 0 0.0
.init_array 536 536 0 0.0
.rodata 140596 140596 0 0.0
.text 1459653 1459653 0 0.0
chip-tool debug (read only) 9153661 9153661 0 0.0
(read/write) 321592 321592 0 0.0
.bss 41024 41024 0 0.0
.data 1164 1164 0 0.0
.data.rel.ro 273352 273352 0 0.0
.dynamic 608 608 0 0.0
.got 4784 4784 0 0.0
.init 27 27 0 0.0
.init_array 624 624 0 0.0
.rodata 479829 479829 0 0.0
.text 8011669 8011669 0 0.0
chip-tool-ipv6only arm64 (read only) 8864436 8864436 0 0.0
(read/write) 434705 434705 0 0.0
.bss 59265 59265 0 0.0
.data 1216 1216 0 0.0
.data.rel.ro 319024 319024 0 0.0
.dynamic 560 560 0 0.0
.got 51392 51392 0 0.0
.init 24 24 0 0.0
.init_array 208 208 0 0.0
.rodata 456556 456556 0 0.0
.text 7489556 7489556 0 0.0
door-lock-app debug (read only) 1931633 1931633 0 0.0
(read/write) 119928 119928 0 0.0
.bss 51168 51168 0 0.0
.data 1050 1050 0 0.0
.data.rel.ro 62352 62352 0 0.0
.dynamic 592 592 0 0.0
.got 4096 4096 0 0.0
.init 27 27 0 0.0
.init_array 656 656 0 0.0
.rodata 172252 172252 0 0.0
.text 1610610 1610610 0 0.0
lighting-app debug+rpc (read only) 2061017 2061017 0 0.0
(read/write) 124840 124840 0 0.0
.bss 52128 52128 0 0.0
.data 1408 1408 0 0.0
.data.rel.ro 65856 65856 0 0.0
.dynamic 608 608 0 0.0
.got 4128 4128 0 0.0
.init 27 27 0 0.0
.init_array 704 704 0 0.0
.rodata 164721 164721 0 0.0
.text 1741394 1741394 0 0.0
ota-provider-app debug (read only) 1864961 1864961 0 0.0
(read/write) 115592 115592 0 0.0
.bss 51008 51008 0 0.0
.data 1288 1288 0 0.0
.data.rel.ro 57672 57672 0 0.0
.dynamic 608 608 0 0.0
.got 4352 4352 0 0.0
.init 27 27 0 0.0
.init_array 608 608 0 0.0
.rodata 157043 157043 0 0.0
.text 1557042 1557042 0 0.0
ota-requestor-app debug (read only) 1877441 1877441 0 0.0
(read/write) 117392 117392 0 0.0
.bss 51872 51872 0 0.0
.data 1192 1192 0 0.0
.data.rel.ro 58936 58936 0 0.0
.dynamic 592 592 0 0.0
.got 4152 4152 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 151236 151236 0 0.0
.text 1577010 1577010 0 0.0
shell debug (read only) 2361593 2361593 0 0.0
(read/write) 151072 151072 0 0.0
.bss 71296 71296 0 0.0
.data 864 864 0 0.0
.data.rel.ro 73280 73280 0 0.0
.dynamic 592 592 0 0.0
.got 4144 4144 0 0.0
.init 27 27 0 0.0
.init_array 888 888 0 0.0
.rodata 206770 206770 0 0.0
.text 1997714 1997714 0 0.0
thermostat-no-ble arm64 (read only) 2160188 2160188 0 0.0
(read/write) 149873 149873 0 0.0
.bss 66433 66433 0 0.0
.data 1056 1056 0 0.0
.data.rel.ro 75216 75216 0 0.0
.dynamic 560 560 0 0.0
.got 4208 4208 0 0.0
.init 24 24 0 0.0
.init_array 352 352 0 0.0
.rodata 132684 132684 0 0.0
.text 1808800 1808800 0 0.0
tv-app debug (read only) 2586969 2586969 0 0.0
(read/write) 152176 152176 0 0.0
.bss 69120 69120 0 0.0
.data 3168 3168 0 0.0
.data.rel.ro 73864 73864 0 0.0
.dynamic 592 592 0 0.0
.got 4528 4528 0 0.0
.init 27 27 0 0.0
.init_array 872 872 0 0.0
.rodata 199741 199741 0 0.0
.text 2212770 2212770 0 0.0
p6 all-clusters-app default (read/write) 2490336 2490336 0 0.0
.bss 122400 122400 0 0.0
.data 2688 2688 0 0.0
.text 1448600 1448600 0 0.0
light-app default (read/write) 2394312 2394312 0 0.0
.bss 113648 113648 0 0.0
.data 2536 2536 0 0.0
.text 1352576 1352576 0 0.0
lock-app default (read/write) 2357888 2357888 0 0.0
.bss 113400 113400 0 0.0
.data 2496 2496 0 0.0
.text 1316152 1316152 0 0.0
qpg lighting-app qpg6105+debug (read only) 600300 600300 0 0.0
(read/write) 146936 146936 0 0.0
.bss 90936 90936 0 0.0
.data 1124 1124 0 0.0
.text 594980 594980 0 0.0
lock-app qpg6105+debug (read only) 566068 566068 0 0.0
(read/write) 146936 146936 0 0.0
.bss 90944 90944 0 0.0
.data 1076 1076 0 0.0
.text 560748 560748 0 0.0
persistent-storage-app qpg6105+debug (read only) 99536 99536 0 0.0
(read/write) 146941 146941 0 0.0
.bss 24001 24001 0 0.0
.data 180 180 0 0.0
.text 94216 94216 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 881386 881386 0 0.0
bss 86372 86372 0 0.0
noinit 37160 37160 0 0.0
text 622700 622700 0 0.0

@lazarkov
Copy link
Contributor

Hi @mrjerryjohns does this help out in delivering manufacture specific clusters?

Manufacture specific clusters need to have custom commands. And the commands for those clusters probably need to be created dynamically - on the fly. (Not as today with xml+zap+script etc.)
https://github.com/lazarkov/connectedhomeip-spec/blob/master/src/data_model/Data-Model.adoc#16-non-standard

@woody-apple
Copy link
Contributor

Fast tracking, given this has had enough time for review.

@mrjerryjohns
Copy link
Contributor Author

Hi @mrjerryjohns does this help out in delivering manufacture specific clusters?
Manufacture specific clusters need to have custom commands. And the commands for those clusters probably need to be created dynamically - on the fly. (Not as today with xml+zap+script etc.)
https://github.com/lazarkov/connectedhomeip-spec/blob/master/src/data_model/Data-Model.adoc#16-non-standard

Not quite. Will follow up with you offline to enumerate the options.

@mrjerryjohns mrjerryjohns merged commit 45be5cf into project-chip:master Mar 3, 2022
woody-apple added a commit that referenced this pull request Mar 3, 2022
woody-apple added a commit that referenced this pull request Mar 3, 2022

} // namespace

nlTestSuite theSuite = { "TlvJson", sTests, Initialize, Finalize };
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be in the anonymous namespace, too. Otherwise, it conflicts with other tests when all tests are linked into a single binary.

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

Successfully merging this pull request may close these issues.

5 participants