Skip to content

Commit

Permalink
Merge branch 'master' into cherry-pick/feature/soc_cherry_pick_slc_ch…
Browse files Browse the repository at this point in the history
…anges
  • Loading branch information
KishorSilabs authored Dec 20, 2023
2 parents 729a377 + ce32d11 commit 6fc5bd9
Show file tree
Hide file tree
Showing 264 changed files with 124,834 additions and 4,144 deletions.
1 change: 1 addition & 0 deletions config/nrfconnect/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ matter_add_gn_arg_bool ("chip_enable_wifi" CONFIG_WIFI_NR
matter_add_gn_arg_bool ("chip_system_config_provide_statistics" CONFIG_CHIP_STATISTICS)
matter_add_gn_arg_bool ("chip_enable_icd_server" CONFIG_CHIP_ENABLE_ICD_SUPPORT)
matter_add_gn_arg_bool ("chip_enable_factory_data" CONFIG_CHIP_FACTORY_DATA)
matter_add_gn_arg_bool ("chip_enable_read_client" CONFIG_CHIP_ENABLE_READ_CLIENT)

if (CONFIG_CHIP_FACTORY_DATA OR CONFIG_CHIP_FACTORY_DATA_CUSTOM_BACKEND)
matter_add_gn_arg_bool("chip_use_transitional_commissionable_data_provider" FALSE)
Expand Down
7 changes: 7 additions & 0 deletions config/nrfconnect/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,11 @@ config CHIP_OPENTHREAD_JOINER_ENABLED
If disabled, it allows to optimize memory usage even if Thread Joiner
support is enabled.

config CHIP_ENABLE_READ_CLIENT
bool "Enable Read Client in the Interaction Model"
help
Enable support for Read Client in the Interaction Model.
This config can be disabled for device types that do not require Read Client functionality.
Disabling this config can save flash and RAM space.

endif # CHIP
3 changes: 2 additions & 1 deletion docs/clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@ Generally regenerate using one of:
| 97 | 0x61 | RvcOperationalState |
| 113 | 0x71 | HepaFilterMonitoring |
| 114 | 0x72 | ActivatedCarbonFilterMonitoring |
| 128 | 0x80 | BooleanSensorConfiguration |
| 128 | 0x80 | BooleanStateConfiguration |
| 129 | 0x81 | ValveConfigurationAndControl |
| 145 | 0x91 | ElectricalEnergyMeasurement |
| 150 | 0x96 | DemandResponseLoadControl |
| 152 | 0x98 | DeviceEnergyManagement |
| 153 | 0x99 | EnergyEvse |
| 155 | 0x9B | EnergyPreference |
| 257 | 0x101 | DoorLock |
| 258 | 0x102 | WindowCovering |
| 259 | 0x103 | BarrierControl |
Expand Down
9 changes: 9 additions & 0 deletions docs/examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ chip-tool/README
darwin-framework-tool/README
```

## Energy Management example

```{toctree}
:glob:
:maxdepth: 1
energy-management-app/**/README
```

## Java matter controller example

```{toctree}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7354,6 +7354,15 @@ endpoint 1 {
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 2;

handle command GetTargetsResponse;
handle command Disable;
handle command EnableCharging;
handle command EnableDischarging;
handle command StartDiagnostics;
handle command SetTargets;
handle command GetTargets;
handle command ClearTargets;
}

server cluster WindowCovering {
Expand Down
74 changes: 70 additions & 4 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -11737,6 +11737,72 @@
"side": "server",
"enabled": 1,
"apiMaturity": "provisional",
"commands": [
{
"name": "GetTargetsResponse",
"code": 0,
"mfgCode": null,
"source": "server",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "Disable",
"code": 1,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "EnableCharging",
"code": 2,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "EnableDischarging",
"code": 3,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "StartDiagnostics",
"code": 4,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "SetTargets",
"code": 5,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "GetTargets",
"code": 6,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "ClearTargets",
"code": 7,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
}
],
"attributes": [
{
"name": "State",
Expand Down Expand Up @@ -12148,7 +12214,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12164,7 +12230,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12180,7 +12246,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -12196,7 +12262,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
*
* Copyright (c) 2023 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

namespace chip {
namespace app {
namespace Clusters {

using namespace chip::app::Clusters::EnergyEvse;

/* This callbacks mechanism is intended to allow different delegates to
* dispatch notifications that something has changed.
*
* This is not specific to the EnergyEVSE cluster, but includes DeviceEnergyManagement
* and potential future clusters.
*/
enum EVSECallbackType
{
/*
* The State has changed (e.g. from Disabled to Charging, or vice-versa)
*/
StateChanged,
/*
* ChargeCurrent has changed
*/
ChargeCurrentChanged,
/*
* Charging Preferences have changed
*/
ChargingPreferencesChanged,
/*
* DeviceEnergyManagement has changed
*/
DeviceEnergyManagementChanged,
};

struct EVSECbInfo
{
EVSECallbackType type;

union
{
/* for type = StateChanged */
struct
{
StateEnum state;
SupplyStateEnum supplyState;
} StateChange;

/* for type = ChargeCurrentChanged */
struct
{
int64_t maximumChargeCurrent;
} ChargingCurrent;
};
};

typedef void (*EVSECallbackFunc)(const EVSECbInfo * cb, intptr_t arg);

struct EVSECallbackWrapper
{
EVSECallbackFunc handler;
intptr_t arg;
};

} // namespace Clusters
} // namespace app
} // namespace chip
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#pragma once

#include "app/clusters/energy-evse-server/energy-evse-server.h"
#include <EVSECallbacks.h>

#include <app/util/af.h>
#include <app/util/config.h>
Expand Down Expand Up @@ -68,9 +69,13 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate
*/
Status StartDiagnostics() override;

/**
* @brief Called by EVSE Hardware to register a single callback handler
*/
Status HwRegisterEvseCallbackHandler(EVSECallbackFunc handler, intptr_t arg);

// -----------------------------------------------------------------
// Internal API to allow an EVSE to change its internal state etc
// TODO Status HwRegisterEvseHardwareCallback(Callback);
Status HwSetMaxHardwareCurrentLimit(int64_t currentmA);
Status HwSetCircuitCapacity(int64_t currentmA);
Status HwSetCableAssemblyLimit(int64_t currentmA);
Expand Down Expand Up @@ -150,6 +155,11 @@ class EnergyEvseDelegate : public EnergyEvse::Delegate
int64_t mActualChargingCurrentLimit = 0;
StateEnum mHwState = StateEnum::kNotPluggedIn; /* Hardware state */

/* Callback related */
EVSECallbackWrapper mCallbacks = { .handler = nullptr, .arg = 0 }; /* Wrapper to allow callbacks to be registered */
Status NotifyApplicationCurrentLimitChange(int64_t maximumChargeCurrent);
Status NotifyApplicationStateChange();

/**
* @brief Helper function to work out the charge limit based on conditions and settings
*/
Expand Down
Loading

0 comments on commit 6fc5bd9

Please sign in to comment.