Skip to content

Commit

Permalink
Merge branch 'master' into use_mei_in_more_templates
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Aug 23, 2023
2 parents 29d45f9 + bd8c01f commit 29dc679
Show file tree
Hide file tree
Showing 47 changed files with 1,816 additions and 100 deletions.
2 changes: 2 additions & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,7 @@ OnOff
OnOffClusterTest
OnOffSwitchConfiguration
OnPlatformEvent
onwards
OO
openiotsdk
openjdk
Expand Down Expand Up @@ -1176,6 +1177,7 @@ rtld
RTOS
RTT
RTX
runArgs
RUNAS
RunMain
runtime
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/examples-bouffalolab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target bouffalolab-bl602-iot-matter-v1-light \
--target bouffalolab-bl602-night-light-light \
--target bouffalolab-bl602-iot-matter-v1-light-115200-rpc \
build \
--copy-artifacts-to out/artifacts \
Expand All @@ -64,7 +64,7 @@ jobs:
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
bl602 bl602 lighting-app \
out/artifacts/bouffalolab-bl602-iot-matter-v1-light/chip-bl602-lighting-example.out \
out/artifacts/bouffalolab-bl602-night-light-light/chip-bl602-lighting-example.out \
/tmp/bloat_reports/
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
bl602 bl602+rpc lighting-app \
Expand All @@ -77,7 +77,9 @@ jobs:
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target bouffalolab-xt-zb6-devkit-light \
--target bouffalolab-bl706-night-light-light \
--target bouffalolab-bl706-eth-light \
--target bouffalolab-bl706-wifi-light \
--target bouffalolab-xt-zb6-devkit-light-115200-rpc \
build \
--copy-artifacts-to out/artifacts \
Expand All @@ -86,7 +88,15 @@ jobs:
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
bl702 bl702 lighting-app \
out/artifacts/bouffalolab-xt-zb6-devkit-light/chip-bl702-lighting-example.out \
out/artifacts/bouffalolab-bl706-night-light-light/chip-bl702-lighting-example.out \
/tmp/bloat_reports/
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
bl702 bl706-eth lighting-app \
out/artifacts/bouffalolab-bl706-eth-light/chip-bl702-lighting-example.out \
/tmp/bloat_reports/
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
bl702 bl706-wifi lighting-app \
out/artifacts/bouffalolab-bl706-wifi-light/chip-bl702-lighting-example.out \
/tmp/bloat_reports/
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
bl702 bl702+rpc lighting-app \
Expand Down
62 changes: 62 additions & 0 deletions build/chip/write_build_time_header.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env python
# Copyright (c) 2023 Project CHIP Authors
#
# 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.

import argparse
import os
from datetime import datetime, timezone


def utc_time_in_matter_epoch_s():
""" Returns the time in matter epoch in s. """
# Matter epoch is 0 hours, 0 minutes, 0 seconds on Jan 1, 2000 UTC
utc_matter = datetime.now(tz=timezone.utc) - datetime(2000, 1, 1, 0, 0, 0, 0, timezone.utc)
return int(utc_matter.total_seconds())


class Options:
def __init__(self, output, define_name, define_val):
self.output = output
self.define_name = define_name
self.define_val = define_val


def GetOptions():
parser = argparse.ArgumentParser()
parser.add_argument('--output', help="Output header name (inside gen dir)")
parser.add_argument('--gen-dir',
help="Path to root of generated file directory tree.")
cmdline_options = parser.parse_args()

# The actual output file is inside the gen dir.
output = os.path.join(cmdline_options.gen_dir, cmdline_options.output)

define_name = 'CHIP_DEVICE_CONFIG_FIRMWARE_BUILD_TIME_MATTER_EPOCH_S'
build_time = utc_time_in_matter_epoch_s()

return Options(output=output,
define_name=define_name,
define_val=str(build_time))


def WriteHeader(options):
with open(options.output, "w") as output_file:
output_file.write("// Generated by write_build_time_header.py\n")
output_file.write('#pragma once\n\n')

output_file.write(f'#define {options.define_name} {options.define_val}\n')


