Skip to content

Commit

Permalink
Merge branch 'master' into camera-webrtc-server
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarcosb authored Nov 7, 2024
2 parents f0f8c9e + 2a26841 commit 1582c7b
Show file tree
Hide file tree
Showing 7 changed files with 263 additions and 113 deletions.
4 changes: 4 additions & 0 deletions config/telink/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ set_property(GLOBAL APPEND PROPERTY ZEPHYR_INTERFACE_LIBS chip)

include(${TELINK_COMMON}/common.cmake)

if (CONFIG_CHIP_APP_LOG_LEVEL GREATER_EQUAL 4)
include(${TELINK_COMMON}/build_info.cmake)
endif()

# ==============================================================================
# Define 'process_binaries' target for collecting final binary to flash
# ==============================================================================
Expand Down
3 changes: 2 additions & 1 deletion examples/lighting-app/tizen/src/DBusInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ gboolean DBusInterface::OnColorTemperatureChanged(LightAppColorControl * colorCo
data.colorTemperatureMireds = light_app_color_control_get_color_temperature_mireds(colorControl);

chip::DeviceLayer::StackLock lock;
ColorControlServer::Instance().moveToColorTempCommand(&handler, path, data);
auto status = ColorControlServer::Instance().moveToColorTempCommand(self->mEndpointId, data);
handler.AddStatus(path, status);

return G_DBUS_METHOD_INVOCATION_HANDLED;
}
Expand Down
148 changes: 148 additions & 0 deletions examples/platform/telink/build_info.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
#
# Copyright (c) 2024 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.

# Matter git info
execute_process(
COMMAND git rev-parse HEAD
OUTPUT_VARIABLE MATTER_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)

execute_process(
COMMAND git diff --quiet
RESULT_VARIABLE MATTER_LOCAL_STATUS
)

if(MATTER_LOCAL_STATUS)
set(MATTER_LOCAL_STATUS "-dirty")
else()
set(MATTER_LOCAL_STATUS "")
endif()

execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE MATTER_BRANCH_NAME
OUTPUT_STRIP_TRAILING_WHITESPACE
)

execute_process(
COMMAND python3 -c "from datetime import datetime; print(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))"
OUTPUT_VARIABLE BUILD_TIMESTAMP
OUTPUT_STRIP_TRAILING_WHITESPACE
)

execute_process(
COMMAND git show -s --format=%cd --date=format:%Y-%m-%d
OUTPUT_VARIABLE MATTER_COMMIT_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE
)

execute_process(
COMMAND git remote get-url origin
OUTPUT_VARIABLE MATTER_REMOTE_URL
OUTPUT_STRIP_TRAILING_WHITESPACE
)

# Zephyr git info
execute_process(
COMMAND git -C ${ZEPHYR_BASE} rev-parse HEAD
OUTPUT_VARIABLE ZEPHYR_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)

execute_process(
COMMAND git -C ${ZEPHYR_BASE} rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE ZEPHYR_BRANCH_NAME
OUTPUT_STRIP_TRAILING_WHITESPACE
)

execute_process(
COMMAND git -C ${ZEPHYR_BASE} show -s --format=%cd --date=format:%Y-%m-%d HEAD
OUTPUT_VARIABLE ZEPHYR_COMMIT_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE
)

execute_process(
COMMAND bash -c "git -C ${ZEPHYR_BASE} remote get-url \$(git -C ${ZEPHYR_BASE} remote | head -n 1)"
OUTPUT_VARIABLE ZEPHYR_REMOTE_URL
OUTPUT_STRIP_TRAILING_WHITESPACE
)

execute_process(
COMMAND git -C ${ZEPHYR_BASE} diff --quiet
RESULT_VARIABLE ZEPHYR_LOCAL_STATUS
)

if(ZEPHYR_LOCAL_STATUS)
set(ZEPHYR_LOCAL_STATUS "-dirty")
else()
set(ZEPHYR_LOCAL_STATUS "")
endif()

# Telink HAL info
execute_process(
COMMAND git -C ${ZEPHYR_BASE}/../modules/hal/telink rev-parse HEAD
OUTPUT_VARIABLE TELINK_HAL_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)

execute_process(
COMMAND git -C ${ZEPHYR_BASE}/../modules/hal/telink diff --quiet
RESULT_VARIABLE HAL_LOCAL_STATUS
)

if(TELINK_HAL_LOCAL_STATUS)
set(TELINK_HAL_LOCAL_STATUS "-dirty")
else()
set(TELINK_HAL_LOCAL_STATUS "")
endif()

