Skip to content

Commit

Permalink
Fix paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Damian-Nordic committed Apr 14, 2022
1 parent 75d16aa commit 13f8f7b
Show file tree
Hide file tree
Showing 16 changed files with 65 additions and 66 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/examples-linux-standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,16 @@ jobs:
out/ota_requestor_debug/chip-ota-requestor-app \
/tmp/bloat_reports/
- name: Build example Standalone Door Lock App
- name: Build example Standalone Lock App
timeout-minutes: 10
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target linux-x64-door-lock \
--target linux-x64-lock \
build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
linux debug door-lock-app \
out/linux-x64-door-lock/chip-door-lock-app \
linux debug lock-app \
out/linux-x64-lock/chip-lock-app \
/tmp/bloat_reports/
- name: Uploading Size Reports
uses: actions/upload-artifact@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
"./scripts/build/build_examples.py \
--target linux-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT} \
--target linux-x64-all-clusters-test-group-${BUILD_VARIANT} \
--target linux-x64-door-lock-${BUILD_VARIANT} \
--target linux-x64-lock-${BUILD_VARIANT} \
--target linux-x64-tv-app-${BUILD_VARIANT} \
build \
--copy-artifacts-to objdir-clone \
Expand All @@ -96,7 +96,7 @@ jobs:
run \
--iterations 1 \
--all-clusters-app ./out/linux-x64-all-clusters-test-group-${BUILD_VARIANT}/chip-all-clusters-app \
--door-lock-app ./out/linux-x64-door-lock-${BUILD_VARIANT}/chip-door-lock-app \
--lock-app ./out/linux-x64-lock-${BUILD_VARIANT}/chip-lock-app \
--tv-app ./out/linux-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \
"
- name: Uploading core files
Expand Down Expand Up @@ -193,7 +193,7 @@ jobs:
run \
--iterations 1 \
--all-clusters-app ./out/darwin-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \
--door-lock-app ./out/darwin-x64-door-lock-${BUILD_VARIANT}/chip-door-lock-app \
--lock-app ./out/darwin-x64-lock-${BUILD_VARIANT}/chip-lock-app \
--tv-app ./out/darwin-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \
"
- name: Uploading core files
Expand Down
14 changes: 7 additions & 7 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
enable_linux_thermostat_app_build =
enable_default_builds && (host_os == "linux" || host_os == "mac")

# Build the Linux door lock app example.
enable_linux_door_lock_app_build =
# Build the Linux lock app example.
enable_linux_lock_app_build =
enable_default_builds && (host_os == "linux" || host_os == "mac")

# Build the cc13x2x7_26x2x7 lock app example.
Expand Down Expand Up @@ -413,10 +413,10 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
}
}

