Skip to content

Commit

Permalink
Merge branch 'master' into add_chef_color_temperature_light
Browse files Browse the repository at this point in the history
  • Loading branch information
erwinpan1 authored Oct 5, 2022
2 parents 0feb917 + bcc99dd commit 092b8c5
Show file tree
Hide file tree
Showing 68 changed files with 2,350 additions and 138 deletions.
25 changes: 0 additions & 25 deletions config/nrfconnect/app/copy-flashbundle-firmware.cmake

This file was deleted.

11 changes: 8 additions & 3 deletions config/nrfconnect/app/flashing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@ add_custom_command(OUTPUT "${FLASHBUNDLE_FLASHER_PLATFORM}"
COMMAND ${CMAKE_COMMAND} ARGS -E copy "${PROJECT_SOURCE_DIR}/third_party/connectedhomeip/scripts/flashing/nrfconnect_firmware_utils.py" "${FLASHBUNDLE_FLASHER_PLATFORM}"
VERBATIM)

if (merged_hex_to_flash)
set(flashbundle_hex_to_copy "${merged_hex_to_flash}")
else()
set(flashbundle_hex_to_copy "zephyr/${KERNEL_HEX_NAME}")
endif()

add_custom_command(OUTPUT "${FLASHBUNDLE_FIRMWARE}"
DEPENDS zephyr/${KERNEL_HEX_NAME}
COMMAND ${CMAKE_COMMAND} ARGS -DFLASHBUNDLE_FIRMWARE=${FLASHBUNDLE_FIRMWARE} -DKERNEL_HEX_NAME=${KERNEL_HEX_NAME} -P "${CHIP_ROOT}/config/nrfconnect/app/copy-flashbundle-firmware.cmake"
VERBATIM)
DEPENDS ${flashbundle_hex_to_copy}
COMMAND ${CMAKE_COMMAND} -E copy "${flashbundle_hex_to_copy}" "${FLASHBUNDLE_FIRMWARE}")

add_custom_command(OUTPUT "${CMAKE_PROJECT_NAME}/${CMAKE_PROJECT_NAME}.flash.py"
COMMAND ${python}
Expand Down
11 changes: 8 additions & 3 deletions config/zephyr/app/flashing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@ add_custom_command(OUTPUT "${FLASHBUNDLE_FLASHER_PLATFORM}"
COMMAND ${CMAKE_COMMAND} ARGS -E copy "${PROJECT_SOURCE_DIR}/third_party/connectedhomeip/scripts/flashing/nrfconnect_firmware_utils.py" "${FLASHBUNDLE_FLASHER_PLATFORM}"
VERBATIM)

if (merged_hex_to_flash)
set(flashbundle_hex_to_copy "${merged_hex_to_flash}")
else()
set(flashbundle_hex_to_copy "zephyr/${KERNEL_HEX_NAME}")
endif()

add_custom_command(OUTPUT "${FLASHBUNDLE_FIRMWARE}"
DEPENDS zephyr/${KERNEL_HEX_NAME}
COMMAND ${CMAKE_COMMAND} ARGS -DFLASHBUNDLE_FIRMWARE=${FLASHBUNDLE_FIRMWARE} -DKERNEL_HEX_NAME=${KERNEL_HEX_NAME} -P "${CHIP_ROOT}/config/nrfconnect/app/copy-flashbundle-firmware.cmake"
VERBATIM)
DEPENDS ${flashbundle_hex_to_copy}
COMMAND ${CMAKE_COMMAND} -E copy "${flashbundle_hex_to_copy}" "${FLASHBUNDLE_FIRMWARE}")

