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

Convert 'echo' command to a manufacturer specific 'ping' command #4127

Merged
merged 1 commit into from
Dec 11, 2020

Conversation

vivien-apple
Copy link
Contributor

Problem

The echo command is an hand rolled command. It has been super useful but currently, in its current shape, it is a pain as it make some part of the code harder to write while it will never really be used as it is in an end product.

This PR replace echo by a ping manufacturer specific command. This is nice because if add supports for some part of the code that where not used until then, notably the manufacturer specific side of ZCL clusters, and it removes the need for some special handling support in various places.

The changes in examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h has been done using AppBuilder while the rest of the gen/ changes has been done using ZAP.

Summary of Changes

  • Add a manufacturer specific command to the all-clusters-app configuration
  • Update src/app/zap-templates/call-command-handler-src.zapt to support manufacturer specific command
  • Remove echo command support in examples/common/chip-app-server
  • Simplify chip-tool by killing the EchoCommand class
  • Simplify chip-tool by mergin the NetworkCommand and ModelCommand classes together

@@ -2822,4 +2830,4 @@
"networkId": 1
}
]
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can we keep newlines at EOF to eliminate this kind of noise in PRs?

Copy link
Contributor

Choose a reason for hiding this comment

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

Does restyler-whitespace fix this, so we could just run that on .zap files?

@vivien-apple
Copy link
Contributor Author

Pushed an update to resolve merge conflicts.

@github-actions
Copy link

Size increase report for "esp32-example-build" from 97a07fb

File Section File VM
chip-all-clusters-app.elf .flash.rodata 8 8
chip-all-clusters-app.elf .flash.text -272 -272
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,2132
.xt.lit._ZNK4chip8OptionalIyE5ValueEv,0,40
.flash.rodata,8,8
.xt.prop._ZTVN4chip11DeviceLayer37DeviceNetworkProvisioningDelegateImplE,0,2
[Unmapped],0,-8
.debug_aranges,0,-16
.symtab,0,-16
.xt.prop._ZNK4chip20RendezvousParameters12IsControllerEv,0,-40
.debug_frame,0,-48
.debug_ranges,0,-72
.strtab,0,-208
.debug_str,0,-254
.debug_abbrev,0,-261
.flash.text,-272,-272
.debug_loc,0,-2055
.debug_line,0,-3140


@@ -2822,4 +2830,4 @@
"networkId": 1
}
]
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Does restyler-whitespace fix this, so we could just run that on .zap files?

@bzbarsky-apple
Copy link
Contributor

@vivien-apple Please rebase to tip to retrigger CI on top of the pigweed fixes?

Copy link
Contributor

@bzbarsky-apple bzbarsky-apple left a comment

Choose a reason for hiding this comment

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

This just sends back a status response, unlike the existing echo command, which responds with the incoming data, right? Why that change?

examples/chip-tool/commands/clusters/ModelCommand.cpp Outdated Show resolved Hide resolved
@vivien-apple
Copy link
Contributor Author

This just sends back a status response, unlike the existing echo command, which responds with the incoming data, right? Why that change?

You are right.
There are 2 reasons why I did that:

  1. The first one is that there is already an echo protocol now. I'm not saying I'm happy with that but since it is there it would not make sense to duplicate it.
  2. The second is because I felt like the goal of echo at the beginning was to make sure the data is encoded/decoded properly. Since ping will be encrypted/decrypted already, and since the command will be parse on both ends, it just seems redundant.

@github-actions
Copy link

Size increase report for "nrfconnect-example-build" from 27d3ea8

File Section File VM
chip-lighting.elf shell_root_cmds_sections 4 4
chip-lighting.elf rodata -64 -68
chip-lighting.elf text -340 -340
chip-lock.elf shell_root_cmds_sections 4 4
chip-lock.elf rodata -64 -68
chip-lock.elf text -340 -340
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

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

sections,vmsize,filesize
.debug_loc,0,832
.debug_info,0,172
shell_root_cmds_sections,4,4
.shstrtab,0,2
.debug_aranges,0,-24
.debug_ranges,0,-40
.debug_line,0,-56
rodata,-68,-64
.debug_frame,0,-96
.symtab,0,-176
.strtab,0,-286
text,-340,-340
.debug_str,0,-364
.debug_abbrev,0,-376

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

sections,vmsize,filesize

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

sections,vmsize,filesize
.debug_loc,0,840
.debug_info,0,172
shell_root_cmds_sections,4,4
.shstrtab,0,-2
.debug_aranges,0,-24
.debug_ranges,0,-40
.debug_line,0,-56
rodata,-68,-64
.debug_frame,0,-96
.symtab,0,-176
.strtab,0,-286
text,-340,-340
.debug_str,0,-364
.debug_abbrev,0,-376


@andy31415 andy31415 merged commit fb65a31 into project-chip:master Dec 11, 2020
vivien-apple added a commit to vivien-apple/connectedhomeip-1 that referenced this pull request Dec 14, 2020
This PR introduces a folder inside `src/app/zap-templates` to host custom
ZCL extensions such as the `MfgSpecificPing` command introduced in project-chip#4127 as
well as a `Binding Cluster` from project-chip#4156.