if (enable_linux_door_lock_app_build) {
group("linux_door_lock_app") {
if (enable_linux_lock_app_build) {
group("linux_lock_app") {
deps = [
"${chip_root}/examples/door-lock-app/linux(${standalone_toolchain})",
"${chip_root}/examples/lock-app/linux(${standalone_toolchain})",
]
}
}
Expand Down Expand Up @@ -518,8 +518,8 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
if (enable_linux_lighting_app_build) {
deps += [ ":linux_lighting_app" ]
}
if (enable_linux_door_lock_app_build) {
deps += [ ":linux_door_lock_app" ]
if (enable_linux_lock_app_build) {
deps += [ ":linux_lock_app" ]
}
if (enable_efr32_lock_app_build) {
deps += [ ":efr32_lock_app" ]
Expand Down
8 changes: 4 additions & 4 deletions examples/all-clusters-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ source_set("chip-all-clusters-common") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
"${chip_root}/examples/door-lock-app/linux/src/LockEndpoint.cpp",
"${chip_root}/examples/door-lock-app/linux/src/LockManager.cpp",
"${chip_root}/examples/door-lock-app/linux/src/ZCLDoorLockCallbacks.cpp",
"${chip_root}/examples/lock-app/linux/src/LockEndpoint.cpp",
"${chip_root}/examples/lock-app/linux/src/LockManager.cpp",
"${chip_root}/examples/lock-app/linux/src/ZCLDoorLockCallbacks.cpp",
"AppOptions.cpp",
"include/tv-callbacks.cpp",
"include/tv-callbacks.h",
Expand All @@ -41,7 +41,7 @@ source_set("chip-all-clusters-common") {

include_dirs = [
"${chip_root}/examples/all-clusters-app/all-clusters-common/include",
"${chip_root}/examples/door-lock-app/linux/include",
"${chip_root}/examples/lock-app/linux/include",
]

cflags = [ "-Wconversion" ]
Expand Down
8 changes: 4 additions & 4 deletions examples/lock-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")

executable("chip-door-lock-app") {
executable("chip-lock-app") {
sources = [
"main.cpp",
"src/LockEndpoint.cpp",
Expand All @@ -24,13 +24,13 @@ executable("chip-door-lock-app") {
]

deps = [
"${chip_root}/examples/door-lock-app/door-lock-common",
"${chip_root}/examples/lock-app/lock-common",
"${chip_root}/examples/platform/linux:app-main",
"${chip_root}/src/lib",
]

include_dirs = [
"${chip_root}/examples/door-lock-app/door-lock-common/include",
"${chip_root}/examples/lock-app/lock-common/include",
"include",
]

Expand All @@ -40,5 +40,5 @@ executable("chip-door-lock-app") {
}

group("linux") {
deps = [ ":chip-door-lock-app" ]
deps = [ ":chip-lock-app" ]
}
2 changes: 1 addition & 1 deletion examples/lock-app/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from generic_node_image
RUN apt-get install -y libglib2.0
COPY out/debug/chip-door-lock-app /usr/bin/
COPY out/debug/chip-lock-app /usr/bin/
COPY entrypoint.sh /

ENTRYPOINT ["/entrypoint.sh", "server"]
4 changes: 2 additions & 2 deletions examples/lock-app/linux/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Door Lock Application for Linux
# Lock Application for Linux

This application is quite different from regular lock-app. The app showcases the
current implementation of the Door Lock cluster and doesn't rely on the On/Off
Expand All @@ -13,5 +13,5 @@ be controlled from tests (like RPC in lighting-app).
The application could be build in the same manner as `all-clusters-app`:

```
? scripts/examples/gn_build_example.sh examples/door-lock-app/linux out/door-lock-app chip_config_network_layer_ble=false
? scripts/examples/gn_build_example.sh examples/lock-app/linux out/lock-app chip_config_network_layer_ble=false
```
2 changes: 1 addition & 1 deletion examples/lock-app/linux/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ ot-ctl panid 0x1234
ot-ctl ifconfig up
ot-ctl thread start

chip-door-lock-app
chip-lock-app
17 changes: 8 additions & 9 deletions examples/lock-app/linux/src/LockEndpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bool LockEndpoint::Unlock(const Optional<chip::ByteSpan> & pin, DlOperationError

bool LockEndpoint::GetUser(uint16_t userIndex, EmberAfPluginDoorLockUserInfo & user) const
{
ChipLogProgress(Zcl, "Door Lock App: LockEndpoint::GetUser [endpoint=%d,userIndex=%hu]", mEndpointId, userIndex);
ChipLogProgress(Zcl, "Lock App: LockEndpoint::GetUser [endpoint=%d,userIndex=%hu]", mEndpointId, userIndex);

uint16_t adjustedUserIndex = static_cast<uint16_t>(userIndex - 1);
if (adjustedUserIndex > mLockUsers.size())
Expand Down Expand Up @@ -74,7 +74,7 @@ bool LockEndpoint::SetUser(uint16_t userIndex, chip::FabricIndex creator, chip::
DlCredentialRule credentialRule, const DlCredential * credentials, size_t totalCredentials)
{
ChipLogProgress(Zcl,
"Door Lock App: LockEndpoint::SetUser "
"Lock App: LockEndpoint::SetUser "
"[endpoint=%d,userIndex=%" PRIu16 ",creator=%d,modifier=%d,userName=\"%.*s\",uniqueId=%" PRIx32
",userStatus=%u,userType=%u,"
"credentialRule=%u,credentials=%p,totalCredentials=%zu]",
Expand Down Expand Up @@ -132,7 +132,7 @@ bool LockEndpoint::SetUser(uint16_t userIndex, chip::FabricIndex creator, chip::
bool LockEndpoint::GetCredential(uint16_t credentialIndex, DlCredentialType credentialType,
EmberAfPluginDoorLockCredentialInfo & credential) const
{
ChipLogProgress(Zcl, "Door Lock App: LockEndpoint::GetCredential [endpoint=%d,credentialIndex=%" PRIu16 ",credentialType=%u]",
ChipLogProgress(Zcl, "Lock App: LockEndpoint::GetCredential [endpoint=%d,credentialIndex=%" PRIu16 ",credentialType=%u]",
mEndpointId, credentialIndex, to_underlying(credentialType));

if (credentialIndex >= mLockCredentials.size() || (0 == credentialIndex && DlCredentialType::kProgrammingPIN != credentialType))
Expand Down Expand Up @@ -162,7 +162,7 @@ bool LockEndpoint::SetCredential(uint16_t credentialIndex, DlCredentialStatus cr
const chip::ByteSpan & credentialData)
{
ChipLogProgress(Zcl,
"Door Lock App: LockEndpoint::SetCredential "
"Lock App: LockEndpoint::SetCredential "
"[endpoint=%d,credentialIndex=%" PRIu16 ",credentialStatus=%u,credentialType=%u,credentialDataSize=%zu]",
mEndpointId, credentialIndex, to_underlying(credentialStatus), to_underlying(credentialType),
credentialData.size());
Expand Down Expand Up @@ -289,14 +289,14 @@ bool LockEndpoint::setLockState(DlLockState lockState, const Optional<chip::Byte
{
if (mLockState == lockState)
{
ChipLogDetail(Zcl, "Door Lock App: door is already locked, ignoring command to set lock state to \"%s\" [endpointId=%d]",
ChipLogDetail(Zcl, "Lock App: door is already locked, ignoring command to set lock state to \"%s\" [endpointId=%d]",
lockStateToString(lockState), mEndpointId);
return true;
}

if (!pin.HasValue())
{
ChipLogDetail(Zcl, "Door Lock App: PIN code is not specified, setting door lock state to \"%s\" [endpointId=%d]",
ChipLogDetail(Zcl, "Lock App: PIN code is not specified, setting door lock state to \"%s\" [endpointId=%d]",
lockStateToString(lockState), mEndpointId);
mLockState = lockState;
return true;
Expand All @@ -314,8 +314,7 @@ bool LockEndpoint::setLockState(DlLockState lockState, const Optional<chip::Byte
if (credentialData.data_equal(pin.Value()))
{
ChipLogDetail(
Zcl,
"Door Lock App: specified PIN code was found in the database, setting door lock state to \"%s\" [endpointId=%d]",
Zcl, "Lock App: specified PIN code was found in the database, setting door lock state to \"%s\" [endpointId=%d]",
lockStateToString(lockState), mEndpointId);

mLockState = lockState;
Expand All @@ -324,7 +323,7 @@ bool LockEndpoint::setLockState(DlLockState lockState, const Optional<chip::Byte
}

ChipLogDetail(Zcl,
"Door Lock App: specified PIN code was not found in the database, ignoring command to set lock state to \"%s\" "
"Lock App: specified PIN code was not found in the database, ignoring command to set lock state to \"%s\" "
"[endpointId=%d]",
lockStateToString(lockState), mEndpointId);

Expand Down
2 changes: 1 addition & 1 deletion scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def HostTargets():
app_targets.append(target.Extend('chip-tool', app=HostApp.CHIP_TOOL))
app_targets.append(target.Extend('thermostat', app=HostApp.THERMOSTAT))
app_targets.append(target.Extend('minmdns', app=HostApp.MIN_MDNS))
app_targets.append(target.Extend('door-lock', app=HostApp.LOCK))
app_targets.append(target.Extend('lock', app=HostApp.LOCK))
app_targets.append(target.Extend('shell', app=HostApp.SHELL))
app_targets.append(target.Extend(
'ota-provider', app=HostApp.OTA_PROVIDER, enable_ble=False))
Expand Down
6 changes: 3 additions & 3 deletions scripts/build/builders/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def ExamplePath(self):
elif self == HostApp.TV_APP:
return 'tv-app/linux'
elif self == HostApp.LOCK:
return 'door-lock-app/linux'
return 'lock-app/linux'
elif self == HostApp.SHELL:
return 'shell/standalone'
elif self == HostApp.OTA_PROVIDER:
Expand Down Expand Up @@ -87,8 +87,8 @@ def OutputNames(self):
yield 'chip-tv-app'
yield 'chip-tv-app.map'
elif self == HostApp.LOCK:
yield 'chip-door-lock-app'
yield 'chip-door-lock-app.map'
yield 'chip-lock-app'
yield 'chip-lock-app.map'
elif self == HostApp.TESTS:
pass
elif self == HostApp.SHELL:
Expand Down
32 changes: 16 additions & 16 deletions scripts/build/testdata/build_linux_on_x64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ bash -c '
PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/chip-tool '"'"'--args=chip_inet_config_enable_ipv4=false config_use_interactive_mode=false target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-chip-tool-no-interactive-ipv6only'

# Generating linux-arm64-door-lock
# Generating linux-arm64-lock
bash -c '
PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/door-lock-app/linux '"'"'--args=target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-door-lock'
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/linux '"'"'--args=target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-lock'

# Generating linux-arm64-door-lock-ipv6only
# Generating linux-arm64-lock-ipv6only
bash -c '
PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/door-lock-app/linux '"'"'--args=chip_inet_config_enable_ipv4=false target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-door-lock-ipv6only'
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/linux '"'"'--args=chip_inet_config_enable_ipv4=false target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-lock-ipv6only'

# Generating linux-arm64-minmdns
bash -c '
Expand Down Expand Up @@ -105,11 +105,11 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/exa
# Generating linux-x64-chip-tool-no-interactive-ipv6only
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/chip-tool '--args=chip_inet_config_enable_ipv4=false config_use_interactive_mode=false' {out}/linux-x64-chip-tool-no-interactive-ipv6only

# Generating linux-x64-door-lock
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/door-lock-app/linux {out}/linux-x64-door-lock
# Generating linux-x64-lock
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/linux {out}/linux-x64-lock

# Generating linux-x64-door-lock-ipv6only
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/door-lock-app/linux --args=chip_inet_config_enable_ipv4=false {out}/linux-x64-door-lock-ipv6only
# Generating linux-x64-lock-ipv6only
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/linux --args=chip_inet_config_enable_ipv4=false {out}/linux-x64-lock-ipv6only

# Generating linux-x64-minmdns
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/minimal-mdns {out}/linux-x64-minmdns
Expand Down Expand Up @@ -165,11 +165,11 @@ ninja -C {out}/linux-arm64-all-clusters-ipv6only
# Building linux-arm64-chip-tool-no-interactive-ipv6only
ninja -C {out}/linux-arm64-chip-tool-no-interactive-ipv6only

# Building linux-arm64-door-lock
ninja -C {out}/linux-arm64-door-lock
# Building linux-arm64-lock
ninja -C {out}/linux-arm64-lock

# Building linux-arm64-door-lock-ipv6only
ninja -C {out}/linux-arm64-door-lock-ipv6only
# Building linux-arm64-lock-ipv6only
ninja -C {out}/linux-arm64-lock-ipv6only

# Building linux-arm64-minmdns
ninja -C {out}/linux-arm64-minmdns
Expand Down Expand Up @@ -228,11 +228,11 @@ ninja -C {out}/linux-x64-chip-tool-ipv6only
# Building linux-x64-chip-tool-no-interactive-ipv6only
ninja -C {out}/linux-x64-chip-tool-no-interactive-ipv6only

# Building linux-x64-door-lock
ninja -C {out}/linux-x64-door-lock
# Building linux-x64-lock
ninja -C {out}/linux-x64-lock

# Building linux-x64-door-lock-ipv6only
ninja -C {out}/linux-x64-door-lock-ipv6only
# Building linux-x64-lock-ipv6only
ninja -C {out}/linux-x64-lock-ipv6only

# Building linux-x64-minmdns
ninja -C {out}/linux-x64-minmdns
Expand Down
2 changes: 1 addition & 1 deletion scripts/tests/chiptest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def AllTests(chip_tool: str):
if name.startswith('TV_'):
target = TestTarget.TV
elif name.startswith('DL_'):
target = TestTarget.DOOR_LOCK
target = TestTarget.LOCK
else:
target = TestTarget.ALL_CLUSTERS

Expand Down
2 changes: 1 addition & 1 deletion scripts/tests/chiptest/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,6 @@ def PathsWithNetworkNamespaces(paths: ApplicationPaths) -> ApplicationPaths:
return ApplicationPaths(
chip_tool='ip netns exec tool'.split() + paths.chip_tool,
all_clusters_app='ip netns exec app'.split() + paths.all_clusters_app,
door_lock_app='ip netns exec app'.split() + paths.door_lock_app,
lock_app='ip netns exec app'.split() + paths.lock_app,
tv_app='ip netns exec app'.split() + paths.tv_app,
)
8 changes: 4 additions & 4 deletions scripts/tests/chiptest/test_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ def __updateSetUpCode(self):
class TestTarget(Enum):
ALL_CLUSTERS = auto()
TV = auto()
DOOR_LOCK = auto()
LOCK = auto()


@dataclass
class ApplicationPaths:
chip_tool: typing.List[str]
all_clusters_app: typing.List[str]
door_lock_app: typing.List[str]
lock_app: typing.List[str]
tv_app: typing.List[str]


Expand Down Expand Up @@ -212,8 +212,8 @@ def Run(self, runner, apps_register, paths: ApplicationPaths, pics_file: str):
app_cmd = paths.all_clusters_app
elif self.target == TestTarget.TV:
app_cmd = paths.tv_app
elif self.target == TestTarget.DOOR_LOCK:
app_cmd = paths.door_lock_app
elif self.target == TestTarget.LOCK:
app_cmd = paths.lock_app
else:
raise Exception("Unknown test target - "
"don't know which application to run")
Expand Down
Loading

0 comments on commit 13f8f7b

Please sign in to comment.