Skip to content

Commit

Permalink
af-gen-event.[h|cpp] removal (#24844)
Browse files Browse the repository at this point in the history
* fix: eliminate inclusion of deprecated file af-gen-event.h

* chg: removed all af-gen-event.h files

* chg: removed additional references to af-gen-event.h

* chg: removed use_zzz option from chef

* restyle

* chg: removed af-gen-event.cpp

* removed af-event references from the clusters' logic

* chg: removed references to zzz_generated folder from build file for temperature-measurement-app esp32

* chg: removed references to zzz_generated folder from build file for lock esp32

* chg: removed unnecessary reinterpret casts to void*

* chg: addressed naming issues from comments

* restyle

* fix: typos on barrier control server cluster

* new: teardown fnc on clusters that use Matter Timers

* chg: misc fixes

* chg: misc fixed addressing comments

* restyle

* chg: logs on all shutdown functions

* fix: corrected callback fcn on door lock cluster

* restyle

* new: include of CHIPDeviceConfig.h on color control and onoff headers

* fix: door lock print msg, rebase

* restyle

* fix: rolledback dynamic cluster change, guard on possible overflow on door lock

* zap regen

* fix: efr32 workflow crept in

* fix: door lock print fix

* restyle
  • Loading branch information
rochaferraz authored and pull[bot] committed Jul 20, 2023
1 parent 2b075de commit 532642b
Show file tree
Hide file tree
Showing 76 changed files with 903 additions and 1,167 deletions.
1 change: 0 additions & 1 deletion examples/all-clusters-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.)
# The list of src and include dirs must be in sync with that in all-clusters-app/esp32/main/component.mk
set(PRIV_INCLUDE_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/all-clusters-app"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/include"
"${CMAKE_CURRENT_LIST_DIR}/include"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.)
# The list of src and include dirs must be in sync with that in all-clusters-minimal-app/esp32/main/component.mk
set(PRIV_INCLUDE_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/all-clusters-minimal-app"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/include"
"${CMAKE_CURRENT_LIST_DIR}/include"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
Expand Down
1 change: 0 additions & 1 deletion examples/bridge-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# limitations under the License.

idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/bridge-app"
"${CMAKE_CURRENT_LIST_DIR}/include"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
SRC_DIRS
Expand Down
25 changes: 4 additions & 21 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,9 @@ def main() -> int:
action="store_true", dest="do_rpc_console")
parser.add_option("-y", "--tty", help="Enumerated USB tty/serial interface enumerated for your physical device. E.g.: /dev/ACM0",
dest="tty", metavar="TTY", default=None)
parser.add_option("", "--use_zzz", help="Use pre generated output from the ZAP tool found in the zzz_generated folder. Used to decrease execution time of CI/CD jobs",
dest="use_zzz", action="store_true")

# Build CD params.
parser.add_option("", "--build_all", help="For use in CD only. Builds and bundles all chef examples for the specified platform. Uses --use_zzz. Chef exits after completion.",
parser.add_option("", "--build_all", help="For use in CD only. Builds and bundles all chef examples for the specified platform. Chef exits after completion.",
dest="build_all", action="store_true")
parser.add_option("", "--dry_run", help="Display list of target builds of the --build_all command without building them.",
dest="dry_run", action="store_true")
Expand All @@ -342,7 +340,7 @@ def main() -> int:
parser.add_option("-k", "--keep_going", help="For use in CD only. Continues building all sample apps in the event of an error.",
dest="keep_going", action="store_true")
parser.add_option(
"", "--ci", help="Builds Chef examples defined in cicd_config. Uses --use_zzz. Uses specified target from -t. Chef exits after completion.", dest="ci", action="store_true")
"", "--ci", help="Builds Chef examples defined in cicd_config. Uses specified target from -t. Chef exits after completion.", dest="ci", action="store_true")
parser.add_option(
"", "--enable_ipv4", help="Enable IPv4 mDNS. Only applicable to platforms that can support IPV4 (e.g, Linux, ESP32)",
action="store_true", default=False)
Expand All @@ -367,7 +365,7 @@ def main() -> int:
shell.run_cmd(
"export GNUARMEMB_TOOLCHAIN_PATH=\"$PW_ARM_CIPD_INSTALL_DIR\"")
shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}")
command = f"./chef.py -cbr --use_zzz -d {device_name} -t {options.build_target}"
command = f"./chef.py -cbr -d {device_name} -t {options.build_target}"
flush_print(f"Building {command}", with_border=True)
shell.run_cmd(command)
bundle(options.build_target, device_name)
Expand Down Expand Up @@ -397,7 +395,7 @@ def main() -> int:
if options.dry_run:
flush_print(archive_name)
continue
command = f"./chef.py -cbr --use_zzz -d {device_name} -t {platform} "
command = f"./chef.py -cbr -d {device_name} -t {platform} "
command += " ".join(args)
flush_print(f"Building {command}", with_border=True)
shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}")
Expand Down Expand Up @@ -602,21 +600,6 @@ def main() -> int:
f"""Truncate the software version string from \"{sw_ver_string}\" to \"{truncated_sw_ver_string}\" due to 64 bytes limitation""")
sw_ver_string = truncated_sw_ver_string

