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

Make the attribute access Read method a bit easier to implement. #9976

Conversation

bzbarsky-apple
Copy link
Contributor

Consumers should not have to worry about what the right TLV tag is for
the attribute value, or exactly how to put their data into the TLV
writer. We can use a partially applied version of the Encode generic
for this.

Fixes: #9938

Also fixes an issue around the handling of null TLVWriter and the
apDataExists outparam in ReadSingleClusterData.

Problem

See above.

Change overview

See above.

Testing

No behavior changes apart from fixing the (not exercised by anything so far) null TLVWriter and non-null apDataExists bits. Passes existing tests.

@todo
Copy link

todo bot commented Sep 25, 2021

Add DataVersion support

// TODO: Add DataVersion support
ReturnErrorOnFailure(
apWriter->Put(chip::TLV::ContextTag(AttributeDataElement::kCsTag_DataVersion), kTemporaryDataVersion));
}
return CHIP_NO_ERROR;
}
}


This comment was generated by todo based on a TODO comment in 2782de5 in #9976. cc @bzbarsky-apple.

Consumers should not have to worry about what the right TLV tag is for
the attribute value, or exactly how to put their data into the TLV
writer.  We can use a partially applied version of the Encode generic
for this.

Fixes: project-chip#9938

Also fixes an issue around the handling of null TLVWriter and the
apDataExists outparam in ReadSingleClusterData.
@bzbarsky-apple bzbarsky-apple force-pushed the simpler-attr-encoder-interface branch from 2782de5 to daa17e3 Compare September 27, 2021 20:55
@github-actions
Copy link

Size increase report for "gn_qpg-example-build" from 45c7a41

File Section File VM
chip-qpg6100-lighting-example.out .text 192 192
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-qpg6100-lighting-example.out.map and ./pull_artifact/chip-qpg6100-lighting-example.out.map:

BLOAT EXECUTION FAILED WITH CODE 1:
bloaty: unknown file type for file './pull_artifact/chip-qpg6100-lighting-example.out.map'

Comparing ./master_artifact/chip-qpg6100-lighting-example.out and ./pull_artifact/chip-qpg6100-lighting-example.out:

sections,vmsize,filesize
.debug_line,0,7359
.debug_info,0,6184
.debug_str,0,1783
.strtab,0,488
.text,192,192
.debug_abbrev,0,190
.symtab,0,176
.debug_frame,0,148
.debug_aranges,0,40
[Unmapped],0,-192
.debug_ranges,0,-888
.debug_loc,0,-1808


@github-actions
Copy link

Size increase report for "esp32-example-build" from 45c7a41

File Section File VM
chip-all-clusters-app.elf .flash.text 60 60
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-all-clusters-app.elf and ./pull_artifact/chip-all-clusters-app.elf:

sections,vmsize,filesize
.debug_info,0,11766
.debug_line,0,8733
.debug_str,0,1274
.debug_abbrev,0,940
.debug_loc,0,494
.debug_ranges,0,200
.strtab,0,69
.flash.text,60,60
.shstrtab,0,3
.riscv.attributes,0,-3
.debug_frame,0,-8
[Unmapped],0,-60


@github-actions
Copy link

Size increase report for "nrfconnect-example-build" from 45c7a41

File Section File VM
chip-lock.elf text 192 192
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-shell.elf and ./pull_artifact/chip-shell.elf:

sections,vmsize,filesize
.debug_line,0,4535
.debug_info,0,2535
.debug_str,0,1702
.debug_frame,0,148
.debug_abbrev,0,58
.debug_aranges,0,40
.shstrtab,0,1
.symtab,0,-16
.strtab,0,-29
.debug_ranges,0,-1016
.debug_loc,0,-2234

Comparing ./master_artifact/chip-lock.elf and ./pull_artifact/chip-lock.elf:

sections,vmsize,filesize
.debug_info,0,6559
.debug_line,0,5823
.debug_str,0,1771
.strtab,0,488
text,192,192
.debug_abbrev,0,186
.symtab,0,176
.debug_frame,0,148
.debug_aranges,0,40
.debug_ranges,0,-888
.debug_loc,0,-1759


@bzbarsky-apple bzbarsky-apple merged commit 3e86fbb into project-chip:master Sep 27, 2021
@bzbarsky-apple bzbarsky-apple deleted the simpler-attr-encoder-interface branch September 27, 2021 22:11
andy31415 pushed a commit that referenced this pull request Sep 29, 2021
Consumers should not have to worry about what the right TLV tag is for
the attribute value, or exactly how to put their data into the TLV
writer.  We can use a partially applied version of the Encode generic
for this.

Fixes: #9938

Also fixes an issue around the handling of null TLVWriter and the
apDataExists outparam in ReadSingleClusterData.
mkardous-silabs pushed a commit to mkardous-silabs/connectedhomeip that referenced this pull request Oct 15, 2021
…ject-chip#9976)

Consumers should not have to worry about what the right TLV tag is for
the attribute value, or exactly how to put their data into the TLV
writer.  We can use a partially applied version of the Encode generic
for this.

Fixes: project-chip#9938

Also fixes an issue around the handling of null TLVWriter and the
apDataExists outparam in ReadSingleClusterData.
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.

Add a typedef for ContextTag(AttributeDataElement::kCsTag_Data)
6 participants