Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into update_smco
Browse files Browse the repository at this point in the history
  • Loading branch information
hare-siterwell committed Jul 5, 2023
2 parents 75c0385 + a9773c9 commit b2c2761
Show file tree
Hide file tree
Showing 45 changed files with 1,394 additions and 8,409 deletions.
26 changes: 19 additions & 7 deletions config/common/cmake/chip_gn.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# @file
# CMake file defining to setup and build the Matter library
# and other optional libraries like unit tests.
# Matter headers and libraries are exposed to the application
# Matter headers and libraries are exposed to the application
# as a specific interface target.
# Since Matter doesn't provide native CMake support, ExternalProject
# module is used to build the required artifacts with GN meta-build
Expand Down Expand Up @@ -57,34 +57,40 @@ endif()
# Macros
# ==============================================================================
# Setup and build the Matter library and other optional libraries like unit tests.
# Expose Matter headers & libraries to the application as specific
# Expose Matter headers & libraries to the application as specific
# interface target.
# [Args]:
# target - interface target name
# Available options are:
# LIB_SHELL Build and add Matter shell library
# LIB_PW_RPC Build and add Matter PW RPC library
# LIB_TESTS Build and add Matter unit tests library
# LIB_MBEDTLS Build and add Matter mbedtls library
# DEVICE_INFO_EXAMPLE_PROVIDER Add example device info provider support
#
# GN_DEPENDENCIES List of targets that should be built before Matter GN project
macro(matter_build target)
set(options)
set(oneValueArgs
LIB_TESTS
LIB_SHELL
LIB_TESTS
LIB_SHELL
LIB_PW_RPC
LIB_MBEDTLS
DEVICE_INFO_EXAMPLE_PROVIDER
)
set(multiValueArgs GN_DEPENDENCIES)

cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

set(MATTER_LIB_DIR ${CMAKE_CURRENT_BINARY_DIR}/lib)

# Prepare Matter libraries that the application should be linked with
set(MATTER_LIBRARIES -lCHIP)

if (ARG_LIB_MBEDTLS)
list(APPEND MATTER_LIBRARIES -lmbedtls)
endif()

if (ARG_LIB_SHELL)
list(APPEND MATTER_LIBRARIES -lCHIPShell)
endif()
Expand Down Expand Up @@ -115,7 +121,7 @@ macro(matter_build target)
BUILD_COMMAND ${CMAKE_COMMAND} -E echo "Starting Matter library build in ${CMAKE_CURRENT_BINARY_DIR}"
COMMAND ${Python3_EXECUTABLE} ${CHIP_ROOT}/config/common/cmake/make_gn_args.py @args.tmp > args.gn.tmp
# Replace the config only if it has changed to avoid triggering unnecessary rebuilds
COMMAND bash -c "(! diff -q args.gn.tmp args.gn && mv args.gn.tmp args.gn) || true"
COMMAND bash -c "(! diff -q args.gn.tmp args.gn && mv args.gn.tmp args.gn) || true"
# Regenerate the ninja build system
COMMAND ${GN_EXECUTABLE}
--root=${CHIP_ROOT}
Expand All @@ -127,7 +133,7 @@ macro(matter_build target)
COMMAND ${CMAKE_COMMAND} -E echo "Matter library build complete"
INSTALL_COMMAND ""
# Byproducts are removed by the clean target removing config and .ninja_deps
# allows a rebuild of the external project after the clean target has been run.
# allows a rebuild of the external project after the clean target has been run.
BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/args.gn
${CMAKE_CURRENT_BINARY_DIR}/build.ninja
${CMAKE_CURRENT_BINARY_DIR}/.ninja_deps
Expand Down Expand Up @@ -156,6 +162,12 @@ macro(matter_build target)
${CMAKE_CURRENT_BINARY_DIR}/gen/include
)

if (ARG_LIB_MBEDTLS)
target_include_directories(${target} INTERFACE
${CHIP_ROOT}/third_party/mbedtls/repo/include
)
endif()

# ==============================================================================
# Link required libraries
# ==============================================================================
Expand Down
12 changes: 6 additions & 6 deletions config/common/cmake/chip_gn_args.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#
# @file
# CMake file that allows collecting C/C++ compiler flags passed to
# CMake file that allows collecting C/C++ compiler flags passed to
# the Matter build system.
#

Expand Down Expand Up @@ -165,11 +165,11 @@ endmacro()
macro(matter_common_gn_args)
set(options)
set(oneValueArgs
DEBUG
LIB_TESTS
LIB_SHELL
DEBUG
LIB_TESTS
LIB_SHELL
LIB_PW_RPC
DEVICE_INFO_EXAMPLE_PROVIDER
DEVICE_INFO_EXAMPLE_PROVIDER
PROJECT_CONFIG

)
Expand All @@ -196,7 +196,7 @@ macro(matter_common_gn_args)
matter_add_gn_arg_bool ("is_debug" ${ARG_DEBUG})
matter_add_gn_arg_bool ("chip_build_tests" ${ARG_LIB_TESTS})
matter_add_gn_arg_bool ("chip_build_libshell" ${ARG_LIB_SHELL})

