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

Restyle Some conversions to use PacketBufferHandle #3915

Closed
wants to merge 5 commits into from

Conversation

restyled-io[bot]
Copy link
Contributor

@restyled-io restyled-io bot commented Nov 18, 2020

A duplicate of #3909 with additional commits that automatically address
incorrect style, created by Restyled.

Since the original Pull Request was opened as a fork in a contributor's
repository, we are unable to create a Pull Request branching from it with only
the style fixes.

The following Restylers made fixes:

  • clang-format

To incorporate these changes, you can either:

  1. Merge this Pull Request instead of the original, or

  2. Ask your contributor to locally incorporate these commits and push them to
    the original Pull Request

    Expand for example instructions
    ```console
    git remote add upstream https://github.com/project-chip/connectedhomeip.git
    git fetch upstream pull/<this PR number>/head
    git merge --ff-only FETCH_HEAD
    git push
    ```
    

NOTE: As work continues on the original Pull Request, this process will
re-run and update (force-push) this Pull Request with updated style fixes as
necessary. If the style is fixed manually at any point (i.e. this process finds
no fixes to make), this Pull Request will be closed automatically.

Sorry if this was unexpected. To disable it, see our documentation.

kpschoedel and others added 5 commits November 18, 2020 13:26
#### Problem

Code should use `PacketBufferHandle` rather than `PacketBuffer *`.

#### Summary of Changes

This PR focuses on converting various message-received functions'
arguments from `PacketBuffer*` to `PacketBufferHandle`, notably:

- Rename `PacketBufferHandle::Clone()` to `Retain()` for clarity
- `Base::HandleMessageReceived()` and associated types and impls
- `IPEndPointBasis::HandleDataReceived()` and impls
- `Device::OnMessageReceived()`
- `ChipDeviceController::OnMessage()`
- `SecureSessionMgrDelegate::OnMessageReceived()`
- `BleEndPoint::Receive()` and related
- `SecurePairingSession::HandlePeerMessage()`
- `RendezvousServer::OnRendezvousMessageReceived()`
- `chip-tool` command functions
- `ExchangeContext` receive functions

Some arguments and variables are named with `_ForNow` to indicate that
they will be replaced in a future conversion step.

Part of issue #2707 - Figure out a way to express PacketBuffer ownership in the type system
@github-actions
Copy link

Size increase report for "esp32-example-build" from 18badf3

File Section File VM
chip-all-clusters-app.elf .flash.text 256 256
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,9192
.debug_line,0,4789
.debug_loc,0,2203
.debug_ranges,0,1344
.debug_abbrev,0,1085
.flash.text,256,256
.debug_str,0,248
.debug_frame,0,192
.strtab,0,118
.xt.prop._ZN4chip28SecurePairingUsingTestSecret17HandlePeerMessageERKNS_12PacketHeaderENS_6System18PacketBufferHandleE,0,76
.debug_aranges,0,64
.xt.lit._ZN4chip9Transport5TupleIJNS0_3UDPES2_EE11SendMessageERKNS_12PacketHeaderENS_8BitFlagsItNS_6Header10FlagValuesEEERKNS0_11PeerAddressEPNS_6System12PacketBufferE,0,40
.xt.prop._ZN4chip9Transport3UDP13CanSendToPeerERKNS0_11PeerAddressE,0,40
.symtab,0,16
.shstrtab,0,2
.xt.prop._ZN4chip8Encoding12LittleEndian7Write32ERPhj,0,-1
.xt.prop._ZN4chip28SecurePairingUsingTestSecret17HandlePeerMessageERKNS_12PacketHeaderEPNS_6System12PacketBufferE,0,-76
.xt.prop._ZN4chip8BufBound3PutEPKvj,0,-80


@github-actions
Copy link

Size increase report for "nrfconnect-example-build" from 18badf3

File Section File VM
chip-lock.elf text 356 356
chip-lock.elf shell_root_cmds_sections -4 -4
chip-lighting.elf text 360 360
chip-lighting.elf shell_root_cmds_sections -8 -8
chip-shell.elf text 212 212
chip-shell.elf log_const_sections -4 -4
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

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

sections,vmsize,filesize
.debug_info,0,6144
.debug_line,0,1971
.debug_ranges,0,704
.debug_loc,0,541
.debug_abbrev,0,453
.debug_str,0,423
text,356,356
.debug_frame,0,164
.strtab,0,158
.debug_aranges,0,48
.symtab,0,32
.shstrtab,0,-2
shell_root_cmds_sections,-4,-4

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

sections,vmsize,filesize
.debug_info,0,6112
.debug_line,0,1967
.debug_ranges,0,704
.debug_loc,0,545
.debug_abbrev,0,453
.debug_str,0,423
text,360,360
.debug_frame,0,164
.strtab,0,158
.debug_aranges,0,48
.symtab,0,32
.shstrtab,0,-2
shell_root_cmds_sections,-8,-8

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

sections,vmsize,filesize
.debug_info,0,4281
.debug_line,0,1485
.debug_loc,0,660
.debug_ranges,0,496
.debug_abbrev,0,334
.debug_str,0,332
text,212,212
.debug_frame,0,116
.strtab,0,88
.debug_aranges,0,32
.symtab,0,32
log_const_sections,-4,-4


@restyled-io restyled-io bot closed this Nov 18, 2020
@restyled-io restyled-io bot deleted the restyled/pull-3909 branch November 18, 2020 21:03
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.

2 participants