Skip to content

Commit

Permalink
Merge branch 'master' into chef-robotic-vacuum-cleaner-326681447
Browse files Browse the repository at this point in the history
  • Loading branch information
stingchang authored May 28, 2024
2 parents 1bc1757 + 22a9dc3 commit 939bf7f
Show file tree
Hide file tree
Showing 31 changed files with 639 additions and 438 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ jobs:
scripts/run_in_build_env.sh 'virtualenv pyenv'
source pyenv/bin/activate
pip3 install -r src/setup_payload/python/requirements.txt
python3 src/setup_payload/tests/run_python_setup_payload_gen_test.py out/chip-tool
python3 src/setup_payload/tests/run_python_setup_payload_test.py out/chip-tool
build_linux_python_lighting_device:
name: Build on Linux (python lighting-app)
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/darwin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ jobs:
bootstrap-logs-framework-${{ matrix.options.flavor }}
- name: Build example All Clusters Server
run: |
scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug chip_config_network_layer_ble=false
scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug/all-clusters-app chip_config_network_layer_ble=false
- name: Build example OTA Provider
run: |
scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false
scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug/ota-provider-app chip_config_network_layer_ble=false
- name: Build example OTA Requestor
run: |
scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug/ota-requestor-app chip_config_network_layer_ble=false non_spec_compliant_ota_action_delay_floor=0
Expand All @@ -113,13 +113,8 @@ jobs:
run: |
mkdir -p /tmp/darwin/framework-tests
echo "This is a simple log" > /tmp/darwin/framework-tests/end_user_support_log.txt
../../../out/debug/chip-all-clusters-app --interface-id -1 --end_user_support_log /tmp/darwin/framework-tests/end_user_support_log.txt > >(tee /tmp/darwin/framework-tests/all-cluster-app.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-err.log >&2) &
../../../out/debug/chip-all-clusters-app --interface-id -1 --dac_provider ../../../credentials/development/commissioner_dut/struct_cd_origin_pid_vid_correct/test_case_vector.json --product-id 32768 --discriminator 3839 --secured-device-port 5539 --KVS /tmp/chip-all-clusters-app-kvs2 > >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid-err.log >&2) &
../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 101 --passcode 1001 --KVS /tmp/chip-all-clusters-app-kvs101 --secured-device-port 5531 &
../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 102 --passcode 1002 --KVS /tmp/chip-all-clusters-app-kvs102 --secured-device-port 5532 &
../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 103 --passcode 1003 --KVS /tmp/chip-all-clusters-app-kvs103 --secured-device-port 5533 &
../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 104 --passcode 1004 --KVS /tmp/chip-all-clusters-app-kvs104 --secured-device-port 5534 &
../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 105 --passcode 1005 --KVS /tmp/chip-all-clusters-app-kvs105 --secured-device-port 5535 &
../../../out/debug/all-clusters-app/chip-all-clusters-app --interface-id -1 --end_user_support_log /tmp/darwin/framework-tests/end_user_support_log.txt > >(tee /tmp/darwin/framework-tests/all-cluster-app.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-err.log >&2) &
../../../out/debug/all-clusters-app/chip-all-clusters-app --interface-id -1 --dac_provider ../../../credentials/development/commissioner_dut/struct_cd_origin_pid_vid_correct/test_case_vector.json --product-id 32768 --discriminator 3839 --secured-device-port 5539 --KVS /tmp/chip-all-clusters-app-kvs2 > >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid-err.log >&2) &
export TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ jobs:
--known-failure controller/ExamplePersistentStorage.cpp \
--known-failure controller/ExamplePersistentStorage.h \
--known-failure app/AttributeAccessToken.h \
--known-failure app/CommandHandler.h \
--known-failure app/CommandHandlerInterface.h \
--known-failure app/CommandResponseSender.h \
--known-failure app/CommandSenderLegacyCallback.h \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3876,7 +3876,7 @@ cluster ValveConfigurationAndControl = 129 {
}