if (ARG_LIB_PW_RPC)
matter_add_gn_arg_bool ("chip_build_pw_rpc_lib" ${ARG_LIB_PW_RPC})
endif() # ARG_LIB_PW_RPC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4224,8 +4224,8 @@ server cluster CarbonMonoxideConcentrationMeasurement = 1036 {
}

enum MeasurementMediumEnum : ENUM8 {
kGas = 0;
kLiquid = 1;
kAir = 0;
kWater = 1;
kSoil = 2;
}

Expand Down Expand Up @@ -4279,8 +4279,8 @@ server cluster CarbonDioxideConcentrationMeasurement = 1037 {
}

enum MeasurementMediumEnum : ENUM8 {
kGas = 0;
kLiquid = 1;
kAir = 0;
kWater = 1;
kSoil = 2;
}

Expand Down Expand Up @@ -4334,8 +4334,8 @@ server cluster NitrogenDioxideConcentrationMeasurement = 1043 {
}

enum MeasurementMediumEnum : ENUM8 {
kGas = 0;
kLiquid = 1;
kAir = 0;
kWater = 1;
kSoil = 2;
}

Expand Down Expand Up @@ -4389,8 +4389,8 @@ server cluster OzoneConcentrationMeasurement = 1045 {
}

enum MeasurementMediumEnum : ENUM8 {
kGas = 0;
kLiquid = 1;
kAir = 0;
kWater = 1;
kSoil = 2;
}

Expand Down Expand Up @@ -4444,8 +4444,8 @@ server cluster Pm25ConcentrationMeasurement = 1066 {
}

enum MeasurementMediumEnum : ENUM8 {
kGas = 0;
kLiquid = 1;
kAir = 0;
kWater = 1;
kSoil = 2;
}

Expand Down Expand Up @@ -4499,8 +4499,8 @@ server cluster FormaldehydeConcentrationMeasurement = 1067 {
}

enum MeasurementMediumEnum : ENUM8 {
kGas = 0;
kLiquid = 1;
kAir = 0;
kWater = 1;
kSoil = 2;
}

Expand Down Expand Up @@ -4554,8 +4554,8 @@ server cluster Pm1ConcentrationMeasurement = 1068 {
}

enum MeasurementMediumEnum : ENUM8 {
kGas = 0;
kLiquid = 1;
kAir = 0;
kWater = 1;
kSoil = 2;
}

Expand Down Expand Up @@ -4609,8 +4609,8 @@ server cluster Pm10ConcentrationMeasurement = 1069 {
}

enum MeasurementMediumEnum : ENUM8 {
kGas = 0;
kLiquid = 1;
kAir = 0;
kWater = 1;
kSoil = 2;
}

Expand Down Expand Up @@ -4664,8 +4664,8 @@ server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 {
}

enum MeasurementMediumEnum : ENUM8 {
kGas = 0;
kLiquid = 1;
kAir = 0;
kWater = 1;
kSoil = 2;
}

Expand Down Expand Up @@ -4719,8 +4719,8 @@ server cluster RadonConcentrationMeasurement = 1071 {
}

enum MeasurementMediumEnum : ENUM8 {
kGas = 0;
kLiquid = 1;
kAir = 0;
kWater = 1;
kSoil = 2;
}

Expand Down Expand Up @@ -7053,6 +7053,15 @@ endpoint 2 {
endpoint 65534 {
device type anonymousEndpointType = 61442, version 1;

server cluster Descriptor {
callback attribute deviceTypeList;
callback attribute serverList;
callback attribute clientList;
callback attribute partsList;
ram attribute featureMap default = 0;
callback attribute clusterRevision default = 1;
}

server cluster NetworkCommissioning {
callback attribute maxNetworks;
callback attribute networks;
Expand Down
132 changes: 132 additions & 0 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -31747,6 +31747,138 @@
"deviceTypeCode": 61442,
"deviceTypeProfileId": 259,
"clusters": [
{
"name": "Descriptor",
"code": 29,
"mfgCode": null,
"define": "DESCRIPTOR_CLUSTER",
"side": "client",
"enabled": 0,
"attributes": [
{
"name": "ClusterRevision",
"code": 65533,
"mfgCode": null,
"side": "client",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
}
]
},
{
"name": "Descriptor",
"code": 29,
"mfgCode": null,
"define": "DESCRIPTOR_CLUSTER",
"side": "server",
"enabled": 1,
"attributes": [
{
"name": "DeviceTypeList",
"code": 0,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ServerList",
"code": 1,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ClientList",
"code": 2,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "PartsList",
"code": 3,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "FeatureMap",
"code": 65532,
"mfgCode": null,
"side": "server",
"type": "bitmap32",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
"mfgCode": null,
"side": "server",
"type": "int16u",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
}
]
},
{
"name": "Network Commissioning",
"code": 49,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4625,6 +4625,15 @@ endpoint 2 {
endpoint 65534 {
device type anonymousEndpointType = 61442, version 1;

server cluster Descriptor {
callback attribute deviceTypeList;
callback attribute serverList;
callback attribute clientList;
callback attribute partsList;
ram attribute featureMap default = 0;
callback attribute clusterRevision default = 1;
}

server cluster NetworkCommissioning {
callback attribute maxNetworks;
callback attribute networks;
Expand Down
Loading

0 comments on commit b2c2761

Please sign in to comment.