Skip to content

Commit

Permalink
Merge branch 'master' into telink_TC_OO_24_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
s07641069 authored Sep 20, 2022
2 parents 2af38aa + 7a06f13 commit eb94787
Show file tree
Hide file tree
Showing 127 changed files with 2,691 additions and 886 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ jobs:
scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_RR_1_1.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"'
scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_SC_3_6.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"'
scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_DA_1_7.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --bool-arg allow_sdk_dac:true"'
scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1 --enable-key 000102030405060708090a0b0c0d0e0f" --script "src/python_testing/TC_TestEventTrigger.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --bool-arg allow_sdk_dac:true"'
- name: Uploading core files
uses: actions/upload-artifact@v2
if: ${{ failure() && !env.ACT }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3708,6 +3708,7 @@ server cluster TestCluster = 4294048773 {
attribute nullable int8s nullableRangeRestrictedInt8s = 16423;
attribute nullable int16u nullableRangeRestrictedInt16u = 16424;
attribute nullable int16s nullableRangeRestrictedInt16s = 16425;
attribute int8u writeOnlyInt8u = 16426;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

Expand Down Expand Up @@ -4772,6 +4773,7 @@ endpoint 1 {
ram attribute nullableRangeRestrictedInt8s default = -20;
ram attribute nullableRangeRestrictedInt16u default = 200;
ram attribute nullableRangeRestrictedInt16s default = -100;
callback attribute writeOnlyInt8u;
ram attribute featureMap;
ram attribute clusterRevision default = 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20700,6 +20700,22 @@
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "write_only_int8u",
"code": 16426,
"mfgCode": null,
"side": "server",
"type": "int8u",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AttributeList",
"code": 65531,
Expand Down Expand Up @@ -24724,5 +24740,6 @@
"endpointVersion": 1,
"deviceIdentifier": 61442
}
]
],
"log": []
}
4 changes: 4 additions & 0 deletions examples/all-clusters-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ list(
${chip_dir}/examples/all-clusters-app/ameba/main/LEDWidget.cpp
${chip_dir}/examples/all-clusters-app/ameba/main/DsoHack.cpp

${chip_dir}/examples/platform/ameba/route_hook/ameba_route_hook.c
${chip_dir}/examples/platform/ameba/route_hook/ameba_route_table.c

${chip_dir}/examples/providers/DeviceInfoProviderImpl.cpp
)

