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

Add new on/off cluster implementation based on the Silicon Labs ZigbeePro code #1609

Merged
merged 12 commits into from
Jul 21, 2020

Conversation

bzbarsky-apple
Copy link
Contributor

Problem

We actually want to pull in the ZigbeePro implementation from Silicon Labs, not the Dotdot implementation.

Summary of Changes

Pulls in (into the echo server for now) enough code to stand up the on-off cluster. Modifies our two chip-tool clients to talk the slightly different format this code expects.

Fixes #1216 and #1393

@CLAassistant
Copy link

CLAassistant commented Jul 15, 2020

CLA assistant check
All committers have signed the CLA.

@bzbarsky-apple
Copy link
Contributor Author

@wehale, could you or someone else from Silicon Labs please review the commits that pull in Silicon Labs code (the first two commits in this branch) to make sure that there's nothing obviously broken with the licensing bits? This is particularly important for the generated files, since I added the license header to those, and that needs approval from someone at Silicon Labs...

@bzbarsky-apple bzbarsky-apple changed the title Add new on off Add new on/off cluster implementation based on the Silicon Labs ZigbeePro code Jul 15, 2020
@lgtm-com
Copy link

lgtm-com bot commented Jul 15, 2020

This pull request introduces 1 alert when merging ea31e71 into 475b533 - view on LGTM.com

new alerts:

  • 1 for Expression has no effect

@bzbarsky-apple
Copy link
Contributor Author

Hmm. Looks like the nRF example app (examples/lock-app) is using the dotdot data model bits. I guess I need to fix it to link to libCHIPDataModel directly...

I'm not sure yet what the "GN Examples / Linux Standalone" failure is.

@wehale
Copy link
Contributor

wehale commented Jul 15, 2020 via email

Copy link
Contributor

@wehale wehale left a comment

Choose a reason for hiding this comment

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

this all looks good, the licenses look correct.

*/
// This file is generated by Simplicity Studio. Please do not edit manually.
//
//
Copy link
Contributor

Choose a reason for hiding this comment

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

This Simplicity Studio comment can probably be removed, or will be removed in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I expect a bunch of cleanup to happen here after initial landing. The goal was to land something minimally different from the "upstream" code as a first cut.

@selissia
Copy link
Contributor

@bzbarsky-apple: I'm reviewing it now.

Copy link
Contributor

@andy31415 andy31415 left a comment

Choose a reason for hiding this comment

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

We are checking in large files under gen/ . Assuming these are machine generated. Could we make the build system generate them instead?

* limitations under the License.
*/

