Skip to content

Commit

Permalink
Merging from master
Browse files Browse the repository at this point in the history
  • Loading branch information
rbultman committed Mar 18, 2024
2 parents 1eb8df7 + d2eab7f commit c35ef14
Show file tree
Hide file tree
Showing 141 changed files with 7,344 additions and 1,799 deletions.
6 changes: 0 additions & 6 deletions .flake8

This file was deleted.

2 changes: 1 addition & 1 deletion .github/actions/bootstrap-cache/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Bootstrap cache
runs:
using: "composite"
steps:
- uses: Wandalen/wretry.action@v1.3.0
- uses: Wandalen/wretry.action@v1.4.10
name: Bootstrap cache
continue-on-error: true
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:
bootstrap-log-name:
description: "Bootstrap log name"
required: false
default: bootstrap-logs
default: bootstrap-logs-${{ github.job }}
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -41,3 +41,10 @@ runs:
uses: ./.github/actions/upload-bootstrap-logs
with:
bootstrap-log-name: ${{ inputs.bootstrap-log-name }}
- name: Work around TSAN ASLR issues
if: runner.os == 'Linux' && !env.ACT
shell: bash
run: |
# See https://stackoverflow.com/a/77856955/2365113
if [[ "$UID" == 0 ]]; then function sudo() { "$@"; }; fi
sudo sysctl vm.mmap_rnd_bits=28
2 changes: 1 addition & 1 deletion .github/actions/checkout-submodules/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:
runs:
using: "composite"
steps:
- uses: Wandalen/wretry.action@v1.3.0
- uses: Wandalen/wretry.action@v1.4.10
name: Checkout submodules
with:
command: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform ${{ inputs.platform }} ${{ inputs.extra-parameters }}
Expand Down
72 changes: 35 additions & 37 deletions .github/actions/maximize-runner-disk/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,45 @@ runs:
using: "composite"
steps:
- name: Free up disk space on the github runner
if: ${{ !env.ACT }}
if: runner.os == 'Linux' && !env.ACT
shell: bash
run: |
# maximize-runner-disk
if [[ "$RUNNER_OS" == Linux ]]; then
# Directories to prune to free up space. Candidates:
# 1.6G /usr/share/dotnet
# 1.1G /usr/local/lib/android/sdk/platforms
# 1000M /usr/local/lib/android/sdk/build-tools
# 8.9G /usr/local/lib/android/sdk
# This list can be amended later to change the trade-off between the amount of
# disk space freed up, and how long it takes to do so (deleting many files is slow).
prune=(/usr/share/dotnet /usr/local/lib/android/sdk/platforms /usr/local/lib/android/sdk/build-tools)
# Directories to prune to free up space. Candidates:
# 1.6G /usr/share/dotnet
# 1.1G /usr/local/lib/android/sdk/platforms
# 1000M /usr/local/lib/android/sdk/build-tools
# 8.9G /usr/local/lib/android/sdk
# This list can be amended later to change the trade-off between the amount of
# disk space freed up, and how long it takes to do so (deleting many files is slow).
prune=(/usr/share/dotnet /usr/local/lib/android/sdk/platforms /usr/local/lib/android/sdk/build-tools)
if [[ "$UID" -eq 0 && -d /__w ]]; then
root=/runner-root-volume
if [[ ! -d "$root" ]]; then
echo "Unable to maximize disk space, job is running inside a container and $root is not mounted"
exit 0
fi
function sudo() { "$@"; } # we're already root (and sudo is probably unavailable)
elif [[ "$UID" -ne 0 && "$RUNNER_ENVIRONMENT" == github-hosted ]]; then
root=
else
echo "Unable to maximize disk space, unknown runner environment"
if [[ "$UID" -eq 0 && -d /__w ]]; then
root=/runner-root-volume
if [[ ! -d "$root" ]]; then
echo "Unable to maximize disk space, job is running inside a container and $root is not mounted"
exit 0
fi
echo "Freeing up runner disk space on ${root:-/}"
function avail() { df -k --output=avail "${root:-/}" | grep '^[0-9]*$'; }
function now() { date '+%s'; }
before="$(avail)" start="$(now)"
for dir in "${prune[@]}"; do
if [[ -d "${root}${dir}" ]]; then
echo "- $dir"
# du -sh -- "${root}${dir}"
sudo rm -rf -- "${root}${dir}"
else
echo "- $dir (not found)"
fi
done
after="$(avail)" end="$(now)"
echo "Done, freed up $(( (after - before) / 1024 ))M of disk space in $(( end - start )) seconds."
function sudo() { "$@"; } # we're already root (and sudo is probably unavailable)
elif [[ "$UID" -ne 0 && "$RUNNER_ENVIRONMENT" == github-hosted ]]; then
root=
else
echo "Unable to maximize disk space, unknown runner environment"
exit 0
fi
echo "Freeing up runner disk space on ${root:-/}"
function avail() { df -k --output=avail "${root:-/}" | grep '^[0-9]*$'; }
function now() { date '+%s'; }
before="$(avail)" start="$(now)"
for dir in "${prune[@]}"; do
if [[ -d "${root}${dir}" ]]; then
echo "- $dir"
# du -sh -- "${root}${dir}"
sudo rm -rf -- "${root}${dir}"
else
echo "- $dir (not found)"
fi
done
after="$(avail)" end="$(now)"
echo "Done, freed up $(( (after - before) / 1024 ))M of disk space in $(( end - start )) seconds."
2 changes: 1 addition & 1 deletion .github/actions/perform-codeql-analysis/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ runs:
with:
sarif_file: "sarif-results/${{ inputs.language }}.sarif"
- name: Upload loc as a Build Artifact
uses: actions/upload-artifact@v2.2.0
uses: actions/upload-artifact@v4
with:
name: sarif-results
path: sarif-results
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/upload-bootstrap-logs/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ inputs:
bootstrap-log-name:
description: "Bootstrap log name"
required: false
default: bootstrap-logs
default: bootstrap-logs-${{ github.job }}
runs:
using: "composite"
steps:
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ always() && !env.ACT }}
with:
name: ${{ inputs.bootstrap-log-name }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/upload-size-reports/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ runs:
using: "composite"
steps:
- name: Uploading Size Reports
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ !env.ACT }}
with:
name: Size,${{ inputs.platform-name }}-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }},${{ github.event_name }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cirque.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Get Cirque Bootstrap cache key
id: cirque-bootstrap-cache-key
run: echo "val=$(scripts/tests/cirque_tests.sh cachekeyhash)" >> $GITHUB_OUTPUT
- uses: Wandalen/wretry.action@v1.4.5
- uses: Wandalen/wretry.action@v1.4.10
name: Cirque Bootstrap cache
if: ${{ !env.ACT }}
continue-on-error: true
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build:35
image: ghcr.io/project-chip/chip-build:39

steps:
- name: Checkout
Expand Down Expand Up @@ -267,12 +267,11 @@ jobs:
run: |
git grep -I -n 'emberAfWriteAttribute' -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)src/app/util/af.h' ':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' ':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' ':(exclude)src/app/util/attribute-table.cpp' ':(exclude)examples/common/pigweed/rpc_services/Attributes.h' ':(exclude)src/app/util/attribute-table.h' ':(exclude)src/app/util/ember-compatibility-functions.cpp' && exit 1 || exit 0
# Run python Linter (flake8) and verify python files
# ignore some style errors, restyler should do that
- name: Check for errors using flake8 Python linter
# Run ruff python linter
- name: Check for errors using ruff Python linter
if: always()
run: |
flake8 --extend-ignore=E501,W391
ruff check
# git grep exits with 0 if it finds a match, but we want
# to fail (exit nonzero) on match. And we want to exclude this file,
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/qemu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jobs:
build \
"
- name: Run all tests
# Disabled being tracked here: https://github.com/project-chip/connectedhomeip/issues/32587
if: false
run: |
src/test_driver/esp32/run_qemu_image.py \
--verbose \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/unit_integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
uses: ./.github/actions/checkout-submodules-and-bootstrap
with:
platform: linux
bootstrap-log-name: bootstrap-logs-unittest-${{ matrix.type }}
- name: Artifact suffix
id: outsuffix
uses: haya14busa/action-cond@v1
Expand Down
2 changes: 2 additions & 0 deletions .restyled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ restylers:
command:
- autopep8
- "--in-place"
- "--max-line-length"
- "132"
arguments: []
include:
- "**/*.py"
Expand Down
5 changes: 3 additions & 2 deletions examples/air-quality-sensor-app/linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,11 @@ $ echo '{"Name":"TemperatureMeasurement","NewValue":1800}' > /tmp/chip_air_quali

