Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: project-chip/connectedhomeip
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 545913386842a90266318d704988fd5ac6a51573
Choose a base ref
..
head repository: project-chip/connectedhomeip
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 09668343f75cbfc7b128aab546639953e2ad5dab
Choose a head ref
Showing with 90 additions and 28 deletions.
  1. +22 −13 BUILD.gn
  2. +3 −3 config/linux/toolchain/BUILD.gn
  3. +21 −3 examples/shell/cmd_device.cpp
  4. +8 −8 gn_build.sh
  5. +36 −0 src/platform/BUILD.gn
  6. +0 −1 src/platform/tests/TestPlatformTime.cpp
35 changes: 22 additions & 13 deletions BUILD.gn
Original file line number Diff line number Diff line change
@@ -104,18 +104,18 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
# Enable building chip with gcc.
enable_host_gcc_build = enable_default_builds

# Build building chip with gcc & mbedtls.
enable_host_gcc_mbdtls_build = enable_default_builds
# Enable building chip with gcc & mbedtls.
enable_host_gcc_mbedtls_build = enable_default_builds

# Enable building chip for linux embedded.
enable_linux_embedded_build = enable_default_builds && host_os == "linux"

# Build the chip-tool example.
enable_standalone_chip_tool_build = enable_default_builds

# Build the shell example.
enable_standalone_shell_build = enable_default_builds

# Build linux embedded.
enable_linux_embedded_build = enable_default_builds

# Build the nRF5 lock app example.
enable_nrf5_lock_app_build = enable_nrf5_builds

@@ -135,7 +135,12 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
toolchain = "${chip_root}/config/mbedtls/toolchain:${host_os}_${host_cpu}_gcc_mbedtls"
}

linux_embedded_toolchain = "${chip_root}/config/linux/toolchain:linux_embedded"
if (host_os == "linux") {
chip_build("linux_embedded") {
toolchain =
"${chip_root}/config/linux/toolchain:linux_${host_cpu}_gcc_embedded"
}
}

standalone_toolchain = "${chip_root}/config/standalone/toolchain:standalone"

@@ -147,8 +152,8 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
deps = [ "${chip_root}/examples/shell(${standalone_toolchain})" ]
}