/**
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this supposed to be dual copyright, since SiLabs is already a CHIP Author? Question applies throughout

IANAL


#include "af-types.h"

//#include CONFIGURATION_HEADER
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove commented out code?

This commented out include seems to occur in other places as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I mentioned above, the goal is to land something with as few differences from the original SiLabs code as possible, subject to the "it compiles and runs" constraint. Once this lands, we will definitely be doing a bunch of cleanup, which will include removing the commented-out bits here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I filed #1611 on this.

@@ -77,7 +75,7 @@ class DLL_EXPORT CHIPDeviceManagerCallbacks
* @param size size of the attribute
* @param value pointer to the new value
*/
virtual void PostAttributeChangeCallback(uint8_t endpoint, ChipZclClusterId clusterId, ChipZclAttributeId attributeId,
virtual void PostAttributeChangeCallback(uint8_t endpoint, EmberAfClusterId clusterId, EmberAfAttributeId attributeId,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we rename Ember to CHIP or have a Github issue to do so?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be best to rename things in a different PR, this way there is a record that would help correlate the code to its Silabs' origin.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The latter. #1610 filed.

@wehale
Copy link
Contributor

wehale commented Jul 15, 2020 via email

@selissia
Copy link
Contributor

I have reviewed the first two commits in the PR, everything looks good.

… Hale.

The sample app only implements the On/Off cluster.

Most of the files have the same exact name as in the sample app, with
the following exceptions:

* endpoint_config.h was originally ZigbeeMinimalSoc_endpoint_config.h
* gen_config.h was originally ZigbeeMinimalSoc.h
* gen_tokens.h was originally ZigbeeMinimalSoc_tokens.h
This corrects various obvious problems in the file that prevent files
that include it from compiling.
Bhaskar Sarma and others added 4 commits July 17, 2020 15:29
…s ZigbeePro implementation can handle.

The actual encoding we are using is not quite the APS encoding, but
it's still a throwaway, so that does not matter too much.
We no longer compile the Dotdot-based ZCL data model files into
libCHIP, because those have symbols whose names conflict with the new
ZigbeePro-based ZCL data model files.
@github-actions
Copy link

Size increase report for "nrf-example-build"

File Section File VM
chip-nrf52840-lock-example.out .bss 0 -8
chip-nrf52840-lock-example.out .text -12 -12
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-nrf52840-lock-example.out and ./pull_artifact/chip-nrf52840-lock-example.out:

sections,vmsize,filesize
.debug_str,0,79
[Unmapped],0,13
.bss,-8,0
.text,-12,-12


@github-actions
Copy link

Size increase report for "linux-example-build"

File Section File VM
chip-standalone-demo.out .rodata 88 88
chip-standalone-demo.out .bss 0 -32
chip-standalone-demo.out .eh_frame_hdr -184 -184
chip-standalone-demo.out .eh_frame -600 -600
chip-standalone-demo.out .text -1008 -1008
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-standalone-demo.out and ./pull_artifact/chip-standalone-demo.out:

sections,vmsize,filesize
[Unmapped],0,1703
.rodata,88,88
.bss,-32,0
.eh_frame_hdr,-184,-184
.debug_aranges,0,-368
.strtab,0,-595
.eh_frame,-600,-600
.symtab,0,-600
.debug_ranges,0,-800
.text,-1008,-1008
.debug_loc,0,-1061
.debug_abbrev,0,-1433
.debug_macro,0,-2173
.debug_line,0,-3333
.debug_str,0,-6566
.debug_info,0,-7422


@github-actions
Copy link

Size increase report for "esp32-example-build"

File Section File VM
chip-wifi-echo.elf .flash.text 1580 1580
chip-wifi-echo.elf .dram0.bss 0 -208
chip-wifi-echo.elf .flash.rodata -1448 -1448
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-wifi-echo.elf and ./pull_artifact/chip-wifi-echo.elf:

sections,vmsize,filesize
.debug_info,0,55269
.debug_line,0,29295
.debug_loc,0,19746
.debug_str,0,18226
.debug_frame,0,5700
.debug_abbrev,0,4318
.debug_ranges,0,1992
.flash.text,1580,1580
[Unmapped],0,1451
.debug_aranges,0,1400
.strtab,0,915
.symtab,0,656
.dram0.bss,-208,0
.flash.rodata,-1448,-1448


@github-actions
Copy link

Size increase report for "gn_nrf-example-build"

File Section File VM
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv


@github-actions
Copy link

Size increase report for "gn_linux-example-build"

File Section File VM
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv


@@ -0,0 +1,162 @@
/**
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these files common or intended to be generated in real apps? I suggest to move them to common since I did not see esp32 specific codes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These files are common, but can't compile without the gen bits (which are app-specific) right now. See #1630.

We can move them to examples/common if files in there can include app-specific headers (which is possible if we set up the include paths for the apps correctly).

Once #1630 is fixed, we can move these files somewhere else much more easily, of course.

Copy link
Contributor

@bhaskar-apple bhaskar-apple left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks Boris

@woody-apple
Copy link
Contributor

@woody-apple
Copy link
Contributor

@saurabhst @jelderton ?

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

Successfully merging this pull request may close these issues.

Missing Zigbee-pro attribute implementation