Skip to content

Commit

Permalink
Merge branch 'project-chip:master' into serial_number_args_to_app
Browse files Browse the repository at this point in the history
  • Loading branch information
cjandhyala authored Oct 11, 2024
2 parents 3cd2bf4 + 7287041 commit db6a9dd
Show file tree
Hide file tree
Showing 82 changed files with 15,507 additions and 360 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ jobs:
env:
BUILD_TYPE: default
run: |
# We want to build various standalone example apps similar to what examples-linux-standalone.yaml
# We want to build various standalone example apps (similar to what examples-linux-standalone.yaml
# does), so use target_os="all" to get those picked up as part of the "unified" build. But then
# to save CI resources we want to exclude the "host clang" build, which uses the pigweed clang.
scripts/build/gn_gen.sh --args='target_os="all" is_asan=true enable_host_clang_build=false chip_data_model_check_die_on_failure=true' --export-compile-commands
Expand Down
33 changes: 15 additions & 18 deletions .github/workflows/cancel_workflows_for_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: Cancel workflow on PR
name: Cancel workflows on failing CI
on:
workflow_dispatch:
inputs:
pull_request_id:
description: 'PR number to consider'
required: true
type: number
commit_sha:
description: 'Cancel runs for this specific SHA'
required: true
type: string
schedule:
- cron: "*/10 * * * *"

jobs:
cancel_workflow:
name: Report on pull requests
name: Cancel CI on failing pull requests

runs-on: ubuntu-latest

Expand All @@ -42,14 +35,18 @@ jobs:
python-version: '3.12'
- name: Setup pip modules we use
run: |
pip install \
click \
coloredlogs \
pygithub \
pip install \
click \
coloredlogs \
python-dateutil \
pygithub \
&& echo "DONE installint python prerequisites"
- name: Cancel runs
run: |
scripts/tools/cancel_workflows_for_pr.py \
--pull-request ${{ inputs.pull_request_id }} \
--commit-sha "${{ inputs.commit_sha }}" \
--gh-api-token "${{ secrets.GITHUB_TOKEN }}"
--gh-api-token "${{ secrets.GITHUB_TOKEN }}" \
--require "Restyled" \
--require "Lint Code Base" \
--require "ZAP" \
--require "Run misspell" \
--max-pr-age-minutes 20
8 changes: 8 additions & 0 deletions config/esp32/components/chip/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ dependencies:
- if: "idf_version >=5.0"
- if: "target != esp32h2"

# This matches the dependency of esp_insights
espressif/esp_diag_data_store:
version: "1.0.1"
require: public
rules:
- if: "idf_version >=5.0"
- if: "target != esp32h2"

espressif/esp_rcp_update:
version: "1.2.0"
rules:
Expand Down
82 changes: 0 additions & 82 deletions examples/all-clusters-minimal-app/tizen/BUILD.gn

This file was deleted.

63 changes: 0 additions & 63 deletions examples/all-clusters-minimal-app/tizen/src/main.cpp

This file was deleted.

19 changes: 0 additions & 19 deletions examples/all-clusters-minimal-app/tizen/tizen-manifest.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class Converter():
def __init__(self, specifications):
self.__specs = specifications
self.__converters = [
DarwinAnyFormatConverter(),
StructFieldsNameConverter(),
FloatConverter(),
OctetStringConverter()
Expand Down Expand Up @@ -252,6 +253,43 @@ def maybe_convert(self, typename: str, value):
return value


class DarwinAnyFormatConverter(BaseConverter):
"""
Darwin payloads format for *ById commands is different from the base
format used for other commands.
"""

def run(self, specs, value, cluster_name: str, typename: str, array: bool):
if isinstance(value, list) and len(value) >= 1 and isinstance(value[0], dict) and value[0].get('data') is not None:
value = [self.__convert(item_value) for item_value in value]
return value

def __convert(self, value):
if not isinstance(value, dict):
return value

data = value.get('data')
if not isinstance(data, dict):
return value

value = data.get('value')
if not isinstance(value, list):
return value

value_type = data.get('type')

if value_type == 'Structure':
struct = {}
for field in value:
context_tag = field.get('contextTag')
struct[str(context_tag)] = self.__convert(field)
value = struct
elif value_type == 'Array':
value = [self.__convert(item_value) for item_value in value]

return value


class FloatConverter(BaseConverter):
"""
Jsoncpp stores floats as double.
Expand Down Expand Up @@ -348,7 +386,7 @@ def run(self, specs, value, cluster_name: str, typename: str, array: bool):
del value[key_name]

elif isinstance(value, list) and array:
value = [self.run(specs, v, cluster_name, typename, False)
value = [self.run(specs, v, cluster_name, typename, isinstance(v, list))
for v in value]

return value
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,16 @@ def __get_alias(self, cluster_name: str, command_name: str = None, argument_name
if aliases is None or aliases.get(argument_name) is None:
return None

return aliases.get(argument_name)
value = aliases.get(argument_name)

if cluster_name == '*' and self.__is_darwin_framework_tool:
if argument_name == 'AttributeId':
return 'attribute-id'
elif argument_name == 'ClusterId':
return 'cluster-id'
elif argument_name == 'Value':
return 'attribute-value'
return value

def _supports_endpoint(self, request):
return self._has_support(request, 'has_endpoint')
Expand Down
5 changes: 5 additions & 0 deletions examples/darwin-framework-tool/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ executable("darwin-framework-tool") {
"commands/discover/Commands.h",
"commands/discover/DiscoverCommissionablesCommand.h",
"commands/discover/DiscoverCommissionablesCommand.mm",
"commands/memory/Commands.h",
"commands/memory/DumpMemoryGraphCommand.h",
"commands/memory/DumpMemoryGraphCommand.mm",
"commands/memory/LeaksTool.h",
"commands/memory/LeaksTool.mm",
"commands/pairing/Commands.h",
"commands/pairing/DeviceControllerDelegateBridge.mm",
"commands/pairing/GetCommissionerNodeIdCommand.h",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,13 @@ class ClusterCommand : public ModelCommand {
uint16_t __block responsesNeeded = repeatCount;
dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL);

__auto_type * endpoint = @(endpointId);
__auto_type * cluster = @(clusterId);
__auto_type * command = @(commandId);
while (repeatCount--) {
[device invokeCommandWithEndpointID:[NSNumber numberWithUnsignedShort:endpointId]
clusterID:[NSNumber numberWithUnsignedInteger:clusterId]
commandID:[NSNumber numberWithUnsignedInteger:commandId]
[device invokeCommandWithEndpointID:endpoint
clusterID:cluster
commandID:command
commandFields:commandFields
timedInvokeTimeout:mTimedInteractionTimeoutMs.HasValue()
? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()]
Expand All @@ -88,6 +91,9 @@ class ClusterCommand : public ModelCommand {
if (error != nil) {
mError = error;
LogNSError("Error", error);
RemoteDataModelLogger::LogCommandErrorAsJSON(endpoint, cluster, command, error);
} else {
RemoteDataModelLogger::LogCommandAsJSON(endpoint, cluster, command, values);
}
if (responsesNeeded == 0) {
SetCommandExitStatus(mError);
Expand Down
Loading

0 comments on commit db6a9dd

Please sign in to comment.