/** This cluster provides a mechanism for querying data about electrical power as measured by the server. */
provisional cluster ElectricalPowerMeasurement = 144 {
cluster ElectricalPowerMeasurement = 144 {
revision 1;

enum MeasurementTypeEnum : enum16 {
Expand Down Expand Up @@ -3981,7 +3981,7 @@ provisional cluster ElectricalPowerMeasurement = 144 {
}

/** This cluster provides a mechanism for querying data about the electrical energy imported or provided by the server. */
provisional cluster ElectricalEnergyMeasurement = 145 {
cluster ElectricalEnergyMeasurement = 145 {
revision 1;

enum MeasurementTypeEnum : enum16 {
Expand Down Expand Up @@ -4278,7 +4278,7 @@ provisional cluster DeviceEnergyManagement = 152 {
}

/** Electric Vehicle Supply Equipment (EVSE) is equipment used to charge an Electric Vehicle (EV) or Plug-In Hybrid Electric Vehicle. This cluster provides an interface to the functionality of Electric Vehicle Supply Equipment (EVSE) management. */
provisional cluster EnergyEvse = 153 {
cluster EnergyEvse = 153 {
revision 2;

enum EnergyTransferStoppedReasonEnum : enum8 {
Expand Down Expand Up @@ -4490,7 +4490,7 @@ provisional cluster EnergyPreference = 155 {
}

/** The Power Topology Cluster provides a mechanism for expressing how power is flowing between endpoints. */
provisional cluster PowerTopology = 156 {
cluster PowerTopology = 156 {
revision 1;

bitmap Feature : bitmap32 {
Expand All @@ -4511,7 +4511,7 @@ provisional cluster PowerTopology = 156 {
}

/** Attributes and commands for selecting a mode from a list of supported options. */
provisional cluster EnergyEvseMode = 157 {
cluster EnergyEvseMode = 157 {
revision 1;

enum ModeTag : enum16 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ModelCommand : public CHIPCommandBridge

/////////// CHIPCommand Interface /////////
CHIP_ERROR RunCommand() override;
chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(10); }
chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(20); }

virtual CHIP_ERROR SendCommand(MTRBaseDevice * _Nonnull device, chip::EndpointId endPointId) = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ cluster GroupKeyManagement = 63 {
}

/** This cluster provides a mechanism for querying data about electrical power as measured by the server. */
provisional cluster ElectricalPowerMeasurement = 144 {
cluster ElectricalPowerMeasurement = 144 {
revision 1;

enum MeasurementTypeEnum : enum16 {
Expand Down Expand Up @@ -1342,7 +1342,7 @@ provisional cluster ElectricalPowerMeasurement = 144 {
}

/** This cluster provides a mechanism for querying data about the electrical energy imported or provided by the server. */
provisional cluster ElectricalEnergyMeasurement = 145 {
cluster ElectricalEnergyMeasurement = 145 {
revision 1;

enum MeasurementTypeEnum : enum16 {
Expand Down Expand Up @@ -1639,7 +1639,7 @@ provisional cluster DeviceEnergyManagement = 152 {
}

/** Electric Vehicle Supply Equipment (EVSE) is equipment used to charge an Electric Vehicle (EV) or Plug-In Hybrid Electric Vehicle. This cluster provides an interface to the functionality of Electric Vehicle Supply Equipment (EVSE) management. */
provisional cluster EnergyEvse = 153 {
cluster EnergyEvse = 153 {
revision 2;

enum EnergyTransferStoppedReasonEnum : enum8 {
Expand Down Expand Up @@ -1817,7 +1817,7 @@ provisional cluster EnergyEvse = 153 {
}

/** The Power Topology Cluster provides a mechanism for expressing how power is flowing between endpoints. */
provisional cluster PowerTopology = 156 {
cluster PowerTopology = 156 {
revision 1;

bitmap Feature : bitmap32 {
Expand All @@ -1838,7 +1838,7 @@ provisional cluster PowerTopology = 156 {
}

/** Attributes and commands for selecting a mode from a list of supported options. */
provisional cluster EnergyEvseMode = 157 {
cluster EnergyEvseMode = 157 {
revision 1;

enum ModeTag : enum16 {
Expand Down
2 changes: 1 addition & 1 deletion integrations/docker/images/base/chip-build/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
52 : [NXP] Update K32W0 SDK to 2.6.14
53 : [Tizen] Add libatomic.so to QEMU Docker image
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ RUN set -x \
# Add extra libraries to the root image
&& guestfish --rw -a $TIZEN_IOT_IMAGE_ROOT -m /dev/sda copy-in \
$TIZEN_SDK_TOOLCHAIN/arm-tizen-linux-gnueabi/lib/libasan.so.* \
$TIZEN_SDK_TOOLCHAIN/arm-tizen-linux-gnueabi/lib/libatomic.so.* \
$TIZEN_SDK_TOOLCHAIN/arm-tizen-linux-gnueabi/lib/libubsan.so.* \
$TIZEN_SDK_SYSROOT/usr/lib/libbluetooth-api.so.* \
$TIZEN_SDK_SYSROOT/usr/lib/libcapi-network-bluetooth.so.* \
Expand Down
4 changes: 2 additions & 2 deletions scripts/tools/bouffalolab/factory_qrcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

try:
import qrcode
from generate_setup_payload import CommissioningFlow, SetupPayload
from SetupPayload import CommissioningFlow, SetupPayload
except ImportError:
SDK_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))
sys.path.append(os.path.join(SDK_ROOT, "src/setup_payload/python"))
try:
import qrcode
from generate_setup_payload import CommissioningFlow, SetupPayload
from SetupPayload import CommissioningFlow, SetupPayload
except ModuleNotFoundError or ImportError:
no_onboarding_modules = True
else:
Expand Down
2 changes: 1 addition & 1 deletion scripts/tools/generate_esp32_chip_factory_bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
sys.path.insert(0, os.path.join(CHIP_TOPDIR, 'scripts', 'tools', 'spake2p'))
from spake2p import generate_verifier # noqa: E402 isort:skip
sys.path.insert(0, os.path.join(CHIP_TOPDIR, 'src', 'setup_payload', 'python'))
from generate_setup_payload import CommissioningFlow, SetupPayload # noqa: E402 isort:skip
from SetupPayload import CommissioningFlow, SetupPayload # noqa: E402 isort:skip

if os.getenv('IDF_PATH'):
sys.path.insert(0, os.path.join(os.getenv('IDF_PATH'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@

try:
import qrcode
from generate_setup_payload import CommissioningFlow, SetupPayload
from SetupPayload import CommissioningFlow, SetupPayload
except ImportError:
SDK_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))
sys.path.append(os.path.join(SDK_ROOT, "src/setup_payload/python"))
try:
import qrcode
from generate_setup_payload import CommissioningFlow, SetupPayload
from SetupPayload import CommissioningFlow, SetupPayload
except ModuleNotFoundError or ImportError:
no_onboarding_modules = True
else:
Expand Down
65 changes: 57 additions & 8 deletions src/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,6 @@ static_library("interaction-model") {
"ReadClient.h", # TODO: cpp is only included conditionally. Needs logic
# fixing
"ReadPrepareParams.h",
"RequiredPrivilege.h",
"StatusResponse.cpp",
"StatusResponse.h",
"SubscriptionResumptionStorage.h",
"TimedHandler.cpp",
"TimedHandler.h",
Expand Down Expand Up @@ -210,6 +207,7 @@ static_library("interaction-model") {

public_deps = [
":app_config",
":command-handler",
":constants",
":paths",
":subscription-info-provider",
Expand Down Expand Up @@ -248,8 +246,6 @@ static_library("interaction-model") {
"dynamic_server/AccessControl.cpp",
"dynamic_server/AccessControl.h",
"dynamic_server/DynamicDispatcher.cpp",
"util/privilege-storage.cpp",
"util/privilege-storage.h",
]

public_deps += [
Expand Down Expand Up @@ -301,6 +297,62 @@ static_library("attribute-access") {
]
}

source_set("required-privileges") {
sources = [ "RequiredPrivilege.h" ]

public_deps = [
":paths",
"${chip_root}/src/access:types",
]

if (chip_build_controller_dynamic_server) {
sources += [
"util/privilege-storage.cpp",
"util/privilege-storage.h",
]

public_deps += [
":global-attributes",
"${chip_root}/src/access",
"${chip_root}/src/app/dynamic_server:mock-codegen-includes",
]

public_configs = [ ":config-controller-dynamic-server" ]
}
}

source_set("status-response") {
sources = [
"StatusResponse.cpp",
"StatusResponse.h",
]
public_deps = [
":constants",
"${chip_root}/src/app/MessageDef",
"${chip_root}/src/messaging",
]
}

source_set("command-handler") {
sources = [
"CommandHandler.cpp",
"CommandHandler.h",
"CommandHandlerExchangeInterface.h",
]

public_deps = [
":paths",
":required-privileges",
":status-response",
"${chip_root}/src/access:types",
"${chip_root}/src/app/MessageDef",
"${chip_root}/src/app/data-model",
"${chip_root}/src/app/util:callbacks",
"${chip_root}/src/lib/support",
"${chip_root}/src/messaging",
]
}

# Note to developpers, instead of continuously adding files in the app librabry, it is recommand to create smaller source_sets that app can depend on.
# This way, we can have a better understanding of dependencies and other componenets can depend on the different source_sets without needing to depend on the entire app library.
static_library("app") {
Expand All @@ -312,8 +364,6 @@ static_library("app") {
"AttributePersistenceProvider.h",
"ChunkedWriteCallback.cpp",
"ChunkedWriteCallback.h",
"CommandHandler.cpp",
"CommandHandlerExchangeInterface.h",
"CommandResponseHelper.h",
"CommandResponseSender.cpp",
"DefaultAttributePersistenceProvider.cpp",
Expand All @@ -338,7 +388,6 @@ static_library("app") {
# (app depending on im and im including these headers):
# Name with _ so that linter does not recognize it
# "CommandResponseSender._h"
# "CommandHandler._h"
# "ReadHandler._h",
# "WriteHandler._h"
]
Expand Down
14 changes: 3 additions & 11 deletions src/app/CommandHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* @file
* This file defines object for a CHIP IM Invoke Command Handler
*
*/

#include "CommandHandler.h"
#include "InteractionModelEngine.h"
#include "RequiredPrivilege.h"
#include "messaging/ExchangeContext.h"
#include <app/CommandHandler.h>

#include <access/AccessControl.h>
#include <app-common/zap-generated/cluster-objects.h>
#include <app/RequiredPrivilege.h>
#include <app/StatusResponse.h>
#include <app/util/MatterCallbacks.h>
#include <credentials/GroupDataProvider.h>
#include <lib/core/CHIPConfig.h>
#include <lib/core/TLVData.h>
#include <lib/core/TLVUtilities.h>
#include <lib/support/IntrusiveList.h>
#include <lib/support/TypeTraits.h>
#include <messaging/ExchangeContext.h>
#include <platform/LockTracker.h>
#include <protocols/secure_channel/Constants.h>

Expand Down
3 changes: 1 addition & 2 deletions src/app/CommandHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@

#pragma once

#include "CommandPathRegistry.h"

#include <app/CommandHandlerExchangeInterface.h>
#include <app/CommandPathRegistry.h>
#include <app/ConcreteCommandPath.h>
#include <app/data-model/Encode.h>
#include <lib/core/CHIPCore.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
-->
<configurator>
<domain name="CHIP"/>
<cluster apiMaturity="provisional">
<cluster>
<name>Electrical Energy Measurement</name>
<domain>Measurement &amp; Sensing</domain>
<code>0x0091</code>
Expand Down Expand Up @@ -52,25 +52,25 @@ limitations under the License.
<attribute code="0x0004" side="server" define="PERIODIC_ENERGY_EXPORTED" type="EnergyMeasurementStruct" isNullable="true" optional="true">PeriodicEnergyExported</attribute>
<attribute code="0x0005" side="server" define="CUMULATIVE_ENERGY_RESET" type="CumulativeEnergyResetStruct" isNullable="true" optional="true">CumulativeEnergyReset</attribute>
<!--Conformance feature EXPE & PERE - for now optional-->
<event code="0x00" side="server" name="CumulativeEnergyMeasured" priority="info" apiMaturity="provisional" optional="true">
<event code="0x00" side="server" name="CumulativeEnergyMeasured" priority="info" optional="true">
<description>CumulativeEnergyMeasured</description>
<field id="0" name="EnergyImported" type="EnergyMeasurementStruct" optional="true"/>
<field id="1" name="EnergyExported" type="EnergyMeasurementStruct" optional="true"/>
</event>
<event code="0x01" side="server" name="PeriodicEnergyMeasured" priority="info" apiMaturity="provisional" optional="true">
<event code="0x01" side="server" name="PeriodicEnergyMeasured" priority="info" optional="true">
<description>PeriodicEnergyMeasured</description>
<field id="0" name="EnergyImported" type="EnergyMeasurementStruct" optional="true"/>
<field id="1" name="EnergyExported" type="EnergyMeasurementStruct" optional="true"/>
</event>
</cluster>
<struct name="CumulativeEnergyResetStruct" apiMaturity="provisional">
<struct name="CumulativeEnergyResetStruct">
<cluster code="0x0091"/>
<item fieldId="0" name="ImportedResetTimestamp" type="epoch_s" isNullable="true" optional="true"/>
<item fieldId="1" name="ExportedResetTimestamp" type="epoch_s" isNullable="true" optional="true"/>
<item fieldId="2" name="ImportedResetSystime" type="systime_ms" isNullable="true" optional="true"/>
<item fieldId="3" name="ExportedResetSystime" type="systime_ms" isNullable="true" optional="true"/>
</struct>
<struct name="EnergyMeasurementStruct" apiMaturity="provisional">
<struct name="EnergyMeasurementStruct">
<cluster code="0x0091"/>
<item fieldId="0" name="Energy" type="energy_mwh" min="0" max="4611686018427387904"/>
<item fieldId="1" name="StartTimestamp" type="epoch_s" optional="true"/>
Expand Down
Loading

0 comments on commit 939bf7f

Please sign in to comment.