Skip to content

Commit

Permalink
Merge branch 'master' into refactor-acl-storage
Browse files Browse the repository at this point in the history
  • Loading branch information
mlepage-google committed Apr 27, 2022
2 parents fe8ef75 + 11c49af commit 3c71264
Show file tree
Hide file tree
Showing 304 changed files with 52,657 additions and 120,352 deletions.
6 changes: 0 additions & 6 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ Checks: >
modernize-use-nullptr,
bugprone-*,
-bugprone-not-null-terminated-result,
-bugprone-suspicious-memory-comparison,
-bugprone-argument-comment,
-bugprone-unused-return-value,
-bugprone-branch-clone,
-bugprone-easily-swappable-parameters,
Expand All @@ -14,9 +12,7 @@ Checks: >
-bugprone-forward-declaration-namespace,
-bugprone-forwarding-reference-overload,
-bugprone-undelegated-constructor,
-bugprone-sizeof-expression,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-too-small-loop-variable,
-bugprone-narrowing-conversions,
-bugprone-misplaced-widening-cast,
-bugprone-suspicious-include,
Expand All @@ -33,10 +29,8 @@ Checks: >
-clang-analyzer-security.insecureAPI.strcpy,
-clang-analyzer-nullability.NullablePassedToNonnull,
-clang-analyzer-optin.performance.Padding,
-clang-analyzer-unix.cstring.NullArg,
-clang-analyzer-security.insecureAPI.rand,
-clang-analyzer-core.NonNullParamChecker,
-clang-analyzer-nullability.NullPassedToNonnull,
-clang-analyzer-unix.Malloc,
-clang-diagnostic-implicit-int-conversion
WarningsAsErrors: '*'
Expand Down
4 changes: 2 additions & 2 deletions build/chip/java/tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ java_library("grandchild_library") {
}

java_prebuilt("java_prebuilt") {
jar_path = "/tmp/chip_java_build_test/prebuilt_jar.jar"
jar_path = "prebuilt_jar.jar"
deps = [ ":child_prebuilt" ]
}

java_prebuilt("child_prebuilt") {
jar_path = "/tmp/chip_java_build_test/child_jar.jar"
jar_path = "child_jar.jar"
}
Binary file added build/chip/java/tests/child_jar.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion build/chip/java/tests/generate_jars_for_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def generateJar(source_file, output_name):
'python3',
chip_root + '/build/chip/java/jar_runner.py',
'cf',
tmp_dir + '/' + output_name,
test_dir + '/' + output_name,
'-C',
tmp_classes_dir,
'.',
Expand Down
Binary file added build/chip/java/tests/prebuilt_jar.jar
Binary file not shown.
5 changes: 1 addition & 4 deletions build/chip/java/tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
# limitations under the License.

"""
Test for GN Java build rules. This test should be executed using ninja, and
generate_jars_for_test.py should have been called before running this test.
Test for GN Java build rules. This test should be executed using ninja.
"""

import json
Expand All @@ -33,8 +32,6 @@ class JavaBuildTest(unittest.TestCase):
jars_dir = 'python/lib' + local_test_dir
configs_dir = 'python/gen' + local_test_dir

tmp_dir = '/tmp/chip_java_build_test'

