Skip to content

Commit

Permalink
Merge branch 'master' into im-access-control-check
Browse files Browse the repository at this point in the history
  • Loading branch information
mlepage-google committed Dec 9, 2021
2 parents 7153b84 + 5bb8377 commit a0dafee
Show file tree
Hide file tree
Showing 331 changed files with 16,538 additions and 12,703 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/examples-infineon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,38 @@ jobs:
timeout-minutes: 10
run: |
scripts/run_in_build_env.sh \
"scripts/build/build_examples.py --no-log-timestamps --target 'infineon-p6-lock' build"
"scripts/build/build_examples.py \
--enable-flashbundle --no-log-timestamps \
--target infineon-p6-lock \
build \
--copy-artifacts-to out/artifacts \
"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
p6 default lock-app \
out/infineon-p6-lock/chip-p6-lock-example.out
- name: Build all-clusters-app example
timeout-minutes: 10
run: |
scripts/run_in_build_env.sh \
"scripts/build/build_examples.py --no-log-timestamps --target 'infineon-p6-all-clusters' build"
"scripts/build/build_examples.py \
--enable-flashbundle --no-log-timestamps \
--target infineon-p6-all-clusters \
build \
--copy-artifacts-to out/artifacts \
"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
p6 default all-clusters-app \
out/infineon-p6-all-clusters/chip-p6-clusters-example.out
- name: Build lighting-app example
timeout-minutes: 10
run: |
scripts/run_in_build_env.sh \
"scripts/build/build_examples.py --no-log-timestamps --target 'infineon-p6-light' build"
"scripts/build/build_examples.py \
--enable-flashbundle --no-log-timestamps \
--target infineon-p6-light \
build \
--copy-artifacts-to out/artifacts \
"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
p6 default light-app \
out/infineon-p6-light/chip-p6-lighting-example.out
Expand Down
1 change: 0 additions & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
deps = [
"${chip_root}/src/app",
"${chip_root}/src/ble",
"${chip_root}/src/channel",
"${chip_root}/src/controller",
"${chip_root}/src/credentials",
"${chip_root}/src/crypto",
Expand Down
4 changes: 4 additions & 0 deletions config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ if (CONFIG_OPENTHREAD_ENABLED)
chip_gn_arg_append("chip_enable_openthread" "true")
endif()

if (CONFIG_OPENTHREAD_FTD)
chip_gn_arg_append("chip_openthread_ftd" "true")
endif()

if (CONFIG_ENABLE_OTA_REQUESTOR)
chip_gn_arg_append("chip_enable_ota_requestor" "true")
endif()
Expand Down
1 change: 1 addition & 0 deletions config/nrfconnect/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ chip_gn_arg_string("zephyr_cxx" ${CMAKE_CXX_COMPILER
chip_gn_arg_bool ("is_debug" CONFIG_DEBUG)
chip_gn_arg_bool ("chip_logging" CONFIG_LOG)
chip_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_OPENTHREAD)
chip_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD)
chip_gn_arg_bool ("chip_config_network_layer_ble" CONFIG_BT)
chip_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_NET_IPV4)
chip_gn_arg_bool ("chip_enable_nfc" CONFIG_CHIP_NFC_COMMISSIONING)
Expand Down
1 change: 1 addition & 0 deletions config/telink/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ chip_gn_arg_string("chip_project_config_include" "${CHIP_PROJECT_CONF
chip_gn_arg_string("chip_system_project_config_include" "${CHIP_PROJECT_CONFIG}")
chip_gn_arg_bool ("is_debug" CONFIG_DEBUG)
chip_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_OPENTHREAD)
chip_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD)
chip_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_NET_IPV4)
chip_gn_arg_bool ("chip_build_tests" CONFIG_CHIP_BUILD_TESTS)
chip_gn_arg_bool ("chip_inet_config_enable_tcp_endpoint" CONFIG_CHIP_BUILD_TESTS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
"mfgCode": null,
"define": "GROUPS_CLUSTER",
"side": "server",
"enabled": 0,
"enabled": 1,
"commands": [
{
"name": "AddGroupResponse",
Expand Down Expand Up @@ -17129,7 +17129,7 @@
"mfgCode": null,
"define": "GROUPS_CLUSTER",
"side": "server",
"enabled": 0,
"enabled": 1,
"commands": [
{
"name": "AddGroupResponse",
Expand Down
4 changes: 2 additions & 2 deletions examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "CHIPDeviceManager.h"
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/Command.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
#include <app/util/af.h>
#include <app/util/basic-types.h>
Expand Down Expand Up @@ -161,7 +161,7 @@ void DeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpointI
return;
}

bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::Command * commandObj)
bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
{
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
return true;
Expand Down
4 changes: 2 additions & 2 deletions examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "route_hook/esp_route_hook.h"
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/Command.h>
#include <app/CommandHandler.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/server/Dnssd.h>
#include <app/util/basic-types.h>
Expand Down Expand Up @@ -254,7 +254,7 @@ void DeviceCallbacks::OnColorControlAttributeChangeCallback(EndpointId endpointI
}
#endif

bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::Command * commandObj)
bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
{
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
return true;
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ class MdnsDebugListModel : public ActionListModel
private:
void DoReinit()
{
CHIP_ERROR err = Dnssd::ServiceAdvertiser::Instance().Init(&DeviceLayer::InetLayer());
CHIP_ERROR err = Dnssd::ServiceAdvertiser::Instance().Init(DeviceLayer::UDPEndPointManager());
if (err != CHIP_NO_ERROR)
{
ESP_LOGE(TAG, "Error initializing: %s", err.AsString());
Expand Down
4 changes: 2 additions & 2 deletions examples/all-clusters-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
* limitations under the License.
*/

#include <app/Command.h>
#include <app/CommandHandler.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/util/af.h>

#include "AppMain.h"

bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::Command * commandObj)
bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj)
{
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
return true;
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/p6/src/ClusterManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/Command.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
Expand Down
2 changes: 1 addition & 1 deletion examples/chip-tool/commands/discover/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Resolve : public DiscoverCommand, public chip::Dnssd::ResolverDelegate
/////////// DiscoverCommand Interface /////////
CHIP_ERROR RunCommand(NodeId remoteId, uint64_t fabricId) override
{
ReturnErrorOnFailure(chip::Dnssd::Resolver::Instance().Init(&chip::DeviceLayer::InetLayer()));
ReturnErrorOnFailure(chip::Dnssd::Resolver::Instance().Init(chip::DeviceLayer::UDPEndPointManager()));
chip::Dnssd::Resolver::Instance().SetResolverDelegate(this);
ChipLogProgress(chipTool, "Dnssd: Searching for NodeId: %" PRIx64 " FabricId: %" PRIx64 " ...", remoteId, fabricId);
return chip::Dnssd::Resolver::Instance().ResolveNodeId(chip::PeerId().SetNodeId(remoteId).SetCompressedFabricId(fabricId),
Expand Down
100 changes: 9 additions & 91 deletions examples/chip-tool/templates/commands.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ static void OnDefaultSuccessResponse(void * context)
command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDefaultFailureResponse(void * context, uint8_t status)
static void OnDefaultFailure(void * context, EmberAfStatus status)
{
ChipLogProgress(chipTool, "Default Failure Response: 0x%02x", status);
ChipLogProgress(chipTool, "Default Failure Response: 0x%02x", chip::to_underlying(status));

ModelCommand * command = static_cast<ModelCommand *>(context);
command->SetCommandExitStatus(CHIP_ERROR_INTERNAL);
Expand All @@ -195,81 +195,6 @@ static void OnDefaultSuccess(void * context, const chip::app::DataModel::NullObj
OnDefaultSuccessResponse(context);
};

static void OnDefaultFailure(void * context, EmberAfStatus status)
{
OnDefaultFailureResponse(context, status);
};

static void OnBooleanAttributeReport(void * context, bool value)
{
ChipLogProgress(chipTool, "Boolean attribute Response: %d", value);
}

static void OnInt8uAttributeReport(void * context, uint8_t value)
{
ChipLogProgress(chipTool, "Int8u attribute Response: %" PRIu8, value);
}

static void OnInt16uAttributeReport(void * context, uint16_t value)
{
ChipLogProgress(chipTool, "Int16u attribute Response: %" PRIu16, value);
}

static void OnInt32uAttributeReport(void * context, uint32_t value)
{
ChipLogProgress(chipTool, "Int32u attribute Response: %" PRIu32, value);
}

static void OnInt64uAttributeReport(void * context, uint64_t value)
{
ChipLogProgress(chipTool, "Int64u attribute Response: %" PRIu64, value);
}

static void OnInt8sAttributeReport(void * context, int8_t value)
{
ChipLogProgress(chipTool, "Int8s attribute Response: %" PRId8, value);
}

static void OnInt16sAttributeReport(void * context, int16_t value)
{
ChipLogProgress(chipTool, "Int16s attribute Response: %" PRId16, value);
}

static void OnInt32sAttributeReport(void * context, int32_t value)
{
ChipLogProgress(chipTool, "Int32s attribute Response: %" PRId32, value);
}

static void OnInt64sAttributeReport(void * context, int64_t value)
{
ChipLogProgress(chipTool, "Int64s attribute Response: %" PRId64, value);
}

static void OnFloatAttributeReport(void * context, float value)
{
ChipLogProgress(chipTool, "Float attribute Response: %f", value);
}

static void OnDoubleAttributeReport(void * context, double value)
{
ChipLogProgress(chipTool, "Double attribute Response: %f", value);
}

static void OnOctetStringAttributeReport(void * context, const chip::ByteSpan value)
{
char buffer[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE];
if (CHIP_NO_ERROR == chip::Encoding::BytesToUppercaseHexString(value.data(), value.size(), &buffer[0], CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE)) {
ChipLogProgress(chipTool, "OctetString attribute Response: %s", buffer);
} else {
ChipLogProgress(chipTool, "OctetString attribute Response len: %zu", value.size());
}
}

static void OnCharStringAttributeReport(void * context, const chip::CharSpan value)
{
ChipLogProgress(chipTool, "CharString attribute Response: %.*s", static_cast<int>(value.size()), value.data());
}

template <typename T>
static void OnGeneralAttributeResponse(void * context, const char * label, T value)
{
Expand Down Expand Up @@ -430,7 +355,6 @@ private:
{{/unless}}
{{/if}}
{{#if isReportableAttribute}}
{{#unless isList}}
class Report{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}: public ModelCommand
{
public:
Expand All @@ -445,10 +369,6 @@ public:

~Report{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}()
{
delete onSuccessCallback;
delete onSuccessCallbackWithoutExit;
delete onFailureCallback;
delete onReportCallback;
}

CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
Expand All @@ -458,28 +378,26 @@ public:
chip::Controller::{{asUpperCamelCase parent.name}}Cluster cluster;
cluster.Associate(device, endpointId);

ReturnErrorOnFailure(cluster.ReportAttribute{{asUpperCamelCase name}}(onReportCallback->Cancel()));

chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel();
return cluster.SubscribeAttribute{{asUpperCamelCase name}}(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval);
auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse;
return cluster.SubscribeAttribute<chip::app::Clusters::{{asUpperCamelCase parent.name}}::Attributes::{{asUpperCamelCase name}}::TypeInfo>(this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback);
}

chip::System::Clock::Timeout GetWaitDuration() const override
{
return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10);
}

static void OnValueReport(void * context, {{zapTypeToDecodableClusterObjectType type ns=parent.name isArgument=true}} value)
{
LogValue("{{asUpperCamelCase parent.name}}.{{asUpperCamelCase name}} report", 0, value);
}

private:
chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback = new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallbackWithoutExit = new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponseWithoutExit, this);
chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback = new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
chip::Callback::Callback<{{chipCallback.name}}AttributeCallback> * onReportCallback = new chip::Callback::Callback<{{chipCallback.name}}AttributeCallback>(On{{chipCallback.name}}AttributeReport, this);
uint16_t mMinInterval;
uint16_t mMaxInterval;
bool mWait;
};

{{/unless}}
{{/if}}
{{/unless}}
{{/chip_server_cluster_attributes}}
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/ameba/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "CHIPDeviceManager.h"
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/Command.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
#include <app/util/af.h>
#include <app/util/basic-types.h>
Expand Down
19 changes: 16 additions & 3 deletions examples/lighting-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import("${efr32_sdk_build_root}/efr32_executable.gni")
import("${efr32_sdk_build_root}/efr32_sdk.gni")

import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
import("${chip_root}/src/platform/device.gni")

if (chip_enable_pw_rpc) {
import("//build_overrides/pigweed.gni")
import("$dir_pw_build/target_types.gni")
Expand Down Expand Up @@ -84,7 +86,7 @@ efr32_executable("lighting_app") {
"${examples_plat_dir}/LEDWidget.cpp",
"${examples_plat_dir}/heap_4_silabs.c",
"${examples_plat_dir}/init_efrPlatform.cpp",
"${examples_plat_dir}/uart.c",
"${examples_plat_dir}/uart.cpp",
"src/AppTask.cpp",
"src/LightingManager.cpp",
"src/ZclCallbacks.cpp",
Expand All @@ -99,10 +101,21 @@ efr32_executable("lighting_app") {
"${chip_root}/src/setup_payload",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils",
"${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd",
"${chip_root}/third_party/openthread/repo:libopenthread-ftd",
"${examples_plat_dir}:efr-matter-shell",
]

if (chip_openthread_ftd) {
deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd",
"${chip_root}/third_party/openthread/repo:libopenthread-ftd",
]
} else {
deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd",
"${chip_root}/third_party/openthread/repo:libopenthread-mtd",
]
}

include_dirs = [ "include" ]

defines = []
Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/efr32/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain")
pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip"
pw_assert_BACKEND = "$dir_pw_assert_log"
chip_enable_openthread = true
chip_openthread_ftd = true
Loading

0 comments on commit a0dafee

Please sign in to comment.