options = GetOptions()
WriteHeader(options)
71 changes: 71 additions & 0 deletions docs/guides/esp32/vs_code_development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Visual Studio Code Development

[Visual Studio Code](https://code.visualstudio.com/) is a great and simple IDE
that can be used to build & develop with for Matter.

Matter supports the docker / remote container workflow in Visual Studio Code,
and has a container environment setup automatically. You can read more about
this workflow [here](https://code.visualstudio.com/docs/remote/containers).

Tested on:

- Windows 11 Pro + WSL 2 + Ubuntu 22.04 LTS
- Ubuntu 22.04 LTS

## Setup Steps

Follow
[these](https://github.com/project-chip/connectedhomeip/edit/master/docs/VSCODE_DEVELOPMENT.md)
steps to set up Visual Studio Code for Matter development.

### Linux <a name="linux">

For Espressif esp32 devices:

1. Connect your device to the system before running the container.

1. Add `"--device=/dev/ttyUSB0",` inside runArgs in
[devcontainer.json](../../../.devcontainer/devcontainer.json). Confirm the
port of the device and change the parameter accordingly.

1. On opening connectedhomeip in Visual Studio code, At the bottom right of your
window you should have a new box prompting you to re-open the window as a
container. Hit yes.

1. The container will be built.

1. Install esp-idf : `cd /opt/espressif/esp-idf && ./install.sh`

1. Source esp-idf : `source /opt/espressif/esp-idf/export.sh`

1. Activate matter :
`cd /workspaces/connectedhomeip && source scripts/bootstrap.sh && source scripts/activate.sh`

1. Confirm that the device is accessible : `ls -l /dev/ttyUSB*`

1. Go to lighting_example : `cd examples/lighting-app/esp32`

1. Set-target: `idf.py set-target esp32c3`

1. Build the project: `idf.py build`

1. Flash: `idf.py -p /dev/ttyUSB0 flash`

1. Monitor: `idf.py -p /dev/ttyUSB0 monitor`

### Windows

1. Connect to WSL Distro from VS Code.

1. Git clone inside WSL from Matter repository here:
<https://github.com/project-chip/connectedhomeip>

1. Follow [these](https://github.com/dorssel/usbipd-win) steps on Windows and
[these](https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/WSL.md#usbipd)
steps in WSL to have serial port access inside WSL.

1. Confirm that the device is accessible inside WSL : `ls -l /dev/ttyUSB*`.

1. Open connectedhomeip within WSL on Visual Studio Code.

1. Perform step 2 onwards from [Linux](#linux) guide.
Original file line number Diff line number Diff line change
Expand Up @@ -2603,6 +2603,32 @@ server cluster RefrigeratorAndTemperatureControlledCabinetMode = 82 {
command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0;
}

/** This cluster supports remotely monitoring and controling the different typs of functionality available to a washing device, such as a washing machine. */
server cluster LaundryWasherControls = 83 {
enum NumberOfRinsesEnum : ENUM8 {
kNone = 0;
kNormal = 1;
kExtra = 2;
kMax = 3;
}

bitmap Feature : BITMAP32 {
kSpin = 0x1;
kRinse = 0x2;
}

readonly attribute CHAR_STRING spinSpeeds[] = 0;
attribute nullable int8u spinSpeedCurrent = 1;
attribute NumberOfRinsesEnum numberOfRinses = 2;
readonly attribute NumberOfRinsesEnum supportedRinses[] = 3;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
}

/** Attributes and commands for selecting a mode from a list of supported options. */
server cluster RvcRunMode = 84 {
enum ModeTag : ENUM16 {
Expand Down Expand Up @@ -6713,6 +6739,19 @@ endpoint 1 {
ram attribute clusterRevision default = 1;
}

server cluster LaundryWasherControls {
callback attribute spinSpeeds;
ram attribute spinSpeedCurrent;
ram attribute numberOfRinses;
callback attribute supportedRinses;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 3;
ram attribute clusterRevision default = 1;
}

server cluster RvcRunMode {
callback attribute supportedModes;
callback attribute currentMode;
Expand Down
Loading

0 comments on commit 29dc679

Please sign in to comment.