# Target names in the BUILD.gn
targets_to_check = [
'java_library',
Expand Down
5 changes: 0 additions & 5 deletions config/tizen/chip-gn/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@

import("//build_overrides/chip.gni")

declare_args() {
# Location of the Tizen SDK.
tizen_sdk_root = ""
}

chip_device_platform = "tizen"

chip_build_tests = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ server cluster ApplicationBasic = 1293 {
}

server cluster ApplicationLauncher = 1292 {
enum StatusEnum : ENUM8 {
enum ApplicationLauncherStatusEnum : ENUM8 {
kSuccess = 0;
kAppNotAvailable = 1;
kSystemBusy = 2;
Expand Down Expand Up @@ -339,16 +339,16 @@ server cluster BridgedActions = 37 {
}

server cluster Channel = 1284 {
enum LineupInfoTypeEnum : ENUM8 {
kMso = 0;
}

enum StatusEnum : ENUM8 {
enum ChannelStatusEnum : ENUM8 {
kSuccess = 0;
kMultipleMatches = 1;
kNoMatches = 2;
}

enum LineupInfoTypeEnum : ENUM8 {
kMso = 0;
}

bitmap ChannelFeature : BITMAP32 {
kChannelList = 0x1;
kLineupInfo = 0x2;
Expand Down Expand Up @@ -661,6 +661,12 @@ server cluster ColorControl = 768 {
}

server cluster ContentLauncher = 1290 {
enum ContentLaunchStatusEnum : ENUM8 {
kSuccess = 0;
kUrlNotAvailable = 1;
kAuthFailed = 2;
}

enum MetricTypeEnum : ENUM8 {
kPixels = 0;
kPercentage = 1;
Expand All @@ -682,12 +688,6 @@ server cluster ContentLauncher = 1290 {
kType = 12;
}

enum StatusEnum : ENUM8 {
kSuccess = 0;
kUrlNotAvailable = 1;
kAuthFailed = 2;
}

bitmap ContentLauncherFeature : BITMAP32 {
kContentSearch = 0x1;
kURLPlayback = 0x2;
Expand Down Expand Up @@ -1910,7 +1910,7 @@ server cluster KeypadInput = 1289 {
kData = 118;
}

enum StatusEnum : ENUM8 {
enum KeypadInputStatusEnum : ENUM8 {
kSuccess = 0;
kUnsupportedKey = 1;
kInvalidKeyInCurrentState = 2;
Expand Down Expand Up @@ -2057,14 +2057,7 @@ server cluster MediaInput = 1287 {
}

server cluster MediaPlayback = 1286 {
enum PlaybackStateEnum : ENUM8 {
kPlaying = 0;
kPaused = 1;
kNotPlaying = 2;
kBuffering = 3;
}

enum StatusEnum : ENUM8 {
enum MediaPlaybackStatusEnum : ENUM8 {
kSuccess = 0;
kInvalidStateForCommand = 1;
kNotAllowed = 2;
Expand All @@ -2073,6 +2066,13 @@ server cluster MediaPlayback = 1286 {
kSeekOutOfRange = 5;
}

enum PlaybackStateEnum : ENUM8 {
kPlaying = 0;
kPaused = 1;
kNotPlaying = 2;
kBuffering = 3;
}

readonly attribute PlaybackStateEnum currentState = 0;
readonly attribute nullable epoch_us startTime = 1;
readonly attribute nullable int64u duration = 2;
Expand Down Expand Up @@ -2752,9 +2752,9 @@ server cluster PumpConfigurationAndControl = 512 {
}

server cluster RelativeHumidityMeasurement = 1029 {
readonly attribute int16u measuredValue = 0;
readonly attribute int16u minMeasuredValue = 1;
readonly attribute int16u maxMeasuredValue = 2;
readonly attribute nullable int16u measuredValue = 0;
readonly attribute nullable int16u minMeasuredValue = 1;
readonly attribute nullable int16u maxMeasuredValue = 2;
readonly attribute int16u tolerance = 3;
readonly attribute int16u clusterRevision = 65533;
}
Expand Down Expand Up @@ -2925,7 +2925,7 @@ server cluster Switch = 59 {
}

server cluster TargetNavigator = 1285 {
enum StatusEnum : ENUM8 {
enum TargetNavigatorStatusEnum : ENUM8 {
kSuccess = 0;
kTargetNotFound = 1;
kNotAllowed = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6768,7 +6768,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "0",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand All @@ -6783,7 +6783,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "0x2710",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down Expand Up @@ -10808,7 +10808,7 @@
"incoming": 1,
"outgoing": 0
},
{
{
"name": "GetYearDaySchedule",
"code": 15,
"mfgCode": null,
Expand Down Expand Up @@ -14909,7 +14909,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "0",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand All @@ -14924,7 +14924,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "0x2710",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,18 @@ static void BoundDeviceChangedHandler(const EmberBindingTableEntry & binding, ch
}
}

static void BoundDeviceContextReleaseHandler(void * context)
{
(void) context;
}

static void InitBindingHandlerInternal(intptr_t arg)
{
auto & server = chip::Server::GetInstance();
chip::BindingManager::GetInstance().Init(
{ &server.GetFabricTable(), server.GetCASESessionManager(), &server.GetPersistentStorage() });
chip::BindingManager::GetInstance().RegisterBoundDeviceChangedHandler(BoundDeviceChangedHandler);
chip::BindingManager::GetInstance().RegisterBoundDeviceContextReleaseHandler(BoundDeviceContextReleaseHandler);
}

CHIP_ERROR InitBindingHandlers()
Expand Down
11 changes: 9 additions & 2 deletions examples/all-clusters-app/linux/main-common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,13 @@ NetworkCommissioning::LinuxWiFiDriver sLinuxWiFiDriver;
Clusters::NetworkCommissioning::Instance sWiFiNetworkCommissioningInstance(kNetworkCommissioningEndpointSecondary,
&sLinuxWiFiDriver);
#endif
#endif // CHIP_DEVICE_LAYER_TARGET_LINUX

NetworkCommissioning::LinuxEthernetDriver sLinuxEthernetDriver;
Clusters::NetworkCommissioning::Instance sEthernetNetworkCommissioningInstance(kNetworkCommissioningEndpointMain,
&sLinuxEthernetDriver);
#else // CHIP_DEVICE_LAYER_TARGET_LINUX
Clusters::NetworkCommissioning::NullNetworkDriver sNullNetworkDriver;
Clusters::NetworkCommissioning::Instance sNullNetworkCommissioningInstance(kNetworkCommissioningEndpointMain, &sNullNetworkDriver);
#endif // CHIP_DEVICE_LAYER_TARGET_LINUX
} // namespace

void ApplicationInit()
Expand Down Expand Up @@ -166,8 +169,12 @@ void ApplicationInit()
else
#endif // CHIP_DEVICE_LAYER_TARGET_LINUX
{
#if CHIP_DEVICE_LAYER_TARGET_LINUX
sEthernetNetworkCommissioningInstance.Init();
#else
// Use NullNetworkCommissioningInstance to disable the network commissioning functions.
sNullNetworkCommissioningInstance.Init();
#endif
}
}

Expand Down
1 change: 1 addition & 0 deletions examples/all-clusters-app/nrfconnect/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build/
1 change: 1 addition & 0 deletions examples/all-clusters-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ target_sources(app PRIVATE
main/main.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/static-supported-modes-manager.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/bridged-actions-stub.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/binding-handler.cpp
${GEN_DIR}/all-clusters-app/zap-generated/callback-stub.cpp
${GEN_DIR}/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp
${NRFCONNECT_COMMON}/util/LEDWidget.cpp)
Expand Down
6 changes: 6 additions & 0 deletions examples/all-clusters-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "AppConfig.h"
#include "AppEvent.h"
#include "Utils.h"
#include "binding-handler.h"

#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
Expand Down Expand Up @@ -125,6 +126,11 @@ CHIP_ERROR AppTask::Init()
LOG_ERR("dk_buttons_init() failed");
return chip::System::MapErrorZephyr(ret);
}
err = InitBindingHandlers();
if (err != CHIP_NO_ERROR)
{
LOG_ERR("InitBindingHandlers() failed");
}

// Initialize timer user data
k_timer_init(&sFunctionTimer, &AppTask::TimerEventHandler, nullptr);
Expand Down
2 changes: 2 additions & 0 deletions examples/chip-tool-darwin/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ check_system_includes = true

default_args = {
import("//args.gni")

chip_disable_platform_kvs = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
auto params = [[MatterControllerFactoryParams alloc] initWithStorage:storage];
params.port = @(kListenPort);
params.startServer = YES;
params.kvsPath = @("/tmp/chip_kvs_darwin");

if ([factory startup:params] == NO) {
ChipLogError(chipTool, "Controller factory startup failed");
Expand Down
4 changes: 2 additions & 2 deletions examples/chip-tool-darwin/commands/tests/TestCommandBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ class TestCommandBridge : public CHIPCommandBridge, public ValueChecker, public

virtual void NextTest() = 0;

void Exit(std::string message) override
void Exit(std::string message, CHIP_ERROR err = CHIP_ERROR_INTERNAL) override
{
ChipLogError(chipTool, " ***** Test Failure: %s\n", message.c_str());
SetCommandExitStatus(CHIP_ERROR_INTERNAL);
SetCommandExitStatus(err);
}

/////////// GlobalCommands Interface /////////
Expand Down
Loading

0 comments on commit 3c71264

Please sign in to comment.