Skip to content

Commit

Permalink
Merge branch 'master' into light_control_support
Browse files Browse the repository at this point in the history
  • Loading branch information
andreilitvin committed Feb 21, 2023
2 parents a151543 + c56a2a7 commit 27998f3
Show file tree
Hide file tree
Showing 296 changed files with 6,772 additions and 10,723 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/examples-efr32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,25 @@ jobs:
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--enable-flashbundle \
--target efr32-brd4187c-window-covering \
--target efr32-brd4187c-switch \
--target efr32-brd4187c-switch-sed \
--target efr32-brd4187c-window-covering-additional_data_advertising \
--target efr32-brd4187c-thermostat-openthread_mtd \
--target efr32-brd4187c-switch-sed-shell-use_ot_coap_lib \
--target efr32-brd4187c-unit-test \
--target efr32-brd4187c-light \
--target efr32-brd4187c-light-use_ot_lib \
--target efr32-brd4187c-light-rpc \
--target efr32-brd4187c-lock-rpc \
--target efr32-brd4187c-lock-rpc-shell-enable_heap_monitoring \
build \
--copy-artifacts-to out/artifacts \
"
- name: Prepare some bloat report from the previous builds
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
efr32 BRD4187C lighting-app \
out/efr32-brd4187c-light/chip-efr32-lighting-example.out \
out/efr32-brd4187c-light-rpc/chip-efr32-lighting-example.out \
/tmp/bloat_reports/
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
efr32 BRD4187C window-app \
out/efr32-brd4187c-window-covering/chip-efr32-window-example.out \
out/efr32-brd4187c-window-covering-additional_data_advertising/chip-efr32-window-example.out \
/tmp/bloat_reports/
- name: Clean out build output
run: rm -rf ./out
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,18 @@ jobs:
--tool-args "already-discovered --nodeid 1 --setup-pin-code 20202021 --address ::1 --port 5540 -t 1000" \
--factoryreset \
'
- name: Run Pairing Address-PaseOnly Test
timeout-minutes: 10
run: |
scripts/run_in_build_env.sh \
'./scripts/tests/run_java_test.py \
--app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \
--app-args "--discriminator 3840 --interface-id -1" \
--tool-path out/linux-x64-java-matter-controller \
--tool-cluster "pairing" \
--tool-args "address-paseonly --nodeid 1 --setup-pin-code 20202021 --address ::1 --port 5540 -t 1000" \
--factoryreset \
'
- name: Uploading core files
uses: actions/upload-artifact@v3
if: ${{ failure() && !env.ACT }}
Expand Down
10 changes: 10 additions & 0 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -879,4 +879,14 @@ menu "CHIP Device Layer"

endmenu

menu "Commissioning Window Options"
config CHIP_DISCOVERY_TIMEOUT_SECS
int "Commissioning Window Timeout in seconds"
range 180 900
default 900
help
The amount of time (in seconds) after which the CHIP platform will close the Commissioning Window

endmenu

