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

Fix Chef DoorLock lock/unlock functions didn't overide weak functions in door-lock-server.cpp #20612

Merged
merged 1 commit into from
Jul 13, 2022

Conversation

woody-apple
Copy link
Contributor

The functions emberAfPluginDoorLockOnDoorLockCommand and ……emberAfPluginDoorLockOnDoorLockCommand in Chef examples/chef/common/stubs.cpp didn't override the weak functions in src/app/clusters/door-lock-server/door-lock-server.cpp on ESP32 platform.
This causes user's customized Lock and Unlock codes to override weak functions never work.

Problem

What is being fixed? Examples:

  • The functions interface in stubs.cpp are not aligned with the weak functions
  • The weak functions are in the same file with the functions that call them. This seems to make the linker just link the first found (weak) function codes and will not link the strong functions in another file objects anymore.

Change overview

  • Align the strong functions' interface in stubs.cpp exactly the same with the weak functions' .
  • Move the weak functions out of door-lock-server.cpp to a new file called "door-lock-server-callback.cpp"

Testing

How was this tested? (at least one bullet point required)

  • Verified Chef with matter-door-lock-wifi.zap build on ESP32 and Linux platform with chip-tool and it works.

… in door-lock-server.cpp (#20538)

* Fix Chef DoorLock lock/unlock functions didn't overide weak functions in door-lock-server.cpp

* Fix restyle issue in src/app/chip_data_model.gni

* Restyled by whitespace

* Restyled by clang-format

* Restyled by gn

Co-authored-by: Restyled.io <[email protected]>
@github-actions
Copy link

PR #20612: Size comparison from 7037068 to 261f046

Increases (2 builds for nrfconnect)
platform target config section 7037068 261f046 change % change
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1174903 1174935 32 0.0
text 811300 811332 32 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1155099 1155131 32 0.0
text 800744 800776 32 0.0
Full report (3 builds for mbed, nrfconnect)
platform target config section 7037068 261f046 change % change
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2447912 2447912 0 0.0
.bss 213940 213940 0 0.0
.data 5872 5872 0 0.0
.text 1410556 1410556 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1174903 1174935 32 0.0
bss 142900 142900 0 0.0
rodata 141808 141808 0 0.0
text 811300 811332 32 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1155099 1155131 32 0.0
bss 142136 142136 0 0.0
rodata 133340 133340 0 0.0
text 800744 800776 32 0.0

@andy31415 andy31415 merged commit 6efb05e into sve Jul 13, 2022
@andy31415 andy31415 deleted the cherry-pick-d64b0fdff73e44efd167af4629a627c15c1d8ce9 branch July 13, 2022 13:44
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.

3 participants