Skip to content

Commit

Permalink
Merge branch 'master' into camera-webrtc-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarcosb authored Nov 11, 2024
2 parents aa3f666 + aba2383 commit c991d25
Show file tree
Hide file tree
Showing 104 changed files with 2,080 additions and 1,820 deletions.
4 changes: 4 additions & 0 deletions config/telink/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ set_property(GLOBAL APPEND PROPERTY ZEPHYR_INTERFACE_LIBS chip)

include(${TELINK_COMMON}/common.cmake)

if (CONFIG_CHIP_APP_LOG_LEVEL GREATER_EQUAL 4)
include(${TELINK_COMMON}/build_info.cmake)
endif()

# ==============================================================================
# Define 'process_binaries' target for collecting final binary to flash
# ==============================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1845,7 +1845,7 @@ endpoint 1 {
server cluster PressureMeasurement {
ram attribute measuredValue default = 0xA;
ram attribute minMeasuredValue default = 1;
ram attribute maxMeasuredValue default = 0xfffe;
ram attribute maxMeasuredValue default = 32767;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute attributeList;
Expand Down
4 changes: 2 additions & 2 deletions examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap
Original file line number Diff line number Diff line change
Expand Up @@ -2721,7 +2721,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0xfffe",
"defaultValue": "32767",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -2830,4 +2830,4 @@
"parentEndpointIdentifier": null
}
]
}
}
4 changes: 4 additions & 0 deletions examples/chip-tool/commands/common/Command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ bool Command::InitArguments(int argc, char ** argv)
{
optionalArgsCount++;
}
else if (argvExtraArgsCount == 0)
{
mandatoryArgsCount++;
}
else
{
mandatoryArgsCount++;
Expand Down
5 changes: 3 additions & 2 deletions examples/energy-management-app/linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,9 @@ data (e.g. fabric info).

## CHIP-REPL Interaction

- See chip-repl documentation in
[Matter_REPL_Intro](../../../docs/development_controllers/chip-repl/Matter_REPL_Intro.ipynb)
- See chip-repl documentation in:
- [Working with Python CHIP Controller](../../../docs/development_controllers/chip-repl/python_chip_controller_building.md)
- [Matter_REPL_Intro](../../../docs/development_controllers/chip-repl/Matter_REPL_Intro.ipynb)

### Building chip-repl:

Expand Down
8 changes: 2 additions & 6 deletions examples/energy-management-app/silabs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ creating real products based on the Silicon Labs platform.
To build the Water Heater example you can change the args to gn gen (see
BUILD.gn for arg options)

$ gn gen out/debug --args='chip_enable_example_evse_device=false chip_enable_example_water_heater_device=true'
$ gn gen out/debug --args='sl_enable_example_evse_device=false sl_enable_example_water_heater_device=true'
$ ninja -C out/debug

To change Device Energy Management feature support (e.g. Power forecast or
State forecast reporting), you can change the args to gn gen (see BUILD.gn
for arg options)

$ gn gen out/debug --args='chip_dem_support_state_forecast_reporting=true chip_dem_support_power_forecast_reporting=false'
$ gn gen out/debug --args='sl_dem_support_state_forecast_reporting=true sl_dem_support_power_forecast_reporting=false'
$ ninja -C out/debug

- To delete generated executable, libraries and object files use:
Expand All @@ -127,10 +127,6 @@ creating real products based on the Silicon Labs platform.

$ ./scripts/examples/gn_silabs_example.sh ./examples/energy-management-app/silabs/ ./out/energy-management-app_ICD BRD4187C --icd

or use gn as previously mentioned but adding the following arguments:

$ gn gen out/debug '--args=SILABS_BOARD="BRD4187C" enable_sleepy_device=true chip_openthread_ftd=false'

* Build the example with pigweed RPC

$ ./scripts/examples/gn_silabs_example.sh examples/energy-management-app/silabs/ out/energy_management_app_rpc BRD4187C 'import("//with_pw_rpc.gni")'
Expand Down
49 changes: 25 additions & 24 deletions examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,22 @@ void FabricSyncAddBridgeCommand::OnCommissioningComplete(NodeId deviceId, CHIP_E

if (err == CHIP_NO_ERROR)
{
DeviceMgr().SetRemoteBridgeNodeId(mBridgeNodeId);
DeviceManager::Instance().SetRemoteBridgeNodeId(mBridgeNodeId);
ChipLogProgress(NotSpecified, "Successfully paired bridge device: NodeId: " ChipLogFormatX64,
ChipLogValueX64(mBridgeNodeId));

DeviceMgr().UpdateLastUsedNodeId(mBridgeNodeId);
DeviceMgr().SubscribeRemoteFabricBridge();
DeviceManager::Instance().UpdateLastUsedNodeId(mBridgeNodeId);
DeviceManager::Instance().SubscribeRemoteFabricBridge();

if (DeviceMgr().IsLocalBridgeReady())
if (DeviceManager::Instance().IsLocalBridgeReady())
{
// After successful commissioning of the Commissionee, initiate Reverse Commissioning
// via the Commissioner Control Cluster. However, we must first verify that the
// remote Fabric-Bridge supports Fabric Synchronization.
//
// Note: The Fabric-Admin MUST NOT send the RequestCommissioningApproval command
// if the remote Fabric-Bridge lacks Fabric Synchronization support.
DeviceLayer::SystemLayer().ScheduleLambda([]() { DeviceMgr().ReadSupportedDeviceCategories(); });
DeviceLayer::SystemLayer().ScheduleLambda([]() { DeviceManager::Instance().ReadSupportedDeviceCategories(); });
}
}
else
Expand All @@ -80,7 +80,7 @@ void FabricSyncAddBridgeCommand::OnCommissioningComplete(NodeId deviceId, CHIP_E

CHIP_ERROR FabricSyncAddBridgeCommand::RunCommand(NodeId remoteId)
{
if (DeviceMgr().IsFabricSyncReady())
if (DeviceManager::Instance().IsFabricSyncReady())
{
// print to console
fprintf(stderr, "Remote Fabric Bridge has already been configured.\n");
Expand All @@ -91,7 +91,8 @@ CHIP_ERROR FabricSyncAddBridgeCommand::RunCommand(NodeId remoteId)

mBridgeNodeId = remoteId;

DeviceMgr().PairRemoteFabricBridge(remoteId, mSetupPINCode, reinterpret_cast<const char *>(mRemoteAddr.data()), mRemotePort);
DeviceManager::Instance().PairRemoteFabricBridge(remoteId, mSetupPINCode, reinterpret_cast<const char *>(mRemoteAddr.data()),
mRemotePort);

return CHIP_NO_ERROR;
}
Expand All @@ -106,7 +107,7 @@ void FabricSyncRemoveBridgeCommand::OnDeviceRemoved(NodeId deviceId, CHIP_ERROR

if (err == CHIP_NO_ERROR)
{
DeviceMgr().SetRemoteBridgeNodeId(kUndefinedNodeId);
DeviceManager::Instance().SetRemoteBridgeNodeId(kUndefinedNodeId);
ChipLogProgress(NotSpecified, "Successfully removed bridge device: NodeId: " ChipLogFormatX64,
ChipLogValueX64(mBridgeNodeId));
}
Expand All @@ -121,7 +122,7 @@ void FabricSyncRemoveBridgeCommand::OnDeviceRemoved(NodeId deviceId, CHIP_ERROR

CHIP_ERROR FabricSyncRemoveBridgeCommand::RunCommand()
{
NodeId bridgeNodeId = DeviceMgr().GetRemoteBridgeNodeId();
NodeId bridgeNodeId = DeviceManager::Instance().GetRemoteBridgeNodeId();

if (bridgeNodeId == kUndefinedNodeId)
{
Expand All @@ -133,7 +134,7 @@ CHIP_ERROR FabricSyncRemoveBridgeCommand::RunCommand()
mBridgeNodeId = bridgeNodeId;

PairingManager::Instance().SetPairingDelegate(this);
DeviceMgr().UnpairRemoteFabricBridge();
DeviceManager::Instance().UnpairRemoteFabricBridge();

return CHIP_NO_ERROR;
}
Expand All @@ -157,8 +158,8 @@ void FabricSyncAddLocalBridgeCommand::OnCommissioningComplete(NodeId deviceId, C

if (err == CHIP_NO_ERROR)
{
DeviceMgr().SetLocalBridgeNodeId(mLocalBridgeNodeId);
DeviceMgr().UpdateLastUsedNodeId(mLocalBridgeNodeId);
DeviceManager::Instance().SetLocalBridgeNodeId(mLocalBridgeNodeId);
DeviceManager::Instance().UpdateLastUsedNodeId(mLocalBridgeNodeId);
ChipLogProgress(NotSpecified, "Successfully paired local bridge device: NodeId: " ChipLogFormatX64,
ChipLogValueX64(mLocalBridgeNodeId));
}
Expand All @@ -173,7 +174,7 @@ void FabricSyncAddLocalBridgeCommand::OnCommissioningComplete(NodeId deviceId, C

CHIP_ERROR FabricSyncAddLocalBridgeCommand::RunCommand(NodeId deviceId)
{
if (DeviceMgr().IsLocalBridgeReady())
if (DeviceManager::Instance().IsLocalBridgeReady())
{
// print to console
fprintf(stderr, "Local Fabric Bridge has already been configured.\n");
Expand All @@ -185,14 +186,14 @@ CHIP_ERROR FabricSyncAddLocalBridgeCommand::RunCommand(NodeId deviceId)

if (mSetupPINCode.HasValue())
{
DeviceMgr().SetLocalBridgeSetupPinCode(mSetupPINCode.Value());
DeviceManager::Instance().SetLocalBridgeSetupPinCode(mSetupPINCode.Value());
}
if (mLocalPort.HasValue())
{
DeviceMgr().SetLocalBridgePort(mLocalPort.Value());
DeviceManager::Instance().SetLocalBridgePort(mLocalPort.Value());
}

DeviceMgr().PairLocalFabricBridge(deviceId);
DeviceManager::Instance().PairLocalFabricBridge(deviceId);

return CHIP_NO_ERROR;
}
Expand All @@ -207,7 +208,7 @@ void FabricSyncRemoveLocalBridgeCommand::OnDeviceRemoved(NodeId deviceId, CHIP_E

if (err == CHIP_NO_ERROR)
{
DeviceMgr().SetLocalBridgeNodeId(kUndefinedNodeId);
DeviceManager::Instance().SetLocalBridgeNodeId(kUndefinedNodeId);
ChipLogProgress(NotSpecified, "Successfully removed local bridge device: NodeId: " ChipLogFormatX64,
ChipLogValueX64(mLocalBridgeNodeId));
}
Expand All @@ -222,7 +223,7 @@ void FabricSyncRemoveLocalBridgeCommand::OnDeviceRemoved(NodeId deviceId, CHIP_E

CHIP_ERROR FabricSyncRemoveLocalBridgeCommand::RunCommand()
{
NodeId bridgeNodeId = DeviceMgr().GetLocalBridgeNodeId();
NodeId bridgeNodeId = DeviceManager::Instance().GetLocalBridgeNodeId();

if (bridgeNodeId == kUndefinedNodeId)
{
Expand All @@ -234,7 +235,7 @@ CHIP_ERROR FabricSyncRemoveLocalBridgeCommand::RunCommand()
mLocalBridgeNodeId = bridgeNodeId;

PairingManager::Instance().SetPairingDelegate(this);
DeviceMgr().UnpairLocalFabricBridge();
DeviceManager::Instance().UnpairLocalFabricBridge();

return CHIP_NO_ERROR;
}
Expand All @@ -250,14 +251,14 @@ void FabricSyncDeviceCommand::OnCommissioningWindowOpened(NodeId deviceId, CHIP_
CHIP_ERROR error = ManualSetupPayloadGenerator(payload).payloadDecimalStringRepresentation(manualCode);
if (error == CHIP_NO_ERROR)
{
NodeId nodeId = DeviceMgr().GetNextAvailableNodeId();
NodeId nodeId = DeviceManager::Instance().GetNextAvailableNodeId();

PairingManager::Instance().SetPairingDelegate(this);
mAssignedNodeId = nodeId;

usleep(kCommissionPrepareTimeMs * 1000);

DeviceMgr().PairRemoteDevice(nodeId, payloadBuffer);
DeviceManager::Instance().PairRemoteDevice(nodeId, payloadBuffer);
}
else
{
Expand All @@ -283,7 +284,7 @@ void FabricSyncDeviceCommand::OnCommissioningComplete(NodeId deviceId, CHIP_ERRO

if (err == CHIP_NO_ERROR)
{
DeviceMgr().AddSyncedDevice(Device(mAssignedNodeId, mRemoteEndpointId));
DeviceManager::Instance().AddSyncedDevice(Device(mAssignedNodeId, mRemoteEndpointId));
}
else
{
Expand All @@ -294,7 +295,7 @@ void FabricSyncDeviceCommand::OnCommissioningComplete(NodeId deviceId, CHIP_ERRO

CHIP_ERROR FabricSyncDeviceCommand::RunCommand(EndpointId remoteEndpointId)
{
if (!DeviceMgr().IsFabricSyncReady())
if (!DeviceManager::Instance().IsFabricSyncReady())
{
// print to console
fprintf(stderr, "Remote Fabric Bridge is not configured yet.\n");
Expand All @@ -303,7 +304,7 @@ CHIP_ERROR FabricSyncDeviceCommand::RunCommand(EndpointId remoteEndpointId)

PairingManager::Instance().SetOpenCommissioningWindowDelegate(this);

DeviceMgr().OpenRemoteDeviceCommissioningWindow(remoteEndpointId);
DeviceManager::Instance().OpenRemoteDeviceCommissioningWindow(remoteEndpointId);

return CHIP_NO_ERROR;
}
Expand Down
11 changes: 4 additions & 7 deletions examples/fabric-admin/commands/pairing/PairingCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <commands/interactive/InteractiveCommands.h>
#include <controller/ExampleOperationalCredentialsIssuer.h>
#include <crypto/CHIPCryptoPAL.h>
#include <device_manager/DeviceManager.h>
#include <device_manager/DeviceSynchronization.h>
#include <lib/core/CHIPSafeCasts.h>
#include <lib/support/logging/CHIPLogging.h>
Expand All @@ -33,10 +34,6 @@

#include <string>

#if defined(PW_RPC_ENABLED)
#include <rpc/RpcClient.h>
#endif

using namespace ::chip;
using namespace ::chip::Controller;

Expand Down Expand Up @@ -534,16 +531,16 @@ void PairingCommand::OnCurrentFabricRemove(void * context, NodeId nodeId, CHIP_E
PairingCommand * command = reinterpret_cast<PairingCommand *>(context);
VerifyOrReturn(command != nullptr, ChipLogError(NotSpecified, "OnCurrentFabricRemove: context is null"));

ChipLogProgress(NotSpecified, "PairingCommand::OnCurrentFabricRemove");

if (err == CHIP_NO_ERROR)
{
// print to console
fprintf(stderr, "Device with Node ID: 0x%lx has been successfully removed.\n", nodeId);

#if defined(PW_RPC_ENABLED)
app::InteractionModelEngine::GetInstance()->ShutdownSubscriptions(command->CurrentCommissioner().GetFabricIndex(), nodeId);
ScopedNodeId scopedNodeId(nodeId, command->CurrentCommissioner().GetFabricIndex());
admin::RemoveSynchronizedDevice(scopedNodeId);
#endif
admin::DeviceManager::Instance().RemoveSyncedDevice(scopedNodeId);
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions examples/fabric-admin/device_manager/BridgeSubscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void BridgeSubscription::OnAttributeData(const ConcreteDataAttributePath & path,
return;
}

DeviceMgr().HandleAttributeData(path, *data);
DeviceManager::Instance().HandleAttributeData(path, *data);
}

void BridgeSubscription::OnEventData(const app::EventHeader & eventHeader, TLV::TLVReader * data, const app::StatusIB * status)
Expand All @@ -101,7 +101,7 @@ void BridgeSubscription::OnEventData(const app::EventHeader & eventHeader, TLV::
return;
}

DeviceMgr().HandleEventData(eventHeader, *data);
DeviceManager::Instance().HandleEventData(eventHeader, *data);
}

void BridgeSubscription::OnError(CHIP_ERROR error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void CommissionerControl::OnResponse(app::CommandSender * client, const app::Con

if (data != nullptr)
{
DeviceMgr().HandleCommandResponse(path, *data);
DeviceManager::Instance().HandleCommandResponse(path, *data);
}
}

Expand Down
Loading

0 comments on commit c991d25

Please sign in to comment.