if options.use_zzz:
flush_print("Using pre-generated ZAP output")
zzz_dir = os.path.join(_REPO_BASE_PATH,
"zzz_generated",
"chef-"+options.sample_device_type_name,
"zap-generated")
if not os.path.exists(zzz_dir):
flush_print(textwrap.dedent(f"""\
You have specified --use_zzz
for device {options.sample_device_type_name}
which does not exist in the cached ZAP output.
"""))
exit(1)
shutil.rmtree(gen_dir, ignore_errors=True)
shutil.copytree(zzz_dir, gen_dir)
flush_print("Building...")

flush_print(
Expand Down
3 changes: 0 additions & 3 deletions examples/chef/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

get_filename_component(CHIP_ROOT ../third_party/connectedhomeip REALPATH)
get_filename_component(CHEF ${CMAKE_CURRENT_SOURCE_DIR}/../../ REALPATH)
get_filename_component(GEN_DIR ${CHEF}/out/${SAMPLE_NAME}/zap-generated REALPATH)

# include(${CMAKE_CURRENT_LIST_DIR}/../../project_include.cmake)

Expand All @@ -33,7 +32,6 @@ set(PRIV_INCLUDE_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/third_party/nlio/repo/include"
"${CMAKE_SOURCE_DIR}/../"
"${GEN_DIR}/../"
"${CMAKE_SOURCE_DIR}/main/include/"
)

Expand Down Expand Up @@ -62,7 +60,6 @@ message(STATUS "** End of Cluster List **")
set(SRC_DIRS_LIST
${SRC_DIRS_LIST}
"${CMAKE_CURRENT_LIST_DIR}"
"${GEN_DIR}"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/reporting"
Expand Down
1 change: 0 additions & 1 deletion examples/light-switch-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.)
idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/light-switch-app"
"${CMAKE_CURRENT_LIST_DIR}/include"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32"
Expand Down
1 change: 0 additions & 1 deletion examples/lighting-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

set(PRIV_INCLUDE_DIRS_LIST
"${APP_GEN_DIR}"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/lighting-app"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/lighting-app/lighting-common/include"
"${CMAKE_CURRENT_LIST_DIR}/include"
Expand Down
3 changes: 0 additions & 3 deletions examples/lock-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ idf_component_register(INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed/esp32"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/lib/support"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/lock-app/"
"${CMAKE_CURRENT_LIST_DIR}/include"
"${IDF_PATH}/components/freertos/include/freertos"
SRC_DIRS
Expand Down Expand Up @@ -144,7 +143,6 @@ target_compile_options(${COMPONENT_LIB} PRIVATE

else (CONFIG_ENABLE_PW_RPC)
idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/lock-app/"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
"${CMAKE_CURRENT_LIST_DIR}/include"
SRC_DIRS
Expand Down Expand Up @@ -203,4 +201,3 @@ include("${CHIP_ROOT}/build/chip/esp32/esp32_codegen.cmake")

chip_app_component_codegen("${CHIP_ROOT}/examples/lock-app/lock-common/lock-app.matter")
chip_app_component_zapgen("${CHIP_ROOT}/examples/lock-app/lock-common/lock-app.zap")

1 change: 0 additions & 1 deletion examples/ota-provider-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.)
idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_CURRENT_LIST_DIR}/include"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/ota-provider-app/"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-provider-app"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
SRC_DIRS
Expand Down
1 change: 0 additions & 1 deletion examples/ota-requestor-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ get_filename_component(CHIP_ROOT ${CMAKE_SOURCE_DIR}/third_party/connectedhomeip
set(PRIV_INCLUDE_DIRS_LIST
"${CMAKE_CURRENT_LIST_DIR}/include"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/ota-requestor-app/"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
get_filename_component(CHIP_ROOT ${CMAKE_SOURCE_DIR}/third_party/connectedhomeip REALPATH)

set(PRIV_INCLUDE_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/temperature-measurement-app/"
"${CMAKE_CURRENT_LIST_DIR}/include"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
Expand Down
6 changes: 0 additions & 6 deletions scripts/examples/gn_build_test_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ function runZAP() {
# Create the folder to host the generated content if needed
mkdir -p "$ZAP_OUTPUT_DIR"

# https://github.com/project-chip/connectedhomeip/issues/3637
# af-gen-event.h is not generated, but the build process needs it. Just creates an empty file for now.
if [ ! -f "$ZAP_OUTPUT_DIR/af-gen-event.h" ]; then
touch "$ZAP_OUTPUT_DIR"/af-gen-event.h
fi

# Generates the generic files for the given zap configuration
"$CHIP_ROOT"/scripts/tools/zap/generate.py "$ZAP_INPUT_FILE" -o "$ZAP_OUTPUT_DIR"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1563,21 +1563,27 @@
}; \
const EmberAfGenericClusterFunction chipFuncArrayOnOffServer[] = { \
(EmberAfGenericClusterFunction) emberAfOnOffClusterServerInitCallback, \
(EmberAfGenericClusterFunction) MatterOnOffClusterServerShutdownCallback, \
}; \
const EmberAfGenericClusterFunction chipFuncArrayLevelControlServer[] = { \
(EmberAfGenericClusterFunction) emberAfLevelControlClusterServerInitCallback, \
(EmberAfGenericClusterFunction) MatterLevelControlClusterServerShutdownCallback, \
}; \
const EmberAfGenericClusterFunction chipFuncArrayModeSelectServer[] = { \
(EmberAfGenericClusterFunction) emberAfModeSelectClusterServerInitCallback, \
(EmberAfGenericClusterFunction) MatterModeSelectClusterServerPreAttributeChangedCallback, \
}; \
const EmberAfGenericClusterFunction chipFuncArrayDoorLockServer[] = { \
(EmberAfGenericClusterFunction) MatterDoorLockClusterServerAttributeChangedCallback, \
(EmberAfGenericClusterFunction) MatterDoorLockClusterServerShutdownCallback, \
(EmberAfGenericClusterFunction) MatterDoorLockClusterServerPreAttributeChangedCallback, \
}; \
const EmberAfGenericClusterFunction chipFuncArrayWindowCoveringServer[] = { \
(EmberAfGenericClusterFunction) MatterWindowCoveringClusterServerAttributeChangedCallback, \
}; \
const EmberAfGenericClusterFunction chipFuncArrayBarrierControlServer[] = { \
(EmberAfGenericClusterFunction) MatterBarrierControlClusterServerShutdownCallback, \
}; \
const EmberAfGenericClusterFunction chipFuncArrayPumpConfigurationAndControlServer[] = { \
(EmberAfGenericClusterFunction) emberAfPumpConfigurationAndControlClusterServerInitCallback, \
(EmberAfGenericClusterFunction) MatterPumpConfigurationAndControlClusterServerAttributeChangedCallback, \
Expand All @@ -1596,6 +1602,7 @@
}; \
const EmberAfGenericClusterFunction chipFuncArrayColorControlServer[] = { \
(EmberAfGenericClusterFunction) emberAfColorControlClusterServerInitCallback, \
(EmberAfGenericClusterFunction) MatterColorControlClusterServerShutdownCallback, \
}; \
const EmberAfGenericClusterFunction chipFuncArrayOccupancySensingServer[] = { \
(EmberAfGenericClusterFunction) emberAfOccupancySensingClusterServerInitCallback, \
Expand Down Expand Up @@ -2355,7 +2362,7 @@
.attributes = ZAP_ATTRIBUTE_INDEX(247), \
.attributeCount = 7, \
.clusterSize = 13, \
.mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
.mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \
.functions = chipFuncArrayOnOffServer, \
.acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 109 ) ,\
.generatedCommandList = nullptr ,\
Expand All @@ -2381,7 +2388,7 @@
.attributes = ZAP_ATTRIBUTE_INDEX(258), \
.attributeCount = 16, \
.clusterSize = 27, \
.mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
.mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \
.functions = chipFuncArrayLevelControlServer, \
.acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 116 ) ,\
.generatedCommandList = nullptr ,\
Expand Down Expand Up @@ -2524,7 +2531,7 @@
.attributes = ZAP_ATTRIBUTE_INDEX(324), \
.attributeCount = 33, \
.clusterSize = 55, \
.mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \
.mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \
.functions = chipFuncArrayDoorLockServer, \
.acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 127 ) ,\
.generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 142 ) ,\
Expand All @@ -2550,8 +2557,8 @@
.attributes = ZAP_ATTRIBUTE_INDEX(381), \
.attributeCount = 6, \
.clusterSize = 11, \
.mask = ZAP_CLUSTER_MASK(SERVER), \
.functions = NULL, \
.mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \
.functions = chipFuncArrayBarrierControlServer, \
.acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 156 ) ,\
.generatedCommandList = nullptr ,\
.eventList = nullptr, \
Expand Down Expand Up @@ -2615,7 +2622,7 @@
.attributes = ZAP_ATTRIBUTE_INDEX(446), \
.attributeCount = 54, \
.clusterSize = 345, \
.mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
.mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \
.functions = chipFuncArrayColorControlServer, \
.acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 161 ) ,\
.generatedCommandList = nullptr ,\
Expand Down Expand Up @@ -2901,7 +2908,7 @@
.attributes = ZAP_ATTRIBUTE_INDEX(682), \
.attributeCount = 7, \
.clusterSize = 13, \
.mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
.mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \
.functions = chipFuncArrayOnOffServer, \
.acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 237 ) ,\
.generatedCommandList = nullptr ,\
Expand Down
Loading

0 comments on commit 532642b

Please sign in to comment.