Expand Down Expand Up @@ -204,6 +207,7 @@ target_include_directories(
${chip_dir}/examples/all-clusters-app/all-clusters-common/include
${chip_dir}/examples/all-clusters-app/ameba/main/include
${chip_dir}/examples/platform/ameba
${chip_dir}/examples/platform/ameba/route_hook
${chip_dir}/examples/providers
${chip_dir_output}/gen/include
${chip_dir}/src/include/
Expand Down
6 changes: 5 additions & 1 deletion examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* Implements all the callbacks to the application from the CHIP Stack
*
**/
#include "DeviceCallbacks.h"

#include "DeviceCallbacks.h"
#include "CHIPDeviceManager.h"
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/cluster-id.h>
Expand All @@ -33,6 +33,7 @@
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/dnssd/Advertiser.h>
#include <route_hook/ameba_route_hook.h>
#include <support/CodeUtils.h>
#include <support/logging/CHIPLogging.h>
#include <support/logging/Constants.h>
Expand Down Expand Up @@ -121,6 +122,9 @@ 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
2 changes: 0 additions & 2 deletions examples/all-clusters-app/cc13x2x7_26x2x7/chip.syscfg
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ ble.connUpdateParamsPeripheral.reqMaxConnInt = 50;

ble.advSet1.$name = "ti_ble5stack_broadcaster_advertisement_set0";
ble.advSet1.advParam1.$name = "ti_ble5stack_broadcaster_advertisement_params0";
ble.advSet1.advParam1.primIntMin = 100;
ble.advSet1.advParam1.primIntMax = 200;

/* DMM */
dmm.project = "ti_thread_thermostat_remote_display";
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/linux/main-common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ void ApplicationExit()

void emberAfLowPowerClusterInitCallback(EndpointId endpoint)
{
ChipLogProgress(NotSpecified, "TV Linux App: LowPower::SetDefaultDelegate");
ChipLogProgress(NotSpecified, "Setting LowPower default delegate to global manager");
chip::app::Clusters::LowPower::SetDefaultDelegate(endpoint, &sLowPowerManager);
}

Expand Down
2 changes: 0 additions & 2 deletions examples/all-clusters-minimal-app/cc13x2x7_26x2x7/chip.syscfg
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ ble.connUpdateParamsPeripheral.reqMaxConnInt = 50;

ble.advSet1.$name = "ti_ble5stack_broadcaster_advertisement_set0";
ble.advSet1.advParam1.$name = "ti_ble5stack_broadcaster_advertisement_params0";
ble.advSet1.advParam1.primIntMin = 100;
ble.advSet1.advParam1.primIntMax = 200;

/* DMM */
dmm.project = "ti_thread_thermostat_remote_display";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#import <Matter/Matter.h>

#define LOG_DEBUG_PERSISTENT_STORAGE_DELEGATE 0

NSString * const kCHIPToolDefaultsDomain = @"com.apple.chiptool";

id MTRGetDomainValueForKey(NSString * domain, NSString * key)
Expand Down Expand Up @@ -39,9 +41,13 @@ BOOL CHIPClearAllDomain(NSString * domain)
{

NSArray * allKeys = CHIPGetDomainKeyList(domain);
#if LOG_DEBUG_PERSISTENT_STORAGE_DELEGATE
NSLog(@"Removing keys: %@ %@", allKeys, domain);
#endif
for (id key in allKeys) {
#if LOG_DEBUG_PERSISTENT_STORAGE_DELEGATE
NSLog(@"Removing key: %@", key);
#endif
if (!MTRRemoveDomainValueForKey(domain, (NSString *) key)) {
return NO;
}
Expand All @@ -61,7 +67,9 @@ - (BOOL)deleteAllStorage
- (nullable NSData *)storageDataForKey:(NSString *)key
{
NSData * value = MTRGetDomainValueForKey(kCHIPToolDefaultsDomain, key);
#if LOG_DEBUG_PERSISTENT_STORAGE_DELEGATE
NSLog(@"CHIPPersistentStorageDelegate Get Value for Key: %@, value %@", key, value);
#endif
return value;
}

Expand Down
8 changes: 4 additions & 4 deletions examples/darwin-framework-tool/commands/common/MTRError.mm
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
#import <lib/support/TypeTraits.h>

// Stolen for now from the framework, need to export this properly.
@interface MTRErrorHolder : NSObject
@interface DFTErrorHolder : NSObject
@property (nonatomic, readonly) CHIP_ERROR error;
@end

@implementation MTRErrorHolder
@implementation DFTErrorHolder

- (instancetype)initWithError:(CHIP_ERROR)error
{
Expand Down Expand Up @@ -64,8 +64,8 @@ CHIP_ERROR MTRErrorToCHIPErrorCode(NSError * error)

if (error.userInfo != nil) {
id underlyingError = error.userInfo[@"underlyingError"];
if (underlyingError != nil && [underlyingError isKindOfClass:[MTRErrorHolder class]]) {
return ((MTRErrorHolder *) underlyingError).error;
if (underlyingError != nil && [underlyingError isKindOfClass:[DFTErrorHolder class]]) {
return ((DFTErrorHolder *) underlyingError).error;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ constexpr const char * kDefaultKey = "default";
@property chip::NodeId deviceId;
@property BOOL active; // Whether to pass on notifications to the commandBridge

- (void)onStatusUpdate:(MTRCommissioningStatus)status;
- (void)onCommissioningSessionEstablishmentDone:(NSError * _Nullable)error;
- (void)onCommissioningComplete:(NSError * _Nullable)error;
- (void)controller:(MTRDeviceController *)controller statusUpdate:(MTRCommissioningStatus)status;
- (void)controller:(MTRDeviceController *)controller commissioningSessionEstablishmentDone:(NSError * _Nullable)error;
- (void)controller:(MTRDeviceController *)controller commissioningComplete:(NSError * _Nullable)error;

- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithTestCommandBridge:(TestCommandBridge *)commandBridge;
Expand Down Expand Up @@ -529,7 +529,7 @@ class TestCommandBridge : public CHIPCommandBridge,
NS_ASSUME_NONNULL_BEGIN

@implementation TestDeviceControllerDelegate
- (void)onStatusUpdate:(MTRCommissioningStatus)status
- (void)controller:(MTRDeviceController *)controller statusUpdate:(MTRCommissioningStatus)status
{
if (_active) {
if (status == MTRCommissioningStatusSuccess) {
Expand All @@ -542,7 +542,7 @@ NS_ASSUME_NONNULL_BEGIN
}
}

- (void)onCommissioningSessionEstablishmentDone:(NSError * _Nullable)error
- (void)controller:(MTRDeviceController *)controller commissioningSessionEstablishmentDone:(NSError * _Nullable)error
{
if (_active) {
if (error != nil) {
Expand All @@ -556,7 +556,7 @@ NS_ASSUME_NONNULL_BEGIN
}
}

- (void)onCommissioningComplete:(NSError * _Nullable)error
- (void)controller:(MTRDeviceController *)controller commissioningComplete:(NSError * _Nullable)error
{
if (_active) {
_active = NO;
Expand Down
15 changes: 3 additions & 12 deletions examples/light-switch-app/nrfconnect/main/BindingHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,13 @@ void BindingHandler::Init()
DeviceLayer::PlatformMgr().ScheduleWork(InitInternal);
}

void BindingHandler::OnInvokeCommandFailure(DeviceProxy * aDevice, BindingData & aBindingData, CHIP_ERROR aError)
void BindingHandler::OnInvokeCommandFailure(BindingData & aBindingData, CHIP_ERROR aError)
{
CHIP_ERROR error;

if (aError == CHIP_ERROR_TIMEOUT && !BindingHandler::GetInstance().mCaseSessionRecovered)
{
LOG_INF("Response timeout for invoked command, trying to recover CASE session.");
if (!aDevice)
return;

// Release current CASE session.
aDevice->Disconnect();

// Set flag to not try recover session multiple times.
BindingHandler::GetInstance().mCaseSessionRecovered = true;
Expand Down Expand Up @@ -85,9 +80,7 @@ void BindingHandler::OnOffProcessCommand(CommandId aCommandId, const EmberBindin
BindingHandler::GetInstance().mCaseSessionRecovered = false;
};

auto onFailure = [aDevice, dataRef = *data](CHIP_ERROR aError) mutable {
BindingHandler::OnInvokeCommandFailure(aDevice, dataRef, aError);
};
auto onFailure = [dataRef = *data](CHIP_ERROR aError) mutable { BindingHandler::OnInvokeCommandFailure(dataRef, aError); };

if (aDevice)
{
Expand Down Expand Up @@ -162,9 +155,7 @@ void BindingHandler::LevelControlProcessCommand(CommandId aCommandId, const Embe
BindingHandler::GetInstance().mCaseSessionRecovered = false;
};

auto onFailure = [aDevice, dataRef = *data](CHIP_ERROR aError) mutable {
BindingHandler::OnInvokeCommandFailure(aDevice, dataRef, aError);
};
auto onFailure = [dataRef = *data](CHIP_ERROR aError) mutable { BindingHandler::OnInvokeCommandFailure(dataRef, aError); };

CHIP_ERROR ret = CHIP_NO_ERROR;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class BindingHandler
bool IsGroupBound();

static void SwitchWorkerHandler(intptr_t);
static void OnInvokeCommandFailure(chip::DeviceProxy * aDevice, BindingData & aBindingData, CHIP_ERROR aError);
static void OnInvokeCommandFailure(BindingData & aBindingData, CHIP_ERROR aError);

static BindingHandler & GetInstance()
{
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/bouffalolab/bl602/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ The steps in this document were validated on Ubuntu 18.04 and 20.04.
```
cd third_party/bouffalolab/repo/tools/flash_tool
./bflb_iot_tool-ubuntu18 --chipname=BL602 --baudrate=115200 --port=/dev/ttyACM0 --pt=chips/bl602/partition/partition_cfg_4M.toml --dts=chips/bl602/device_tree/bl_factory_params_IoTKitA_40M.dts --firmware=../../../../../../out/bl602-light/chip-bl602-lighting-example.bin
./bflb_iot_tool --chipname=BL602 --baudrate=115200 --port=/dev/ttyACM0 --pt=chips/bl602/partition/partition_cfg_4M.toml --dts=chips/bl602/device_tree/bl_factory_params_IoTKitA_40M.dts --firmware=../../../../../out/bl602-light/chip-bl602-lighting-example.bin
```
```
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/bouffalolab/bl602/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#define FACTORY_RESET_TRIGGER_TIMEOUT 3000
#define FACTORY_RESET_CANCEL_WINDOW_TIMEOUT 3000
#define APP_EVENT_QUEUE_SIZE 10
#define APP_TASK_STACK_SIZE (8192)
#define APP_TASK_STACK_SIZE (4096)
#define APP_TASK_PRIORITY 2
#define STATUS_LED_GPIO_NUM GPIO_NUM_2 // Use LED1 (blue LED) as status LED on DevKitC

Expand Down
10 changes: 0 additions & 10 deletions examples/lighting-app/qpg/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,6 @@
*/
#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512)

/**
* @def CHIP_CONFIG_MAX_FABRICS
*
* @brief
* Maximum number of fabrics the device can participate in. Each fabric can
* provision the device with its unique operational credentials and manage
* its own access control lists.
*/
#define CHIP_CONFIG_MAX_FABRICS 4 // 3 fabrics + 1 for rotation slack

/**
* @name Interaction Model object pool configuration.
*
Expand Down
2 changes: 0 additions & 2 deletions examples/lock-app/cc13x2x7_26x2x7/chip.syscfg
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ ble.connUpdateParamsPeripheral.reqMaxConnInt = 50;

ble.advSet1.$name = "ti_ble5stack_broadcaster_advertisement_set0";
ble.advSet1.advParam1.$name = "ti_ble5stack_broadcaster_advertisement_params0";
ble.advSet1.advParam1.primIntMin = 100;
ble.advSet1.advParam1.primIntMax = 200;

/* DMM */
dmm.project = "ti_thread_thermostat_remote_display";
Expand Down
10 changes: 0 additions & 10 deletions examples/lock-app/qpg/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,6 @@
*/
#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512)

/**
* @def CHIP_CONFIG_MAX_FABRICS
*
* @brief
* Maximum number of fabrics the device can participate in. Each fabric can
* provision the device with its unique operational credentials and manage
* its own access control lists.
*/
#define CHIP_CONFIG_MAX_FABRICS 4 // 3 fabrics + 1 for rotation slack

/**
* @name Interaction Model object pool configuration.
*
Expand Down
8 changes: 5 additions & 3 deletions examples/lock-app/qpg/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,12 +542,14 @@ void AppTask::DispatchEvent(AppEvent * aEvent)
*/
void AppTask::UpdateClusterState(void)
{
using namespace chip::app::Clusters;
auto newValue = BoltLockMgr().IsUnlocked() ? DoorLock::DlLockState::kUnlocked : DoorLock::DlLockState::kLocked;

ChipLogProgress(NotSpecified, "UpdateClusterState");

// write the new on/off value
EmberAfStatus status = Clusters::OnOff::Attributes::OnOff::Set(QPG_LOCK_ENDPOINT_ID, !BoltLockMgr().IsUnlocked());
EmberAfStatus status = DoorLock::Attributes::LockState::Set(DOOR_LOCK_SERVER_ENDPOINT, newValue);
if (status != EMBER_ZCL_STATUS_SUCCESS)
{
ChipLogError(NotSpecified, "ERR: updating on/off %x", status);
ChipLogError(NotSpecified, "ERR: updating DoorLock %x", status);
}
}
Loading

0 comments on commit eb94787

Please sign in to comment.