endmenu
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ server cluster OnOff = 6 {

request struct OffWithEffectRequest {
OnOffEffectIdentifier effectIdentifier = 0;
OnOffDelayedAllOffEffectVariant effectVariant = 1;
int8u effectVariant = 1;
}

request struct OnWithTimedOffRequest {
Expand Down Expand Up @@ -2135,6 +2135,7 @@ server cluster DoorLock = 257 {
kRfid = 7;
kFingerprint = 8;
kFingerVein = 9;
kFace = 10;
}

enum LockOperationTypeEnum : ENUM8 {
Expand Down
24 changes: 21 additions & 3 deletions examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_
OnInternetConnectivityChange(event);
break;

case DeviceEventType::kCHIPoBLEConnectionEstablished:
ChipLogProgress(DeviceLayer, "CHIPoBLE Connection Established");
break;

case DeviceEventType::kCHIPoBLEConnectionClosed:
ChipLogProgress(DeviceLayer, "CHIPoBLE Connection Closed");
break;

case DeviceEventType::kCHIPoBLEAdvertisingChange:
ChipLogProgress(DeviceLayer, "CHIPoBLE advertising has changed");
break;

case DeviceEventType::kInterfaceIpAddressChanged:
if ((event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV4_Assigned) ||
(event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV6_Assigned))
Expand All @@ -82,6 +94,15 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_
// newly selected address.
chip::app::DnssdServer::Instance().StartServer();
}
if (event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV6_Assigned)
{
ChipLogProgress(DeviceLayer, "Initializing route hook...");
ameba_route_hook_init();
}
break;

case DeviceEventType::kCommissioningComplete:
ChipLogProgress(DeviceLayer, "Commissioning Complete");
break;
}
}
Expand Down Expand Up @@ -122,9 +143,6 @@ void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event
{
ChipLogProgress(DeviceLayer, "IPv6 Server ready...");
chip::app::DnssdServer::Instance().StartServer();

ChipLogProgress(DeviceLayer, "Initializing route hook...");
ameba_route_hook_init();
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
// Init OTA requestor only when we have gotten IPv6 address
if (!isOTAInitialized)
Expand Down
4 changes: 2 additions & 2 deletions examples/all-clusters-app/ameba/main/include/OnOffCommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void ProcessOnOffUnicastBindingCommand(BindingCommandData * data, const EmberBin

case Clusters::OnOff::Commands::OffWithEffect::Id:
offwitheffectCommand.effectIdentifier = static_cast<Clusters::OnOff::OnOffEffectIdentifier>(data->args[0]);
offwitheffectCommand.effectVariant = static_cast<Clusters::OnOff::OnOffDelayedAllOffEffectVariant>(data->args[1]);
offwitheffectCommand.effectVariant = static_cast<uint8_t>(data->args[1]);
Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote,
offwitheffectCommand, onSuccess, onFailure);
break;
Expand Down Expand Up @@ -172,7 +172,7 @@ void ProcessOnOffGroupBindingCommand(BindingCommandData * data, const EmberBindi

case Clusters::OnOff::Commands::OffWithEffect::Id:
offwitheffectCommand.effectIdentifier = static_cast<Clusters::OnOff::OnOffEffectIdentifier>(data->args[0]);
offwitheffectCommand.effectVariant = static_cast<Clusters::OnOff::OnOffDelayedAllOffEffectVariant>(data->args[1]);
offwitheffectCommand.effectVariant = static_cast<uint8_t>(data->args[1]);
Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, offwitheffectCommand);
break;

Expand Down
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 @@ -160,7 +160,7 @@ bool AllClustersAppCommandHandler::IsClusterPresentOnAnyEndpoint(ClusterId clust

void AllClustersAppCommandHandler::OnRebootSignalHandler(BootReasonType bootReason)
{
if (ConfigurationMgr().StoreBootReason(static_cast<uint32_t>(bootReason)) != CHIP_NO_ERROR)
if (ConfigurationMgr().StoreBootReason(static_cast<uint32_t>(bootReason)) == CHIP_NO_ERROR)
{
Server::GetInstance().GenerateShutDownEvent();
PlatformMgr().ScheduleWork([](intptr_t) { PlatformMgr().StopEventLoopTask(); });
Expand Down
1 change: 1 addition & 0 deletions examples/all-clusters-app/tizen/tizen-manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<privilege>http://tizen.org/privilege/internet</privilege>
<privilege>http://tizen.org/privilege/network.get</privilege>
<privilege>http://tizen.org/privilege/network.set</privilege>
<privilege>http://tizen.org/privilege/network.profile</privilege>
</privileges>
<feature name="http://tizen.org/feature/network.bluetooth">true</feature>
<feature name="http://tizen.org/feature/network.bluetooth.le">true</feature>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1927,6 +1927,7 @@ server cluster DoorLock = 257 {
kRfid = 7;
kFingerprint = 8;
kFingerVein = 9;
kFace = 10;
}

enum LockOperationTypeEnum : ENUM8 {
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: 1 addition & 0 deletions examples/all-clusters-minimal-app/tizen/tizen-manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<privilege>http://tizen.org/privilege/internet</privilege>
<privilege>http://tizen.org/privilege/network.get</privilege>
<privilege>http://tizen.org/privilege/network.set</privilege>
<privilege>http://tizen.org/privilege/network.profile</privilege>
</privileges>
<feature name="http://tizen.org/feature/network.bluetooth">true</feature>
<feature name="http://tizen.org/feature/network.bluetooth.le">true</feature>
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
1 change: 0 additions & 1 deletion examples/bridge-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/ConcreteAttributePath.h>
#include <app/EventLogging.h>
#include <app/chip-zcl-zpro-codec.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/reporting/reporting.h>
#include <app/util/af-types.h>
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
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ server cluster OnOff = 6 {

request struct OffWithEffectRequest {
OnOffEffectIdentifier effectIdentifier = 0;
OnOffDelayedAllOffEffectVariant effectVariant = 1;
int8u effectVariant = 1;
}

request struct OnWithTimedOffRequest {
Expand Down
1 change: 1 addition & 0 deletions examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,7 @@ server cluster DoorLock = 257 {
kRfid = 7;
kFingerprint = 8;
kFingerVein = 9;
kFace = 10;
}

enum LockOperationTypeEnum : ENUM8 {
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/chef/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#include <app-common/zap-generated/callback.h>
#include <app-common/zap-generated/cluster-objects.h>
#include <app/server/Dnssd.h>
#include <app/util/af-event.h>
#include <app/util/af.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>

Expand Down
7 changes: 5 additions & 2 deletions examples/darwin-framework-tool/commands/common/MTRError.mm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#import <inet/InetError.h>
#import <lib/support/TypeTraits.h>

#import <objc/runtime.h>

CHIP_ERROR MTRErrorToCHIPErrorCode(NSError * error)
{
if (error == nil) {
Expand All @@ -43,8 +45,9 @@ CHIP_ERROR MTRErrorToCHIPErrorCode(NSError * error)
return CHIP_ERROR_INTERNAL;
}

if (error.userInfo != nil) {
id underlyingError = error.userInfo[@"underlyingError"];
{
void * key = (__bridge void *) NSClassFromString(@"MTRErrorHolder");
id underlyingError = objc_getAssociatedObject(error, key);
if (underlyingError != nil) {
NSValue * chipErrorValue = [underlyingError valueForKey:@"error"];
if (chipErrorValue != nil) {
Expand Down
1 change: 0 additions & 1 deletion examples/dynamic-bridge-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <app-common/zap-generated/attribute-type.h>
#include <app/ConcreteAttributePath.h>
#include <app/EventLogging.h>
#include <app/chip-zcl-zpro-codec.h>
#include <app/reporting/reporting.h>
#include <app/util/af-types.h>
#include <app/util/af.h>
Expand Down
1 change: 1 addition & 0 deletions examples/java-matter-controller/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ java_binary("java-matter-controller") {
"java/src/com/matter/controller/commands/discover/DiscoverCommissionersCommand.java",
"java/src/com/matter/controller/commands/pairing/CloseSessionCommand.java",
"java/src/com/matter/controller/commands/pairing/DiscoveryFilterType.java",
"java/src/com/matter/controller/commands/pairing/PairAddressPaseCommand.java",
"java/src/com/matter/controller/commands/pairing/PairAlreadyDiscoveredCommand.java",
"java/src/com/matter/controller/commands/pairing/PairCodeCommand.java",
"java/src/com/matter/controller/commands/pairing/PairCodePaseCommand.java",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ private static void registerCommandsPairing(
new PairCodeWifiCommand(controller, credentialsIssuer);
PairCodeThreadCommand pairCodeThreadCommand =
new PairCodeThreadCommand(controller, credentialsIssuer);
PairAddressPaseCommand pairAddressPaseCommand =
new PairAddressPaseCommand(controller, credentialsIssuer);
PairAlreadyDiscoveredCommand pairAlreadyDiscoveredCommand =
new PairAlreadyDiscoveredCommand(controller, credentialsIssuer);
PairOnNetworkCommand pairOnNetworkCommand =
Expand All @@ -83,6 +85,7 @@ private static void registerCommandsPairing(
clusterCommands.add(pairCodePaseCommand);
clusterCommands.add(pairCodeWifiCommand);
clusterCommands.add(pairCodeThreadCommand);
clusterCommands.add(pairAddressPaseCommand);
clusterCommands.add(pairAlreadyDiscoveredCommand);
clusterCommands.add(pairOnNetworkCommand);
clusterCommands.add(pairOnNetworkShortCommand);
Expand Down
Loading

0 comments on commit 27998f3

Please sign in to comment.