The `Binding Cluster` exposes 2 methods, `Bind` and `Unbind`. The current spec
defines `bindings` has an `RW` attribute but an issue has been opened since it does
not look very convenient (see CHIP-Specifications/connectedhomeip-spec#627)

The `gen/` folders are also updated to reflect the addition of the `Binding Cluster`.
Futhermore, the 2 scripts used to generates the `gen/` folders have also been updated to
points to the `src/app/zap-templates/zcl/zcl.json` instead of `third_party/zap/repo/zcl-builtin/silabs/zcl.json`
since the former is a superset of the later.
vivien-apple added a commit to vivien-apple/connectedhomeip-1 that referenced this pull request Dec 14, 2020
This PR introduces a folder inside `src/app/zap-templates` to host custom
ZCL extensions such as the `MfgSpecificPing` command introduced in project-chip#4127 as
well as a `Binding Cluster` from project-chip#4156.

The `Binding Cluster` exposes 2 methods, `Bind` and `Unbind`. The current spec
defines `bindings` has an `RW` attribute but an issue has been opened since it does
not look very convenient (see CHIP-Specifications/connectedhomeip-spec#627)

The `gen/` folders are also updated to reflect the addition of the `Binding Cluster`.
Futhermore, the 2 scripts used to generates the `gen/` folders have also been updated to
points to the `src/app/zap-templates/zcl/zcl.json` instead of `third_party/zap/repo/zcl-builtin/silabs/zcl.json`
since the former is a superset of the later.
vivien-apple added a commit to vivien-apple/connectedhomeip-1 that referenced this pull request Dec 14, 2020
This PR introduces a folder inside `src/app/zap-templates` to host custom
ZCL extensions such as the `MfgSpecificPing` command introduced in project-chip#4127 as
well as a `Binding Cluster` from project-chip#4156.

The `Binding Cluster` exposes 2 methods, `Bind` and `Unbind`. The current spec
defines `bindings` has an `RW` attribute but an issue has been opened since it does
not look very convenient (see CHIP-Specifications/connectedhomeip-spec#627)

The `gen/` folders are also updated to reflect the addition of the `Binding Cluster`.
Futhermore, the 2 scripts used to generates the `gen/` folders have also been updated to
points to the `src/app/zap-templates/zcl/zcl.json` instead of `third_party/zap/repo/zcl-builtin/silabs/zcl.json`
since the former is a superset of the later.
jepenven-silabs pushed a commit to jepenven-silabs/connectedhomeip that referenced this pull request Jan 5, 2021
This PR introduces a folder inside `src/app/zap-templates` to host custom
ZCL extensions such as the `MfgSpecificPing` command introduced in project-chip#4127 as
well as a `Binding Cluster` from project-chip#4156.

The `Binding Cluster` exposes 2 methods, `Bind` and `Unbind`. The current spec
defines `bindings` has an `RW` attribute but an issue has been opened since it does
not look very convenient (see CHIP-Specifications/connectedhomeip-spec#627)

The `gen/` folders are also updated to reflect the addition of the `Binding Cluster`.
Futhermore, the 2 scripts used to generates the `gen/` folders have also been updated to
points to the `src/app/zap-templates/zcl/zcl.json` instead of `third_party/zap/repo/zcl-builtin/silabs/zcl.json`
since the former is a superset of the later.
vivien-apple added a commit to vivien-apple/connectedhomeip-1 that referenced this pull request Jan 6, 2021
This PR introduces a folder inside `src/app/zap-templates` to host custom
ZCL extensions such as the `MfgSpecificPing` command introduced in project-chip#4127 as
well as a `Binding Cluster` from project-chip#4156.

The `Binding Cluster` exposes 2 methods, `Bind` and `Unbind`. The current spec
defines `bindings` has an `RW` attribute but an issue has been opened since it does
not look very convenient (see CHIP-Specifications/connectedhomeip-spec#627)

The `gen/` folders are also updated to reflect the addition of the `Binding Cluster`.
Futhermore, the 2 scripts used to generates the `gen/` folders have also been updated to
points to the `src/app/zap-templates/zcl/zcl.json` instead of `third_party/zap/repo/zcl-builtin/silabs/zcl.json`
since the former is a superset of the later.
BroderickCarlin pushed a commit that referenced this pull request Jan 8, 2021
This PR introduces a folder inside `src/app/zap-templates` to host custom
ZCL extensions such as the `MfgSpecificPing` command introduced in #4127 as
well as a `Binding Cluster` from #4156.

The `Binding Cluster` exposes 2 methods, `Bind` and `Unbind`. The current spec
defines `bindings` has an `RW` attribute but an issue has been opened since it does
not look very convenient (see CHIP-Specifications/connectedhomeip-spec#627)

The `gen/` folders are also updated to reflect the addition of the `Binding Cluster`.
Futhermore, the 2 scripts used to generates the `gen/` folders have also been updated to
points to the `src/app/zap-templates/zcl/zcl.json` instead of `third_party/zap/repo/zcl-builtin/silabs/zcl.json`
since the former is a superset of the later.
kpschoedel pushed a commit to kpschoedel/connectedhomeip that referenced this pull request Jan 8, 2021
…4192)

This PR introduces a folder inside `src/app/zap-templates` to host custom
ZCL extensions such as the `MfgSpecificPing` command introduced in project-chip#4127 as
well as a `Binding Cluster` from project-chip#4156.

The `Binding Cluster` exposes 2 methods, `Bind` and `Unbind`. The current spec
defines `bindings` has an `RW` attribute but an issue has been opened since it does
not look very convenient (see CHIP-Specifications/connectedhomeip-spec#627)

The `gen/` folders are also updated to reflect the addition of the `Binding Cluster`.
Futhermore, the 2 scripts used to generates the `gen/` folders have also been updated to
points to the `src/app/zap-templates/zcl/zcl.json` instead of `third_party/zap/repo/zcl-builtin/silabs/zcl.json`
since the former is a superset of the later.
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.

6 participants