### Trigger Humidity change event

Generate event `RelativeHumidityMeasurement`, to change the temperate value.
Generate event `RelativeHumidityMeasurement`, to change the relative humidity
value (6000 for 60,0 %).

```
$ echo '{"Name":"RelativeHumidityMeasurement","NewValue":60}' > /tmp/chip_air_quality_fifo_<PID>
$ echo '{"Name":"RelativeHumidityMeasurement","NewValue":6000}' > /tmp/chip_air_quality_fifo_<PID>
```

### Trigger concentration change event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,6 @@ CHIP_ERROR GenericOperationalStateDelegateImpl::GetOperationalPhaseAtIndex(size_

void GenericOperationalStateDelegateImpl::HandlePauseStateCallback(GenericOperationalError & err)
{
OperationalState::OperationalStateEnum state =
static_cast<OperationalState::OperationalStateEnum>(GetInstance()->GetCurrentOperationalState());

if (state == OperationalState::OperationalStateEnum::kStopped || state == OperationalState::OperationalStateEnum::kError)
{
err.Set(to_underlying(OperationalState::ErrorStateEnum::kCommandInvalidInState));
return;
}

// placeholder implementation
auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused));
if (error == CHIP_NO_ERROR)
Expand All @@ -78,15 +69,6 @@ void GenericOperationalStateDelegateImpl::HandlePauseStateCallback(GenericOperat

void GenericOperationalStateDelegateImpl::HandleResumeStateCallback(GenericOperationalError & err)
{
OperationalState::OperationalStateEnum state =
static_cast<OperationalState::OperationalStateEnum>(GetInstance()->GetCurrentOperationalState());

if (state == OperationalState::OperationalStateEnum::kStopped || state == OperationalState::OperationalStateEnum::kError)
{
err.Set(to_underlying(OperationalState::ErrorStateEnum::kCommandInvalidInState));
return;
}

// placeholder implementation
auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kRunning));
if (error == CHIP_NO_ERROR)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import android.util.Log
import chip.devicecontroller.ChipDeviceController
import chip.devicecontroller.ControllerParams
import chip.devicecontroller.GetConnectedDeviceCallbackJni.GetConnectedDeviceCallback
import chip.devicecontroller.ICDCheckInDelegate
import chip.devicecontroller.ICDClientInfo
import chip.platform.AndroidBleManager
import chip.platform.AndroidChipPlatform
import chip.platform.ChipMdnsCallbackImpl
Expand Down Expand Up @@ -60,6 +62,23 @@ object ChipClient {
chipDeviceController.setAttestationTrustStoreDelegate(
ExampleAttestationTrustStoreDelegate(chipDeviceController)
)

chipDeviceController.setICDCheckInDelegate(
object : ICDCheckInDelegate {
override fun onCheckInComplete(info: ICDClientInfo) {
Log.d(TAG, "onCheckInComplete : $info")
}

override fun onKeyRefreshNeeded(info: ICDClientInfo): ByteArray? {
Log.d(TAG, "onKeyRefreshNeeded : $info")
return null
}

override fun onKeyRefreshDone(errorCode: Long) {
Log.d(TAG, "onKeyRefreshDone : $errorCode")
}
}
)
}

return chipDeviceController
Expand Down
Loading

0 comments on commit c35ef14

Please sign in to comment.