add_custom_command(OUTPUT "${CMAKE_PROJECT_NAME}/${CMAKE_PROJECT_NAME}.flash.py"
COMMAND ${python}
Expand Down
Binary file added docs/images/Matter_Arch_Overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Matter_Layered_Arch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ def main() -> int:
elif config['ameba']['MODEL'] == 'Z2':
shell.run_cmd(
f"cd {config['ameba']['AMEBA_SDK']}/project/realtek_amebaz2_v0_example/GCC-RELEASE")
shell.run_cmd("rm -f project_include.mk")
with open(f"{config['ameba']['AMEBA_SDK']}/project/realtek_amebaz2_v0_example/GCC-RELEASE/project_include.mk", "w") as f:
f.write(textwrap.dedent(f"""\
SAMPLE_NAME = {options.sample_device_type_name}
Expand Down Expand Up @@ -819,8 +820,11 @@ def main() -> int:
shell.run_cmd(
f"{config['ameba']['AMEBA_SDK']}/tools/AmebaD/Image_Tool_Linux/flash.sh {config['ameba']['TTY']} {config['ameba']['AMEBA_SDK']}/project/realtek_amebaD_va0_example/GCC-RELEASE/out", raise_on_returncode=False)
else:
flush_print(
"Ameba Z2 currently does not support flashing image through script, stil WIP")
shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}/ameba")
shell.run_cmd(
f"cd {config['ameba']['AMEBA_SDK']}/tools/AmebaZ2/Image_Tool_Linux")
shell.run_cmd(
f"{config['ameba']['AMEBA_SDK']}/tools/AmebaZ2/Image_Tool_Linux/flash.sh {config['ameba']['TTY']} {config['ameba']['AMEBA_SDK']}/project/realtek_amebaz2_v0_example/GCC-RELEASE/application_is/Debug/bin", raise_on_returncode=False)

#
# Terminal interaction
Expand Down
3 changes: 2 additions & 1 deletion examples/chip-tool/commands/pairing/PairingCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ void PairingCommand::OnDiscoveredDevice(const chip::Dnssd::DiscoveredNodeData &
nodeData.resolutionData.ipAddress[0].ToString(buf);
ChipLogProgress(chipTool, "Discovered Device: %s:%u", buf, port);

// Stop Mdns discovery. Is it the right method ?
// Stop Mdns discovery.
CurrentCommissioner().StopCommissionableDiscovery();
CurrentCommissioner().RegisterDeviceDiscoveryDelegate(nullptr);

Inet::InterfaceId interfaceId =
Expand Down
5 changes: 2 additions & 3 deletions examples/lighting-app/qpg/APPLICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@

A lighting example application showing the use of
[Matter](https://github.com/project-chip/connectedhomeip) on the Qorvo QPG6105
can be found in the
[Qorvo Matter Documentation repository](https://github.com/Qorvo/qpg-connectedhomeip/blob/master/examples/lighting-app/APPLICATION.md).
can be found in this folder.

## Qorvo SDK

More detailed information on the Qorvo SDK can be found in the
[Qorvo Matter Documentation repository](https://github.com/Qorvo/qpg-connectedhomeip/blob/master/qpg6105/doc/README.md).
[Qorvo Matter SDK](https://github.com/Qorvo/QMatter).

## More information

Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/esp32/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CHIP ESP32 Lock Example
# Matter ESP32 Lock Example

This example demonstrates the mapping of OnOff cluster to lock/unlock logic.

Expand Down
5 changes: 2 additions & 3 deletions examples/lock-app/qpg/APPLICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@

A lock example application showing the use of
[Matter](https://github.com/project-chip/connectedhomeip) on the Qorvo QPG6105
can be found in the
[Qorvo Matter Documentation repository](https://github.com/Qorvo/qpg-connectedhomeip/blob/master/examples/lock-app/APPLICATION.md).
can be found in this folder.

## Qorvo SDK

More detailed information on the Qorvo SDK can be found in the
[Qorvo Matter Documentation repository](https://github.com/Qorvo/qpg-connectedhomeip/blob/master/qpg6105/doc/README.md).
[Qorvo Matter SDK](https://github.com/Qorvo/QMatter).

## More information

Expand Down
2 changes: 1 addition & 1 deletion examples/platform/qpg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Qorvo SDK

More detailed information on the Qorvo SDK can be found in the
[Qorvo Matter Documentation repository](https://github.com/Qorvo/qpg-connectedhomeip/blob/master/qpg6105/doc/README.md).
[Qorvo Matter SDK](https://github.com/Qorvo/QMatter).

## More information

Expand Down
2 changes: 1 addition & 1 deletion examples/temperature-measurement-app/esp32/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CHIP ESP32 Temperature Sensor Example
# Matter ESP32 Temperature Sensor Example

This example is meant to represent a minimal-sized application.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*/
package com.chip.casting;

import java.util.ArrayList;

public class TvCastingApp {
private static final String TAG = TvCastingApp.class.getSimpleName();

Expand Down Expand Up @@ -178,7 +180,7 @@ public native boolean targetNavigator_subscribeToCurrentTarget(
SubscriptionEstablishedCallback subscriptionEstablishedHandler);

public native boolean targetNavigator_subscribeToTargetList(
SuccessCallback<TargetNavigatorTypes.TargetInfo> readSuccessHandler,
SuccessCallback<ArrayList<TargetNavigatorTypes.TargetInfo>> readSuccessHandler,
FailureCallback readFailureHandler,
int minInterval,
int maxInterval,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ jobject TargetListSuccessHandlerJNI::ConvertToJObject(
}

jmethodID constructor = env->GetMethodID(responseTypeClass, "<init>", "(Ljava/lang/Integer;java/lang/String;)V");
jobject jTargetInfo = env->NewObject(responseTypeClass, constructor, targetInfo.identifier, targetInfo.name);
chip::UtfString targetInfoName(env, targetInfo.name);
jobject jTargetInfo = env->NewObject(responseTypeClass, constructor, targetInfo.identifier, targetInfoName.jniValue());

chip::JniReferences::GetInstance().AddToList(jArrayList, jTargetInfo);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <lib/core/CHIPError.h>
#include <lib/core/Optional.h>
#include <lib/support/CHIPJNIError.h>
#include <lib/support/CHIPListUtils.h>
#include <lib/support/JniReferences.h>
#include <lib/support/JniTypeWrappers.h>

Expand Down Expand Up @@ -173,7 +174,7 @@ CHIP_ERROR CreateParameter(JNIEnv * env, jobject jParameter,
}

CHIP_ERROR CreateContentSearch(JNIEnv * env, jobject jSearch,
chip::app::Clusters::ContentLauncher::Structs::ContentSearch::Type & search)
chip::app::Clusters::ContentLauncher::Structs::ContentSearch::Type & search, ListFreer & listFreer)
{
jclass jContentSearchClass;
ReturnErrorOnFailure(
Expand All @@ -192,18 +193,21 @@ CHIP_ERROR CreateContentSearch(JNIEnv * env, jobject jSearch,
jmethodID jNextMid = env->GetMethodID(env->GetObjectClass(jIterator), "next", "()Ljava/lang/Object;");
jmethodID jHasNextMid = env->GetMethodID(env->GetObjectClass(jIterator), "hasNext", "()Z");

chip::app::Clusters::ContentLauncher::Structs::Parameter::Type * parameterList =
new chip::app::Clusters::ContentLauncher::Structs::Parameter::Type[parameterListSize];
auto * parameterListHolder = new ListHolder<chip::app::Clusters::ContentLauncher::Structs::Parameter::Type>(parameterListSize);
listFreer.add(parameterListHolder);
int parameterIndex = 0;
while (env->CallBooleanMethod(jIterator, jHasNextMid))
{
jobject jParameter = env->CallObjectMethod(jIterator, jNextMid);
chip::app::Clusters::ContentLauncher::Structs::Parameter::Type parameter;
ReturnErrorOnFailure(CreateParameter(env, jParameter, parameter));
parameterList[parameterIndex++] = parameter;
parameterListHolder->mList[parameterIndex].type = parameter.type;
parameterListHolder->mList[parameterIndex].value = parameter.value;
parameterListHolder->mList[parameterIndex].externalIDList = parameter.externalIDList;
parameterIndex++;
}
search.parameterList = chip::app::DataModel::List<chip::app::Clusters::ContentLauncher::Structs::Parameter::Type>(
parameterList, parameterListSize);
parameterListHolder->mList, parameterListSize);

return CHIP_NO_ERROR;
}
Expand All @@ -221,8 +225,9 @@ JNI_METHOD(jboolean, contentLauncher_1launchContent)
const char * nativeData = env->GetStringUTFChars(jData, 0);
chip::Optional<chip::CharSpan> data = MakeOptional(CharSpan::fromCharString(nativeData));

ListFreer listFreer;
chip::app::Clusters::ContentLauncher::Structs::ContentSearch::Type search;
CHIP_ERROR err = CreateContentSearch(env, jSearch, search);
CHIP_ERROR err = CreateContentSearch(env, jSearch, search, listFreer);
VerifyOrExit(CHIP_NO_ERROR == err,
ChipLogError(AppServer,
"contentLauncher_1launchContent::Could not create ContentSearch object %" CHIP_ERROR_FORMAT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

/* Begin PBXBuildFile section */
3C4AE650286A7D4D005B52A4 /* OnboardingPayload.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C4AE64F286A7D4D005B52A4 /* OnboardingPayload.m */; };
3C4E53B028E4F28100F293E8 /* MediaPlaybackTypes.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C4E53AF28E4F28100F293E8 /* MediaPlaybackTypes.mm */; };
3C4E53B228E5184C00F293E8 /* TargetNavigatorTypes.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C4E53B128E5184C00F293E8 /* TargetNavigatorTypes.mm */; };
3C4E53B628E5595A00F293E8 /* ContentLauncherTypes.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C4E53B528E5595A00F293E8 /* ContentLauncherTypes.mm */; };
3CCB87212869085400771BAD /* MatterTvCastingBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CCB87202869085400771BAD /* MatterTvCastingBridge.h */; settings = {ATTRIBUTES = (Public, ); }; };
3CCB8737286A555500771BAD /* libTvCastingCommon.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CCB8735286A555500771BAD /* libTvCastingCommon.a */; };
3CCB8738286A555500771BAD /* libmbedtls.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CCB8736286A555500771BAD /* libmbedtls.a */; settings = {ATTRIBUTES = (Required, ); }; };
Expand All @@ -17,11 +20,18 @@
3CCB8742286A593700771BAD /* DiscoveredNodeDataConverter.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3CCB873C286A593700771BAD /* DiscoveredNodeDataConverter.hpp */; };
3CCB8743286A593700771BAD /* CastingServerBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CCB873D286A593700771BAD /* CastingServerBridge.mm */; };
3CCB8744286A593700771BAD /* DiscoveredNodeDataConverter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CCB873E286A593700771BAD /* DiscoveredNodeDataConverter.mm */; };
3CF8532728E37F1000F07B9F /* MatterError.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CF8532628E37F1000F07B9F /* MatterError.mm */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
3C4AE64E286A7D40005B52A4 /* OnboardingPayload.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OnboardingPayload.h; sourceTree = "<group>"; };
3C4AE64F286A7D4D005B52A4 /* OnboardingPayload.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OnboardingPayload.m; sourceTree = "<group>"; };
3C4E53AF28E4F28100F293E8 /* MediaPlaybackTypes.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MediaPlaybackTypes.mm; sourceTree = "<group>"; };
3C4E53B128E5184C00F293E8 /* TargetNavigatorTypes.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = TargetNavigatorTypes.mm; sourceTree = "<group>"; };
3C4E53B328E5185F00F293E8 /* TargetNavigatorTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TargetNavigatorTypes.h; sourceTree = "<group>"; };
3C4E53B428E5593700F293E8 /* ContentLauncherTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContentLauncherTypes.h; sourceTree = "<group>"; };
3C4E53B528E5595A00F293E8 /* ContentLauncherTypes.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ContentLauncherTypes.mm; sourceTree = "<group>"; };
3CA1CA7728E243750023ED44 /* MediaPlaybackTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaPlaybackTypes.h; sourceTree = "<group>"; };
3CCB871D2869085400771BAD /* MatterTvCastingBridge.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MatterTvCastingBridge.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3CCB87202869085400771BAD /* MatterTvCastingBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MatterTvCastingBridge.h; sourceTree = "<group>"; };
3CCB8735286A555500771BAD /* libTvCastingCommon.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTvCastingCommon.a; path = lib/libTvCastingCommon.a; sourceTree = BUILT_PRODUCTS_DIR; };
Expand All @@ -32,6 +42,8 @@
3CCB873C286A593700771BAD /* DiscoveredNodeDataConverter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = DiscoveredNodeDataConverter.hpp; sourceTree = "<group>"; };
3CCB873D286A593700771BAD /* CastingServerBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CastingServerBridge.mm; sourceTree = "<group>"; };
3CCB873E286A593700771BAD /* DiscoveredNodeDataConverter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DiscoveredNodeDataConverter.mm; sourceTree = "<group>"; };
3CF8532528E37ED800F07B9F /* MatterError.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MatterError.h; sourceTree = "<group>"; };
3CF8532628E37F1000F07B9F /* MatterError.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MatterError.mm; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -77,6 +89,14 @@
3CCB873C286A593700771BAD /* DiscoveredNodeDataConverter.hpp */,
3C4AE64E286A7D40005B52A4 /* OnboardingPayload.h */,
3C4AE64F286A7D4D005B52A4 /* OnboardingPayload.m */,
3CF8532528E37ED800F07B9F /* MatterError.h */,
3CF8532628E37F1000F07B9F /* MatterError.mm */,
3C4E53B428E5593700F293E8 /* ContentLauncherTypes.h */,
3C4E53B528E5595A00F293E8 /* ContentLauncherTypes.mm */,
3CA1CA7728E243750023ED44 /* MediaPlaybackTypes.h */,
3C4E53AF28E4F28100F293E8 /* MediaPlaybackTypes.mm */,
3C4E53B328E5185F00F293E8 /* TargetNavigatorTypes.h */,
3C4E53B128E5184C00F293E8 /* TargetNavigatorTypes.mm */,
);
path = MatterTvCastingBridge;
sourceTree = "<group>";
Expand Down Expand Up @@ -185,7 +205,11 @@
buildActionMask = 2147483647;
files = (
3CCB8743286A593700771BAD /* CastingServerBridge.mm in Sources */,
3C4E53B228E5184C00F293E8 /* TargetNavigatorTypes.mm in Sources */,
3CF8532728E37F1000F07B9F /* MatterError.mm in Sources */,
3C4E53B628E5595A00F293E8 /* ContentLauncherTypes.mm in Sources */,
3CCB8744286A593700771BAD /* DiscoveredNodeDataConverter.mm in Sources */,
3C4E53B028E4F28100F293E8 /* MediaPlaybackTypes.mm in Sources */,
3CCB873F286A593700771BAD /* DiscoveredNodeData.mm in Sources */,
3C4AE650286A7D4D005B52A4 /* OnboardingPayload.m in Sources */,
);
Expand Down
Loading

0 comments on commit 092b8c5

Please sign in to comment.