execute_process(
COMMAND git -C ${ZEPHYR_BASE}/../modules/hal/telink show -s --format=%cd --date=format:%Y-%m-%d
OUTPUT_VARIABLE TELINK_HAL_COMMIT_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE
)

target_compile_definitions(app PRIVATE
MATTER_COMMIT_HASH="${MATTER_COMMIT_HASH}"
MATTER_BRANCH="${MATTER_BRANCH_NAME}"
BUILD_TIMESTAMP="${BUILD_TIMESTAMP}"
MATTER_COMMIT_DATE="${MATTER_COMMIT_DATE}"
MATTER_REMOTE_URL="${MATTER_REMOTE_URL}"
MATTER_LOCAL_STATUS="${MATTER_LOCAL_STATUS}"

ZEPHYR_COMMIT_HASH="${ZEPHYR_COMMIT_HASH}"
ZEPHYR_BRANCH="${ZEPHYR_BRANCH_NAME}"
ZEPHYR_COMMIT_DATE="${ZEPHYR_COMMIT_DATE}"
ZEPHYR_REMOTE_URL="${ZEPHYR_REMOTE_URL}"
ZEPHYR_LOCAL_STATUS="${ZEPHYR_LOCAL_STATUS}"

TELINK_HAL_COMMIT_HASH="${TELINK_HAL_COMMIT_HASH}"
TELINK_HAL_LOCAL_STATUS="${TELINK_HAL_LOCAL_STATUS}"
TELINK_HAL_COMMIT_DATE="${TELINK_HAL_COMMIT_DATE}"
)

message(STATUS "Matter revision:")
message(STATUS " board: ${CONFIG_BOARD}")
message(STATUS " branch: ${MATTER_BRANCH_NAME} ${MATTER_COMMIT_HASH} ${MATTER_COMMIT_DATE}")
message(STATUS " remote: ${MATTER_REMOTE_URL}")
message(STATUS " build timestamp: ${BUILD_TIMESTAMP}")

message(STATUS "Zephyr revision:")
message(STATUS " branch: ${ZEPHYR_BRANCH_NAME} ${ZEPHYR_COMMIT_HASH} ${ZEPHYR_COMMIT_DATE}")
message(STATUS " remote: ${ZEPHYR_REMOTE_URL}")

message(STATUS "HAL revision:")
message(STATUS " commit: ${TELINK_HAL_COMMIT_HASH} ${TELINK_HAL_COMMIT_DATE}")
1 change: 1 addition & 0 deletions examples/platform/telink/common/include/AppTaskCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class AppTaskCommon

protected:
CHIP_ERROR InitCommonParts(void);
void PrintFirmwareInfo(void);

void DispatchEvent(AppEvent * event);
void GetEvent(AppEvent * aEvent);
Expand Down
19 changes: 18 additions & 1 deletion examples/platform/telink/common/src/AppTaskCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,28 @@ CHIP_ERROR AppTaskCommon::StartApp(void)
DispatchEvent(&event);
}
}
void AppTaskCommon::PrintFirmwareInfo(void)
{
LOG_INF("SW Version: %u, %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION, CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING);

#if CONFIG_CHIP_APP_LOG_LEVEL > 3
LOG_DBG("Matter revision: ");
LOG_DBG("\t board: %s", CONFIG_BOARD);
LOG_DBG("\t branch: %s %.8s%s %s", MATTER_BRANCH, MATTER_COMMIT_HASH, MATTER_LOCAL_STATUS, MATTER_COMMIT_DATE);
LOG_DBG("\t remote: %s", MATTER_REMOTE_URL);
LOG_DBG("\t build timestamp: %s", BUILD_TIMESTAMP);

LOG_DBG("Zephyr revision: ");
LOG_DBG("\t branch: %s %.8s%s %s", ZEPHYR_BRANCH, ZEPHYR_COMMIT_HASH, ZEPHYR_LOCAL_STATUS, ZEPHYR_COMMIT_DATE);
LOG_DBG("\t remote: %s", ZEPHYR_REMOTE_URL);
LOG_DBG("\t HAL commit: %.8s%s %s", TELINK_HAL_COMMIT_HASH, TELINK_HAL_LOCAL_STATUS, TELINK_HAL_COMMIT_DATE);
#endif
}
CHIP_ERROR AppTaskCommon::InitCommonParts(void)
{
CHIP_ERROR err;
LOG_INF("SW Version: %u, %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION, CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING);

PrintFirmwareInfo();

InitLeds();
UpdateStatusLED();
Expand Down
Loading

0 comments on commit 1582c7b

Please sign in to comment.