group("linux_embedded") {
deps = [ "${chip_root}/examples/shell(${linux_embedded_toolchain})" ]
group("shell_linux_embedded") {
deps = [ "${chip_root}/examples/shell(${chip_root}/config/linux/toolchain:linux_${host_cpu}_gcc_embedded)" ]
}

if (enable_nrf5_lock_app_build) {
@@ -171,18 +176,19 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
if (enable_host_gcc_build) {
deps += [ ":all_host_gcc" ]
}
if (enable_host_gcc_mbdtls_build) {
if (enable_host_gcc_mbedtls_build) {
deps += [ ":all_host_gcc_mbedtls" ]
}
if (enable_linux_embedded_build) {
deps += [ ":all_linux_embedded" ]
deps += [ ":shell_linux_embedded" ]
}
if (enable_standalone_chip_tool_build) {
deps += [ ":standalone_chip_tool" ]
}
if (enable_standalone_shell_build) {
deps += [ ":standalone_shell" ]
}
if (enable_linux_embedded_build) {
deps += [ ":linux_embedded" ]
}
if (enable_nrf5_lock_app_build) {
deps += [ ":nrf5_lock_app" ]
}
@@ -200,9 +206,12 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
if (enable_host_gcc_build) {
deps += [ ":check_host_gcc" ]
}
if (enable_host_gcc_mbdtls_build) {
if (enable_host_gcc_mbedtls_build) {
deps += [ ":check_host_gcc_mbedtls" ]
}
if (enable_linux_embedded_build) {
deps += [ ":check_linux_embedded" ]
}
}
}
}
6 changes: 3 additions & 3 deletions config/linux/toolchain/BUILD.gn
Original file line number Diff line number Diff line change
@@ -16,11 +16,11 @@ import("//build_overrides/chip.gni")

import("//build/toolchain/gcc_toolchain.gni")

gcc_toolchain("linux_embedded") {
gcc_toolchain("linux_${host_cpu}_gcc_embedded") {
toolchain_args = {
current_os = host_os
current_os = "linux"
current_cpu = host_cpu
is_clang = false
import("${chip_root}/config/linux/args.gni")
import("${chip_root}/src/platform/Linux/args.gni")
}
}
24 changes: 21 additions & 3 deletions examples/shell/cmd_device.cpp
Original file line number Diff line number Diff line change
@@ -78,6 +78,8 @@ int cmd_device_config(int argc, char ** argv)
streamer_t * sout = streamer_get();
uint16_t value16;
uint64_t value64;
char buf[256];
size_t bufSize;

VerifyOrExit(argc == 0, error = CHIP_ERROR_INVALID_ARGUMENT);

@@ -94,23 +96,39 @@ int cmd_device_config(int argc, char ** argv)
streamer_printf(sout, "ServiceId: ");
if (error == CHIP_NO_ERROR)
{
streamer_print_hex(sout, (const uint8_t *) &value64, sizeof(value64));
streamer_print_hex(sout, reinterpret_cast<const uint8_t *>(&value64), sizeof(value64));
}
else
{
streamer_printf(sout, "<None>");
error = CHIP_NO_ERROR;
}
streamer_printf(sout, "\r\n");

error = ConfigurationMgr().GetFabricId(value64);
streamer_printf(sout, "FabricId: ");
if (error == CHIP_NO_ERROR)
{
streamer_print_hex(sout, (const uint8_t *) &value64, sizeof(value64));
streamer_print_hex(sout, reinterpret_cast<const uint8_t *>(&value64), sizeof(value64));
}
else
{
streamer_printf(sout, "<None>");
error = CHIP_NO_ERROR;
}
streamer_printf(sout, "\r\n");

error = ConfigurationMgr().GetPairingCode(buf, sizeof(buf), bufSize);
streamer_printf(sout, "PairingCode: ");
if (error == CHIP_NO_ERROR)
{
streamer_print_hex(sout, reinterpret_cast<const uint8_t *>(buf), bufSize);
streamer_printf(sout, "\n\r");
}
else
{
streamer_printf(sout, "<None>");
error = CHIP_NO_ERROR;
}
streamer_printf(sout, "\r\n");

@@ -152,7 +170,7 @@ int cmd_device_get(int argc, char ** argv)
char buf[bufSize];
size_t serialNumLength;
SuccessOrExit(error = ConfigurationMgr().GetSerialNumber(buf, bufSize, serialNumLength));
streamer_print_hex(sout, (const uint8_t *) buf, serialNumLength);
streamer_print_hex(sout, reinterpret_cast<const uint8_t *>(buf), serialNumLength);
streamer_printf(sout, "\n\r");
}
else
16 changes: 8 additions & 8 deletions gn_build.sh
Original file line number Diff line number Diff line change
@@ -69,6 +69,14 @@ echo 'To build a custom build (for help run "gn args --list out/debug")'
echo gn args "$CHIP_ROOT/out/custom"
echo ninja -C "$CHIP_ROOT/out/custom"

nrf5_sdk_args=""
extra_args=""

if [[ -d "$NRF5_SDK_ROOT/components/libraries" ]]; then
nrf5_sdk_args+="nrf5_sdk_root=\"$NRF5_SDK_ROOT\""
extra_args+=" $nrf5_sdk_args enable_nrf5_builds=true"
fi

echo
if [[ ! -d "$NRF5_SDK_ROOT/components/libraries" ]]; then
echo "Hint: Set \$NRF5_SDK_ROOT to enable building for nRF5"
@@ -80,14 +88,6 @@ echo

_chip_banner "Build: GN configure"

nrf5_sdk_args=""
extra_args=""

if [[ -d "$NRF5_SDK_ROOT/components/libraries" ]]; then
nrf5_sdk_args+="nrf5_sdk_root=\"$NRF5_SDK_ROOT\""
extra_args+=" $nrf5_sdk_args enable_nrf5_builds=true"
fi

gn --root="$CHIP_ROOT" gen --check "$CHIP_ROOT/out/debug" --args='target_os="all"'"$extra_args"
gn --root="$CHIP_ROOT" gen --check "$CHIP_ROOT/out/release" --args='target_os="all" is_debug=false'"$extra_args"

36 changes: 36 additions & 0 deletions src/platform/BUILD.gn
Original file line number Diff line number Diff line change
@@ -61,6 +61,40 @@ if (device_platform != "none") {
output_name = "libDeviceLayer"

sources = [
"../include/platform/CHIPDeviceConfig.h",
"../include/platform/CHIPDeviceError.h",
"../include/platform/CHIPDeviceEvent.h",
"../include/platform/CHIPDeviceLayer.h",
"../include/platform/ConfigurationManager.h",
"../include/platform/ConnectivityManager.h",
"../include/platform/GeneralUtils.h",
"../include/platform/PersistedStorage.h",
"../include/platform/PlatformManager.h",
"../include/platform/SoftwareUpdateManager.h",
"../include/platform/SoftwareUpdateManagerImpl.h",
"../include/platform/ThreadStackManager.h",
"../include/platform/TimeSyncManager.h",
"../include/platform/internal/BLEManager.h",
"../include/platform/internal/CHIPDeviceLayerInternal.h",
"../include/platform/internal/DeviceDescriptionServer.h",
"../include/platform/internal/DeviceNetworkInfo.h",
"../include/platform/internal/EventLogging.h",
"../include/platform/internal/GenericConfigurationManagerImpl.h",
"../include/platform/internal/GenericConnectivityManagerImpl.h",
"../include/platform/internal/GenericConnectivityManagerImpl_BLE.h",
"../include/platform/internal/GenericConnectivityManagerImpl_NoBLE.h",
"../include/platform/internal/GenericConnectivityManagerImpl_NoThread.h",
"../include/platform/internal/GenericConnectivityManagerImpl_NoTunnel.h",
"../include/platform/internal/GenericConnectivityManagerImpl_NoWiFi.h",
"../include/platform/internal/GenericConnectivityManagerImpl_Thread.h",
"../include/platform/internal/GenericNetworkProvisioningServerImpl.h",
"../include/platform/internal/GenericPlatformManagerImpl.h",
"../include/platform/internal/GenericPlatformManagerImpl_FreeRTOS.h",
"../include/platform/internal/GenericPlatformManagerImpl_POSIX.h",
"../include/platform/internal/GenericSoftwareUpdateManagerImpl.h",
"../include/platform/internal/GenericSoftwareUpdateManagerImpl_BDX.h",
"../include/platform/internal/NetworkProvisioningServer.h",
"../include/platform/internal/testing/ConfigUnitTest.h",
"GeneralUtils.cpp",
"Globals.cpp",
"PersistedStorage.cpp",
@@ -146,6 +180,8 @@ if (device_platform != "none") {
]
}
}

allow_circular_includes_from = [ "${chip_root}/src/lib/support" ]
}
} else {
group("platform") {
1 change: 0 additions & 1 deletion src/platform/tests/TestPlatformTime.cpp
Original file line number Diff line number Diff line change
@@ -184,7 +184,6 @@ static void TestDevice_GetClock_MonotonicHiRes(nlTestSuite * inSuite, void * inC
ChipLogProgress(DeviceLayer, "Start=%" PRIu64 " End=%" PRIu64 " Delta=%" PRIu64 " Expected=%" PRIu64, Tstart, Tend, Tdelta,
Tdelay);
NL_TEST_ASSERT(inSuite, Tdelta > (Tdelay - margin));
NL_TEST_ASSERT(inSuite, Tdelta < (Tdelay + margin));
numOfTestsRan++;
}
NL_TEST_ASSERT(inSuite, numOfTestsRan > 0);