From eb53d31c1d1ef43d72ed086c7b69e96b99546bfd Mon Sep 17 00:00:00 2001 From: Matthew Hilton <2693534+matt2005@users.noreply.github.com> Date: Mon, 26 Jul 2021 00:49:15 +0100 Subject: [PATCH 1/4] package using cpack (#18) Added build to .gitignore Added vscode tasks to clean, build, package Added CPack support for debian packages --- .gitignore | 1 + .vscode/tasks.json | 57 ++++++++++++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 32 ++++++++++++++++++++++---- 3 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 .vscode/tasks.json diff --git a/.gitignore b/.gitignore index bac2c3b..9e0cbbf 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ aasdk_proto/*.pb.h Makefile cmake_install.cmake install_manifest.txt +build/** \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..487bff5 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,57 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Clean", + "command": "sudo rm -R build", + "type": "shell", + "args": [], + "problemMatcher": [ + "$tsc" + ], + "presentation": { + "reveal": "always" + }, + "group": "build" + }, + { + "label": "Build", + "command": "mkdir build;cd build;cmake -DCMAKE_BUILD_TYPE=Release ../", + "type": "shell", + "args": [], + "problemMatcher": [ + "$tsc" + ], + "presentation": { + "reveal": "always" + }, + "group": "build" + }, + { + "label": "Create DEB Package", + "command": "cd build;cpack --config CPackConfig.cmake", + "type": "shell", + "args": [], + "problemMatcher": [ + "$tsc" + ], + "presentation": { + "reveal": "always" + }, + "group": "build" + }, + { + "label": "Create DEB SRC Package", + "command": "cd build;cpack --config CPackSourceConfig.cmake", + "type": "shell", + "args": [], + "problemMatcher": [ + "$tsc" + ], + "presentation": { + "reveal": "always" + }, + "group": "build" + } + ] +} \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index f895c0d..8309bc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,14 +3,15 @@ cmake_minimum_required(VERSION 3.5.1) set (AASDK_VERSION_MAJOR 2) set (AASDK_VERSION_MINOR 1) set (AASDK_VERSION_PATCH 0) +project(aasdk +VERSION ${AASDK_VERSION_MAJOR}.${AASDK_VERSION_MINOR}.${AASDK_VERSION_PATCH} +LANGUAGES CXX) find_program(CCACHE_PROGRAM ccache) if(CCACHE_PROGRAM) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") endif() -project(aasdk CXX) - set(base_directory ${CMAKE_CURRENT_SOURCE_DIR}) set(sources_directory ${base_directory}/src) @@ -85,8 +86,8 @@ set(AASDK_VERSION_STRING ${AASDK_VERSION_MAJOR}.${AASDK_VERSION_MINOR}.${AASDK_V set_target_properties(aasdk PROPERTIES VERSION ${AASDK_VERSION_STRING} SOVERSION ${AASDK_VERSION_MAJOR}) -install(TARGETS aasdk DESTINATION lib) -install(DIRECTORY include/aasdk DESTINATION include) +install(TARGETS aasdk DESTINATION lib COMPONENT libraries) +install(DIRECTORY include/aasdk DESTINATION include COMPONENT headers) if(AASDK_TEST) add_executable(aasdk_ut @@ -105,3 +106,26 @@ if(AASDK_TEST) setup_target_for_coverage(NAME aasdk_coverage EXECUTABLE aasdk_ut DEPENDENCIES aasdk_ut) endif(AASDK_CODE_COVERAGE) endif(AASDK_TEST) +SET(CPACK_GENERATOR "DEB") +SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "AASDK") #required +SET(CPACK_PACKAGE_VENDOR "AASDK") +set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) +set(CPACK_DEBIAN_PACKAGE_DEPENDS "libusb-1.0-0,libboost-all-dev,libssl-dev,libprotobuf-dev") +set(CPACK_COMPONENTS_ALL libraries headers Unspecified) +set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries") +set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ Headers") +set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION + "Static libraries used to build programs with AASDK") +set(CPACK_COMPONENT_HEADERS_DESCRIPTION + "C/C++ header files for use with AASDK") +set(CPACK_COMPONENT_LIBRARIES_GROUP "Development") +set(CPACK_COMPONENT_HEADERS_GROUP "Development") +set(CPACK_COMPONENT_GROUP_DEVELOPMENT_EXPANDED ON) +set(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION + "All of the tools you'll ever need to develop software") +set(CPACK_COMPONENT_HEADERS_DEPENDS libraries) +set(CPACK_ALL_INSTALL_TYPES Full Developer) +set(CPACK_INSTALL_TYPE_FULL_DISPLAY_NAME "Everything") +set(CPACK_COMPONENT_LIBRARIES_INSTALL_TYPES Developer Full) +set(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full) +INCLUDE(CPack) From e29f2cd9d1ce28d2675260f8b5cac9a726bd21c8 Mon Sep 17 00:00:00 2001 From: Matthew Hilton <2693534+matt2005@users.noreply.github.com> Date: Fri, 24 Sep 2021 04:16:29 +0100 Subject: [PATCH 2/4] add githubactions packaging (#20) * Added gitversion,cmake and last commit epoch as patch version * Switched patch version to use commit hash instead of epoch * Added CPACK_Version * added message to output version * added dockerbuild temp * workflow fix * fixed tabs * fixed depends * fixed typo * typo in Dockerfile * added upload artifact * added deb_architecture * added releases * fixed checkout * added tags * fixed release gha * Added versioning * switch to use commit_timestamp --- .github/workflows/build_compile.yml | 162 ++++++++++++++++++++++++++++ CMakeLists.txt | 33 ++++-- aasdk_proto/CMakeLists.txt | 6 +- buildenv/Dockerfile | 28 +++++ buildenv/entrypoint.sh | 28 +++++ buildenv/patch-libboost-log-deb.sh | 46 ++++++++ cmake_modules/gitversion.cmake | 51 +++++++++ 7 files changed, 344 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/build_compile.yml create mode 100644 buildenv/Dockerfile create mode 100644 buildenv/entrypoint.sh create mode 100644 buildenv/patch-libboost-log-deb.sh create mode 100644 cmake_modules/gitversion.cmake diff --git a/.github/workflows/build_compile.yml b/.github/workflows/build_compile.yml new file mode 100644 index 0000000..af3b791 --- /dev/null +++ b/.github/workflows/build_compile.yml @@ -0,0 +1,162 @@ +name: Build and test with docker + +on: + push: + tags: + - '*' + +jobs: + version: + outputs: + version: ${{ steps.get_version.outputs.version }} + buildname: ${{ steps.get_version.outputs.buildname }} + runs-on: "ubuntu-latest" + steps: + - + name: Checkout repository + uses: actions/checkout@v1 + - + name: Get the version + id: get_version + run: | + if [ -z "$version" ] + then + version=$(date '+%Y%m%d') + echo ::set-output name=version::"${version}" + else + echo ::set-output name=version::"${version}" + fi + builddate=$(date '+%Y-%m-%d') + buildhash=$(git rev-parse --short "$GITHUB_SHA") + buildname="${builddate}-${buildhash}" + echo ::set-output name=version::${VERSION} + echo ::set-output name=buildhash::${buildhash} + echo ::set-output name=builddate::${builddate} + echo ::set-output name=buildname::${buildname} + env: + version: ${{ github.event.inputs.version }} + compile: + runs-on: ${{ matrix.host }} + needs: [ version ] + strategy: + fail-fast: false + max-parallel: 3 + matrix: + host: [ + "ubuntu-latest", + #"macos-10.15", + ] + config: + - { + name: "armhf Release", + arch: "armhf" + } + - { + name: "amd64 Release", + arch: "amd64" + } + + name: 'Build and Upload release: ${{ matrix.config.name }}' + steps: + - uses: actions/checkout@v2 + - + name: Build the Docker image + run: docker build -t aasdk_builder --file buildenv/Dockerfile . + - + name: 'Build ${{ matrix.config.arch }} Debian package' + run: docker run -v "${PWD}/release":/release aasdk_builder:latest ${{ matrix.config.arch }} + - + name: Get Name of Artifact + id: get-artifact-name + run: | + ls -hla + ARTIFACT_PATHNAME=$(ls ./release/*.deb | head -n 1) + ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME) + echo ::set-output name=artifact_filename::${ARTIFACT_NAME} + echo ::set-output name=artifact_path::${ARTIFACT_PATHNAME} + - + name: Upload build artifacts + id: upload_deploy + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.config.arch }} + path: | + ${{ steps.get-artifact-name.outputs.artifact_path }} +# Create Release + release: + runs-on: ubuntu-latest + needs: [ version, compile ] + if: startsWith(github.ref, 'refs/tags/') + name: 'Create release' + outputs: + release_upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + steps: + - uses: actions/checkout@v2 + - + name: Build Changelog + id: github_release + uses: mikepenz/release-changelog-builder-action@v2.4.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - + name: Create GitHub release + id: create_release + uses: softprops/action-gh-release@v0.1.13 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{needs.version.outputs.version }} + release_name: ${{needs.version.outputs.buildname }} + body: ${{steps.github_release.outputs.changelog}} + draft: true + prerelease: true +# Upload release artifacts + upload: + needs: [ version, compile, release ] + runs-on: ${{ matrix.host }} + strategy: + fail-fast: false + max-parallel: 3 + matrix: + host: [ + "ubuntu-latest", + #"macos-10.15", + ] + config: + - { + name: "armhf Release", + arch: "armhf" + } + - { + name: "amd64 Release", + arch: "amd64" + } + + name: 'Upload release: ${{ matrix.config.name }}' + steps: + - + name: Download build artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ steps.get_version.outputs.version }} + + - + name: Get Artifact Filenames + id: get-artifact-name + run: | + ARTIFACT_PATHNAME=$(ls ${{ matrix.config.arch }}/*.deb | head -n 1) + ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME) + echo ::set-output name=artifact_filename::${ARTIFACT_NAME} + echo ::set-output name=artifact_path::${ARTIFACT_PATHNAME} + - + name: Upload zip to release + id: upload_zip + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_VERSION: ${{ needs.version.outputs.buildname }} + with: + upload_url: ${{needs.release.outputs.release_upload_url}} + asset_path: ${{ steps.get-artifact-name.outputs.artifact_path }} + asset_name: ${{ steps.get-artifact-name.outputs.artifact_filename }} + asset_content_type: application/vnd.debian.binary-package diff --git a/CMakeLists.txt b/CMakeLists.txt index 8309bc0..3420358 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,23 @@ cmake_minimum_required(VERSION 3.5.1) -set (AASDK_VERSION_MAJOR 2) -set (AASDK_VERSION_MINOR 1) -set (AASDK_VERSION_PATCH 0) +if( TARGET_ARCH STREQUAL "amd64" ) + message("Building for amd64") +elseif( TARGET_ARCH STREQUAL "armhf" ) + message("Building for armhf") + set(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabihf-gcc-8) + set(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabihf-g++-8) + set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf") +else() + message("Unknown target architecture. Exiting") + return() +endif() + +set (aasdk_VERSION_MAJOR 3) +set (aasdk_VERSION_MINOR 1) +set (aasdk_VERSION_PATCH 0) + project(aasdk -VERSION ${AASDK_VERSION_MAJOR}.${AASDK_VERSION_MINOR}.${AASDK_VERSION_PATCH} +VERSION ${aasdk_VERSION_MAJOR}.${aasdk_VERSION_MINOR}.${aasdk_VERSION_PATCH} LANGUAGES CXX) find_program(CCACHE_PROGRAM ccache) @@ -36,6 +49,10 @@ set(Boost_USE_STATIC_RUNTIME OFF) add_definitions(-DBOOST_ALL_DYN_LINK) +include(${base_directory}/cmake_modules/gitversion.cmake) +set (aasdk_VERSION_PATCH ${_commit_timestamp}) +set (CMAKE_PROJECT_VERSION_PATCH ${aasdk_VERSION_PATCH}) + if(WIN32) set(WINSOCK2_LIBRARIES "ws2_32") endif(WIN32) @@ -82,9 +99,10 @@ target_link_libraries(aasdk ${OPENSSL_LIBRARIES} ${WINSOCK2_LIBRARIES}) -set(AASDK_VERSION_STRING ${AASDK_VERSION_MAJOR}.${AASDK_VERSION_MINOR}.${AASDK_VERSION_PATCH}) -set_target_properties(aasdk PROPERTIES VERSION ${AASDK_VERSION_STRING} - SOVERSION ${AASDK_VERSION_MAJOR}) +set(aasdk_VERSION_STRING ${aasdk_VERSION_MAJOR}.${aasdk_VERSION_MINOR}.${aasdk_VERSION_PATCH}) +message(INFO " Project Version: ${aasdk_VERSION_STRING}") +set_target_properties(aasdk PROPERTIES VERSION ${aasdk_VERSION_STRING} + SOVERSION ${aasdk_VERSION_MAJOR}) install(TARGETS aasdk DESTINATION lib COMPONENT libraries) install(DIRECTORY include/aasdk DESTINATION include COMPONENT headers) @@ -109,6 +127,7 @@ endif(AASDK_TEST) SET(CPACK_GENERATOR "DEB") SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "AASDK") #required SET(CPACK_PACKAGE_VENDOR "AASDK") +set(CPACK_PACKAGE_VERSION ${aasdk_VERSION_STRING}) set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) set(CPACK_DEBIAN_PACKAGE_DEPENDS "libusb-1.0-0,libboost-all-dev,libssl-dev,libprotobuf-dev") set(CPACK_COMPONENTS_ALL libraries headers Unspecified) diff --git a/aasdk_proto/CMakeLists.txt b/aasdk_proto/CMakeLists.txt index f050119..4c0d40f 100644 --- a/aasdk_proto/CMakeLists.txt +++ b/aasdk_proto/CMakeLists.txt @@ -7,9 +7,9 @@ protobuf_generate_cpp(proto_sources proto_headers ${proto_files}) add_library(aasdk_proto SHARED ${proto_headers} ${proto_sources}) target_link_libraries(aasdk_proto ${PROTOBUF_LIBRARIES}) -set(AASDK_VERSION_STRING ${AASDK_VERSION_MAJOR}.${AASDK_VERSION_MINOR}.${AASDK_VERSION_PATCH}) -set_target_properties(aasdk_proto PROPERTIES VERSION ${AASDK_VERSION_STRING} - SOVERSION ${AASDK_VERSION_MAJOR}) +set(aasdk_VERSION_STRING ${aasdk_VERSION_MAJOR}.${aasdk_VERSION_MINOR}.${aasdk_VERSION_PATCH}) +set_target_properties(aasdk_proto PROPERTIES VERSION ${aasdk_VERSION_STRING} + SOVERSION ${aasdk_VERSION_MAJOR}) install(TARGETS aasdk_proto DESTINATION lib) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DESTINATION include diff --git a/buildenv/Dockerfile b/buildenv/Dockerfile new file mode 100644 index 0000000..f4b958c --- /dev/null +++ b/buildenv/Dockerfile @@ -0,0 +1,28 @@ +FROM debian:buster AS aasdk + +RUN dpkg --add-architecture armhf +RUN apt-get update +RUN apt-get -y install cmake build-essential git +RUN apt-get -y install gcc-arm-linux-gnueabihf cpp-arm-linux-gnueabihf g++-arm-linux-gnueabihf protobuf-compiler +RUN apt-get -y install gcc-8-base:armhf libc6:armhf libgcc1:armhf libicu63:armhf libidn2-0:armhf libstdc++6:armhf libunistring2:armhf + +# These are all the libboost requirements. It would be shorter if libboost-log-dev wasn't a disaster that's being dealt with manually. +RUN apt-get install -y libprotobuf-dev libusb-1.0.0-dev libssl-dev libboost-dev libboost-system-dev libboost-atomic1.67.0 libboost-chrono1.67.0 libboost-date-time1.67.0 libboost-filesystem1.67.0 libboost-regex1.67.0 libboost-thread1.67.0 libboost-filesystem1.67-dev libboost-thread1.67-dev libboost-date-time1.67-dev +RUN apt-get install -y libprotobuf-dev:armhf libusb-1.0.0-dev:armhf libssl-dev:armhf libboost-dev:armhf libboost-system-dev:armhf libboost-atomic1.67.0:armhf libboost-chrono1.67.0:armhf libboost-date-time1.67.0:armhf libboost-filesystem1.67.0:armhf libboost-regex1.67.0:armhf libboost-system1.67.0:armhf libboost-thread1.67.0:armhf libboost-filesystem1.67-dev:armhf libboost-thread1.67-dev:armhf libboost-date-time1.67-dev:armhf + +COPY / /src + +WORKDIR /src + +# Import resources +COPY ./buildenv/patch-libboost-log-deb.sh /src/resources/patch-libboost-log-deb.sh +COPY ./buildenv/entrypoint.sh /entrypoint.sh + +# Patch libboost-log-dev and install +RUN chmod +x ./resources/patch-libboost-log-deb.sh +RUN ./resources/patch-libboost-log-deb.sh + +# Make Executable +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/bin/bash", "/entrypoint.sh"] \ No newline at end of file diff --git a/buildenv/entrypoint.sh b/buildenv/entrypoint.sh new file mode 100644 index 0000000..6394b42 --- /dev/null +++ b/buildenv/entrypoint.sh @@ -0,0 +1,28 @@ +#!/bin/bash +ARCH=$1 +MAJORVER=0 + +if [ -z "$ARCH" ] +then + echo "Please supply a target architecture to build" + echo "Choose from 'amd64', 'armhf'" + exit +else + if [ "$ARCH" != "amd64" ] && [ "$ARCH" != "armhf" ] + then + echo "Invalid architecture requested" + exit + fi +fi + +echo "Now building within docker for $ARCH" + +# Clear out the /build directory +mkdir build; +cd build; +cmake -DCMAKE_BUILD_TYPE=Release -DTARGET_ARCH=$ARCH ../ +make -j4 +cpack --config CPackConfig.cmake + +# Move it to release +mv *.deb /release/ \ No newline at end of file diff --git a/buildenv/patch-libboost-log-deb.sh b/buildenv/patch-libboost-log-deb.sh new file mode 100644 index 0000000..7454a91 --- /dev/null +++ b/buildenv/patch-libboost-log-deb.sh @@ -0,0 +1,46 @@ +# All this because of a packaging bug in libboost-log-dev +# 'Multi-Arch: same' is not present in the control file of Debian packages, all the way up to Sid +# Rather than recompiling the parent libbost suite, download the 6 packages, extract, edit, and repackage. + +# https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=libboost-log-dev + +apt-get -y install --download-only libboost-log-dev:amd64 libboost-log1.67.0:amd64 libboost-log1.67-dev:amd64 +apt-get -y install --download-only libboost-log-dev:armhf libboost-log1.67.0:armhf libboost-log1.67-dev:armhf + +mkdir -p /tmp/armhf/libboost-log-dev/ +dpkg-deb -x /var/cache/apt/archives/libboost-log-dev_1.67.0.1_armhf.deb /tmp/armhf/libboost-log-dev/ +dpkg-deb -e /var/cache/apt/archives/libboost-log-dev_1.67.0.1_armhf.deb /tmp/armhf/libboost-log-dev/DEBIAN/ +sed -i '/^Priority: optional/a Multi-Arch: same' /tmp/armhf/libboost-log-dev/DEBIAN/control +dpkg-deb -b /tmp/armhf/libboost-log-dev/ /tmp/libboost-log-dev_1.67.0.1_armhf.deb + +mkdir -p /tmp/amd64/libboost-log-dev/ +dpkg-deb -x /var/cache/apt/archives/libboost-log-dev_1.67.0.1_amd64.deb /tmp/amd64/libboost-log-dev/ +dpkg-deb -e /var/cache/apt/archives/libboost-log-dev_1.67.0.1_amd64.deb /tmp/amd64/libboost-log-dev/DEBIAN/ +sed -i '/^Priority: optional/a Multi-Arch: same' /tmp/amd64/libboost-log-dev/DEBIAN/control +dpkg-deb -b /tmp/amd64/libboost-log-dev/ /tmp/libboost-log-dev_1.67.0.1_amd64.deb + +mkdir -p /tmp/armhf/libboost-log1.67-dev/ +dpkg-deb -x /var/cache/apt/archives/libboost-log1.67-dev_1.67.0-13+deb10u1_armhf.deb /tmp/armhf/libboost-log1.67-dev/ +dpkg-deb -e /var/cache/apt/archives/libboost-log1.67-dev_1.67.0-13+deb10u1_armhf.deb /tmp/armhf/libboost-log1.67-dev/DEBIAN/ +sed -i '/^Priority: optional/a Multi-Arch: same' /tmp/armhf/libboost-log1.67-dev/DEBIAN/control +dpkg-deb -b /tmp/armhf/libboost-log1.67-dev/ /tmp/libboost-log1.67-dev_1.67.0-13+deb10u1_armhf.deb + +mkdir -p /tmp/amd64/libboost-log1.67-dev/ +dpkg-deb -x /var/cache/apt/archives/libboost-log1.67-dev_1.67.0-13+deb10u1_amd64.deb /tmp/amd64/libboost-log1.67-dev/ +dpkg-deb -e /var/cache/apt/archives/libboost-log1.67-dev_1.67.0-13+deb10u1_amd64.deb /tmp/amd64/libboost-log1.67-dev/DEBIAN/ +sed -i '/^Priority: optional/a Multi-Arch: same' /tmp/amd64/libboost-log1.67-dev/DEBIAN/control +dpkg-deb -b /tmp/amd64/libboost-log1.67-dev/ /tmp/libboost-log1.67-dev_1.67.0-13+deb10u1_amd64.deb + +mkdir -p /tmp/armhf/libboost-log1.67.0/ +dpkg-deb -x /var/cache/apt/archives/libboost-log1.67.0_1.67.0-13+deb10u1_armhf.deb /tmp/armhf/libboost-log1.67.0/ +dpkg-deb -e /var/cache/apt/archives/libboost-log1.67.0_1.67.0-13+deb10u1_armhf.deb /tmp/armhf/libboost-log1.67.0/DEBIAN/ +sed -i '/^Priority: optional/a Multi-Arch: same' /tmp/armhf/libboost-log1.67.0/DEBIAN/control +dpkg-deb -b /tmp/armhf/libboost-log1.67.0/ /tmp/libboost-log1.67.0_1.67.0-13+deb10u1_armhf.deb + +mkdir -p /tmp/amd64/libboost-log1.67.0/ +dpkg-deb -x /var/cache/apt/archives/libboost-log1.67.0_1.67.0-13+deb10u1_amd64.deb /tmp/amd64/libboost-log1.67.0/ +dpkg-deb -e /var/cache/apt/archives/libboost-log1.67.0_1.67.0-13+deb10u1_amd64.deb /tmp/amd64/libboost-log1.67.0/DEBIAN/ +sed -i '/^Priority: optional/a Multi-Arch: same' /tmp/amd64/libboost-log1.67.0/DEBIAN/control +dpkg-deb -b /tmp/amd64/libboost-log1.67.0/ /tmp/libboost-log1.67.0_1.67.0-13+deb10u1_amd64.deb + +dpkg -i /tmp/libboost*.deb \ No newline at end of file diff --git a/cmake_modules/gitversion.cmake b/cmake_modules/gitversion.cmake new file mode 100644 index 0000000..b3267b5 --- /dev/null +++ b/cmake_modules/gitversion.cmake @@ -0,0 +1,51 @@ +# cmake/gitversion.cmake +cmake_minimum_required(VERSION 3.0.0) + +message(STATUS "Resolving GIT Version") + +set(_build_version "unknown") +set(_commit_timestamp "unknown") + +find_package(Git) +if(GIT_FOUND) + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD + WORKING_DIRECTORY "${local_dir}" + OUTPUT_VARIABLE _build_version + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD + WORKING_DIRECTORY "${local_dir}" + OUTPUT_VARIABLE _build_branch + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + execute_process( + COMMAND ${GIT_EXECUTABLE} log -1 --format=%at + WORKING_DIRECTORY "${local_dir}" + OUTPUT_VARIABLE _commit_timestamp + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + message( STATUS "GIT hash: ${_build_version}; branch: ${_build_branch}; Commit epoch: ${_commit_timestamp};") + execute_process( + COMMAND ${GIT_EXECUTABLE} diff --no-ext-diff --quiet + WORKING_DIRECTORY "${local_dir}" + RESULT_VARIABLE ret + ) + if(ret EQUAL "1") + set(_build_changes "*") + else() + set(_build_changes "") + endif() + +else() + message(STATUS "GIT not found") +endif() + +# branch name +# git rev-parse --abbrev-ref HEAD +# changed +# git diff --no-ext-diff --quiet From d327d9059c8cf89113695d3ad1aaf50e7d56745b Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 5 Oct 2021 21:20:41 +0100 Subject: [PATCH 3/4] fix #21 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3420358..86de9bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,14 +2,14 @@ cmake_minimum_required(VERSION 3.5.1) if( TARGET_ARCH STREQUAL "amd64" ) message("Building for amd64") + set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") elseif( TARGET_ARCH STREQUAL "armhf" ) message("Building for armhf") set(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabihf-gcc-8) set(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabihf-g++-8) set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf") else() - message("Unknown target architecture. Exiting") - return() + message("Target Architecture not specified, not cross compiling") endif() set (aasdk_VERSION_MAJOR 3) From 1bc0fe69d5f5f505c978a0c6e32c860e820fa8f6 Mon Sep 17 00:00:00 2001 From: Cole Brinsfield Date: Sun, 26 Dec 2021 11:48:56 -0800 Subject: [PATCH 4/4] add media and navigation status (#22) * Implemented media status service, working on navigation service * Navigation Status Service support --- aasdk_proto/ChannelDescriptorData.proto | 2 +- aasdk_proto/DistanceUnitEnum.proto | 36 ++++ aasdk_proto/ManeuverDirectionEnum.proto | 32 ++++ aasdk_proto/ManeuverTypeEnum.proto | 46 +++++ ...lData.proto => MediaInfoChannelData.proto} | 0 .../MediaInfoChannelMessageIdsEnum.proto | 31 ++++ .../MediaInfoChannelMetadataData.proto | 31 ++++ .../MediaInfoChannelPlaybackData.proto | 39 +++++ aasdk_proto/NavigationChannelData.proto | 3 +- .../NavigationChannelMessageIdsEnum.proto | 32 ++++ .../NavigationDistanceEventMessage.proto | 32 ++++ aasdk_proto/NavigationImageOptionsData.proto | 1 + aasdk_proto/NavigationStatusMessage.proto | 33 ++++ aasdk_proto/NavigationTurnEventMessage.proto | 34 ++++ aasdk_proto/NavigationTurnTypeEnum.proto | 31 ++++ aasdk_proto/VideoResolutionEnum.proto | 4 + .../Channel/AV/IMediaStatusServiceChannel.hpp | 50 ++++++ ...IMediaStatusServiceChannelEventHandler.hpp | 50 ++++++ .../Channel/AV/MediaStatusServiceChannel.hpp | 52 ++++++ .../INavigationStatusServiceChannel.hpp | 50 ++++++ ...gationStatusServiceChannelEventHandler.hpp | 52 ++++++ .../NavigationStatusServiceChannel.hpp | 52 ++++++ include/aasdk/Messenger/ChannelId.hpp | 2 + src/Channel/AV/MediaStatusServiceChannel.cpp | 146 ++++++++++++++++ .../NavigationStatusServiceChannel.cpp | 162 ++++++++++++++++++ src/Common/Data.cpp | 19 +- src/Messenger/ChannelId.cpp | 2 + 27 files changed, 1021 insertions(+), 3 deletions(-) create mode 100644 aasdk_proto/DistanceUnitEnum.proto create mode 100644 aasdk_proto/ManeuverDirectionEnum.proto create mode 100644 aasdk_proto/ManeuverTypeEnum.proto rename aasdk_proto/{MediaChannelData.proto => MediaInfoChannelData.proto} (100%) create mode 100644 aasdk_proto/MediaInfoChannelMessageIdsEnum.proto create mode 100644 aasdk_proto/MediaInfoChannelMetadataData.proto create mode 100644 aasdk_proto/MediaInfoChannelPlaybackData.proto create mode 100644 aasdk_proto/NavigationChannelMessageIdsEnum.proto create mode 100644 aasdk_proto/NavigationDistanceEventMessage.proto create mode 100644 aasdk_proto/NavigationStatusMessage.proto create mode 100644 aasdk_proto/NavigationTurnEventMessage.proto create mode 100644 aasdk_proto/NavigationTurnTypeEnum.proto create mode 100644 include/aasdk/Channel/AV/IMediaStatusServiceChannel.hpp create mode 100644 include/aasdk/Channel/AV/IMediaStatusServiceChannelEventHandler.hpp create mode 100644 include/aasdk/Channel/AV/MediaStatusServiceChannel.hpp create mode 100644 include/aasdk/Channel/Navigation/INavigationStatusServiceChannel.hpp create mode 100644 include/aasdk/Channel/Navigation/INavigationStatusServiceChannelEventHandler.hpp create mode 100644 include/aasdk/Channel/Navigation/NavigationStatusServiceChannel.hpp create mode 100644 src/Channel/AV/MediaStatusServiceChannel.cpp create mode 100644 src/Channel/Navigation/NavigationStatusServiceChannel.cpp diff --git a/aasdk_proto/ChannelDescriptorData.proto b/aasdk_proto/ChannelDescriptorData.proto index 8270927..786f408 100644 --- a/aasdk_proto/ChannelDescriptorData.proto +++ b/aasdk_proto/ChannelDescriptorData.proto @@ -27,7 +27,7 @@ import "AVInputChannelData.proto"; import "BluetoothChannelData.proto"; import "NavigationChannelData.proto"; import "VendorExtensionChannelData.proto"; -import "MediaChannelData.proto"; +import "MediaInfoChannelData.proto"; import "WifiChannelData.proto"; package aasdk.proto.data; diff --git a/aasdk_proto/DistanceUnitEnum.proto b/aasdk_proto/DistanceUnitEnum.proto new file mode 100644 index 0000000..acfbf84 --- /dev/null +++ b/aasdk_proto/DistanceUnitEnum.proto @@ -0,0 +1,36 @@ +/* +* This file is part of aasdk library project. +* Copyright (C) 2018 f1x.studio (Michal Szwaj) +* +* aasdk is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. + +* aasdk is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with aasdk. If not, see . +*/ + +syntax="proto2"; + +package aasdk.proto.enums; + +message DistanceUnit +{ + enum Enum + { + UNKNOWN = 0; + METERS = 1; + KILOMETERS = 2; + KILOMETERS_PARTIAL = 3; + MILES = 4; + MILES_PARTIAL = 5; + FEET = 6; + YARDS = 7; + } +} diff --git a/aasdk_proto/ManeuverDirectionEnum.proto b/aasdk_proto/ManeuverDirectionEnum.proto new file mode 100644 index 0000000..a1ee0b0 --- /dev/null +++ b/aasdk_proto/ManeuverDirectionEnum.proto @@ -0,0 +1,32 @@ +/* +* This file is part of aasdk library project. +* Copyright (C) 2018 f1x.studio (Michal Szwaj) +* +* aasdk is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. + +* aasdk is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with aasdk. If not, see . +*/ + +syntax="proto2"; + +package aasdk.proto.enums; + +message ManeuverDirection +{ + enum Enum + { + UNKNOWN = 0; + LEFT = 1; + RIGHT = 2; + UNSPECIFIED = 3; + } +} diff --git a/aasdk_proto/ManeuverTypeEnum.proto b/aasdk_proto/ManeuverTypeEnum.proto new file mode 100644 index 0000000..bf37d94 --- /dev/null +++ b/aasdk_proto/ManeuverTypeEnum.proto @@ -0,0 +1,46 @@ +/* +* This file is part of aasdk library project. +* Copyright (C) 2018 f1x.studio (Michal Szwaj) +* +* aasdk is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. + +* aasdk is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with aasdk. If not, see . +*/ + +syntax="proto2"; + +package aasdk.proto.enums; + +message ManeuverType +{ + enum Enum + { + UNKNOWN = 0; + DEPART = 1; + NAME_CHANGE = 2; + SLIGHT_TURN = 3; + TURN = 4; + SHARP_TURN = 5; + U_TURN = 6; + ON_RAMP = 7; + OFF_RAMP = 8; + FORK = 9; + MERGE = 10; + ROUNDABOUT_ENTER = 11; + ROUNDABOUT_EXIT = 12; + ROUNDABOUT_ENTER_AND_EXIT = 13; + STRAIGHT = 14; + FERRY_BOAT = 16; + FERRY_TRAIN = 17; + DESTINATION = 19; + } +} diff --git a/aasdk_proto/MediaChannelData.proto b/aasdk_proto/MediaInfoChannelData.proto similarity index 100% rename from aasdk_proto/MediaChannelData.proto rename to aasdk_proto/MediaInfoChannelData.proto diff --git a/aasdk_proto/MediaInfoChannelMessageIdsEnum.proto b/aasdk_proto/MediaInfoChannelMessageIdsEnum.proto new file mode 100644 index 0000000..90d0bbe --- /dev/null +++ b/aasdk_proto/MediaInfoChannelMessageIdsEnum.proto @@ -0,0 +1,31 @@ +/* +* This file is part of aasdk library project. +* Copyright (C) 2018 f1x.studio (Michal Szwaj) +* +* aasdk is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. + +* aasdk is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with aasdk. If not, see . +*/ + +syntax="proto2"; + +package aasdk.proto.ids; + +message MediaInfoChannelMessage +{ + enum Enum + { + NONE = 0x0000; + PLAYBACK = 0x8001; + METADATA = 0x8003; + } +} diff --git a/aasdk_proto/MediaInfoChannelMetadataData.proto b/aasdk_proto/MediaInfoChannelMetadataData.proto new file mode 100644 index 0000000..b3e68dd --- /dev/null +++ b/aasdk_proto/MediaInfoChannelMetadataData.proto @@ -0,0 +1,31 @@ +/* +* This file is part of aasdk library project. +* Copyright (C) 2018 f1x.studio (Michal Szwaj) +* +* aasdk is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. + +* aasdk is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with aasdk. If not, see . +*/ + +syntax="proto2"; + +package aasdk.proto.messages; + +message MediaInfoChannelMetadataData +{ + required string track_name = 1; + optional string artist_name = 2; + optional string album_name = 3; + optional bytes album_art = 4; + required int32 track_length = 6; + required int32 unknown1 = 7; +} diff --git a/aasdk_proto/MediaInfoChannelPlaybackData.proto b/aasdk_proto/MediaInfoChannelPlaybackData.proto new file mode 100644 index 0000000..e6f2d00 --- /dev/null +++ b/aasdk_proto/MediaInfoChannelPlaybackData.proto @@ -0,0 +1,39 @@ +/* +* This file is part of aasdk library project. +* Copyright (C) 2018 f1x.studio (Michal Szwaj) +* +* aasdk is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. + +* aasdk is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with aasdk. If not, see . +*/ + +syntax="proto2"; + +package aasdk.proto.messages; + +message MediaInfoChannelPlaybackData +{ + enum PlaybackState + { + NONE = 0x0000; + TRACK_CHANGE = 1; + PLAY = 2; + PAUSE = 3; + } + required PlaybackState playback_state = 1; + required string media_source = 2; + required int32 track_progress = 3; + required int32 unknown1 = 4; + required int32 unknown2 = 5; + required int32 unknown3 = 6; + +} diff --git a/aasdk_proto/NavigationChannelData.proto b/aasdk_proto/NavigationChannelData.proto index 8aa7b72..5c18a04 100644 --- a/aasdk_proto/NavigationChannelData.proto +++ b/aasdk_proto/NavigationChannelData.proto @@ -18,6 +18,7 @@ syntax="proto2"; +import "NavigationTurnTypeEnum.proto"; import "NavigationImageOptionsData.proto"; package aasdk.proto.data; @@ -25,6 +26,6 @@ package aasdk.proto.data; message NavigationChannel { required uint32 minimum_interval_ms = 1; - required uint32 type = 2; + required enums.NavigationTurnType.Enum type = 2; required NavigationImageOptions image_options = 3; } diff --git a/aasdk_proto/NavigationChannelMessageIdsEnum.proto b/aasdk_proto/NavigationChannelMessageIdsEnum.proto new file mode 100644 index 0000000..ba44dd6 --- /dev/null +++ b/aasdk_proto/NavigationChannelMessageIdsEnum.proto @@ -0,0 +1,32 @@ +/* +* This file is part of aasdk library project. +* Copyright (C) 2018 f1x.studio (Michal Szwaj) +* +* aasdk is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. + +* aasdk is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with aasdk. If not, see . +*/ + +syntax="proto2"; + +package aasdk.proto.ids; + +message NavigationChannelMessage +{ + enum Enum + { + NONE = 0x0000; + STATUS = 0x8003; + TURN_EVENT = 0x8004; + DISTANCE_EVENT = 0x8005; + } +} diff --git a/aasdk_proto/NavigationDistanceEventMessage.proto b/aasdk_proto/NavigationDistanceEventMessage.proto new file mode 100644 index 0000000..74920b9 --- /dev/null +++ b/aasdk_proto/NavigationDistanceEventMessage.proto @@ -0,0 +1,32 @@ +/* +* This file is part of aasdk library project. +* Copyright (C) 2018 f1x.studio (Michal Szwaj) +* +* aasdk is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. + +* aasdk is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with aasdk. If not, see . +*/ + +syntax="proto2"; + +import "DistanceUnitEnum.proto"; + +package aasdk.proto.messages; + +message NavigationDistanceEvent +{ + required uint32 meters = 1; + required uint32 timeToStepSeconds = 2; + required uint32 distanceToStepMillis = 3; + required enums.DistanceUnit.Enum distanceUnit = 4; + +} diff --git a/aasdk_proto/NavigationImageOptionsData.proto b/aasdk_proto/NavigationImageOptionsData.proto index 6ac76c7..bb38a2f 100644 --- a/aasdk_proto/NavigationImageOptionsData.proto +++ b/aasdk_proto/NavigationImageOptionsData.proto @@ -25,4 +25,5 @@ message NavigationImageOptions required int32 width = 1; required int32 height = 2; required int32 colour_depth_bits = 3; + required int32 dunno = 4; } diff --git a/aasdk_proto/NavigationStatusMessage.proto b/aasdk_proto/NavigationStatusMessage.proto new file mode 100644 index 0000000..a5b6a22 --- /dev/null +++ b/aasdk_proto/NavigationStatusMessage.proto @@ -0,0 +1,33 @@ +/* +* This file is part of aasdk library project. +* Copyright (C) 2018 f1x.studio (Michal Szwaj) +* +* aasdk is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. + +* aasdk is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with aasdk. If not, see . +*/ + +syntax="proto2"; + +package aasdk.proto.messages; + +message NavigationStatus +{ + required Enum status = 1; + enum Enum + { + UNAVAILABLE = 0; + ACTIVE = 1; + INACTIVE = 2; + REROUTING = 3; + } +} diff --git a/aasdk_proto/NavigationTurnEventMessage.proto b/aasdk_proto/NavigationTurnEventMessage.proto new file mode 100644 index 0000000..e9fefbd --- /dev/null +++ b/aasdk_proto/NavigationTurnEventMessage.proto @@ -0,0 +1,34 @@ +/* +* This file is part of aasdk library project. +* Copyright (C) 2018 f1x.studio (Michal Szwaj) +* +* aasdk is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. + +* aasdk is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with aasdk. If not, see . +*/ + +syntax="proto2"; + +import "ManeuverTypeEnum.proto"; +import "ManeuverDirectionEnum.proto"; + +package aasdk.proto.messages; + +message NavigationTurnEvent +{ + required string street_name = 1; + required enums.ManeuverDirection.Enum maneuverDirection = 2; + required enums.ManeuverType.Enum maneuverType = 3; + required bytes turnImage = 4; + required uint32 roundaboutExitNumber = 5; + required uint32 roundaboutExitAngle = 6; +} diff --git a/aasdk_proto/NavigationTurnTypeEnum.proto b/aasdk_proto/NavigationTurnTypeEnum.proto new file mode 100644 index 0000000..bd35502 --- /dev/null +++ b/aasdk_proto/NavigationTurnTypeEnum.proto @@ -0,0 +1,31 @@ +/* +* This file is part of aasdk library project. +* Copyright (C) 2018 f1x.studio (Michal Szwaj) +* +* aasdk is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. + +* aasdk is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with aasdk. If not, see . +*/ + +syntax="proto2"; + +package aasdk.proto.enums; + +message NavigationTurnType +{ + enum Enum + { + UNKNOWN = 0; + IMAGE = 1; + ENUM = 2; + } +} diff --git a/aasdk_proto/VideoResolutionEnum.proto b/aasdk_proto/VideoResolutionEnum.proto index 32b582c..061393b 100644 --- a/aasdk_proto/VideoResolutionEnum.proto +++ b/aasdk_proto/VideoResolutionEnum.proto @@ -28,5 +28,9 @@ message VideoResolution _480p = 1; _720p = 2; _1080p = 3; + _1440p = 4; + _720p_p = 5; + _1080pp = 6; + _108s0p_p = 7; } } diff --git a/include/aasdk/Channel/AV/IMediaStatusServiceChannel.hpp b/include/aasdk/Channel/AV/IMediaStatusServiceChannel.hpp new file mode 100644 index 0000000..e388f60 --- /dev/null +++ b/include/aasdk/Channel/AV/IMediaStatusServiceChannel.hpp @@ -0,0 +1,50 @@ +/* +* This file is part of aasdk library project. +* Copyright (C) 2018 f1x.studio (Michal Szwaj) +* +* aasdk is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. + +* aasdk is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with aasdk. If not, see . +*/ + +#pragma once + +#include +#include +#include +#include +#include + + +namespace aasdk +{ +namespace channel +{ +namespace av +{ + +class IMediaStatusServiceChannel +{ +public: + typedef std::shared_ptr Pointer; + + IMediaStatusServiceChannel() = default; + virtual ~IMediaStatusServiceChannel() = default; + + virtual void receive(IMediaStatusServiceChannelEventHandler::Pointer eventHandler) = 0; + virtual void sendChannelOpenResponse(const proto::messages::ChannelOpenResponse& response, SendPromise::Pointer promise) = 0; + virtual messenger::ChannelId getId() const = 0; +}; + +} +} +} diff --git a/include/aasdk/Channel/AV/IMediaStatusServiceChannelEventHandler.hpp b/include/aasdk/Channel/AV/IMediaStatusServiceChannelEventHandler.hpp new file mode 100644 index 0000000..56e068d --- /dev/null +++ b/include/aasdk/Channel/AV/IMediaStatusServiceChannelEventHandler.hpp @@ -0,0 +1,50 @@ +/* +* This file is part of aasdk library project. +* Copyright (C) 2018 f1x.studio (Michal Szwaj) +* +* aasdk is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. + +* aasdk is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with aasdk. If not, see . +*/ + +#pragma once + +#include +#include +#include +#include + + +namespace aasdk +{ +namespace channel +{ +namespace av +{ + +class IMediaStatusServiceChannelEventHandler +{ +public: + typedef std::shared_ptr Pointer; + + IMediaStatusServiceChannelEventHandler() = default; + virtual ~IMediaStatusServiceChannelEventHandler() = default; + + virtual void onChannelOpenRequest(const proto::messages::ChannelOpenRequest& request) = 0; + virtual void onChannelError(const error::Error& e) = 0; + virtual void onMetadataUpdate(const proto::messages::MediaInfoChannelMetadataData& metadata) = 0; + virtual void onPlaybackUpdate(const proto::messages::MediaInfoChannelPlaybackData& playback) = 0; +}; + +} +} +} diff --git a/include/aasdk/Channel/AV/MediaStatusServiceChannel.hpp b/include/aasdk/Channel/AV/MediaStatusServiceChannel.hpp new file mode 100644 index 0000000..0b02992 --- /dev/null +++ b/include/aasdk/Channel/AV/MediaStatusServiceChannel.hpp @@ -0,0 +1,52 @@ +/* +* This file is part of aasdk library project. +* Copyright (C) 2018 f1x.studio (Michal Szwaj) +* +* aasdk is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. + +* aasdk is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with aasdk. If not, see . +*/ + +#pragma once + +#include +#include + + +namespace aasdk +{ +namespace channel +{ +namespace av +{ + +class MediaStatusServiceChannel: public IMediaStatusServiceChannel, public ServiceChannel, public std::enable_shared_from_this +{ +public: + MediaStatusServiceChannel(boost::asio::io_service::strand& strand, messenger::IMessenger::Pointer messenger); + + void receive(IMediaStatusServiceChannelEventHandler::Pointer eventHandler) override; + messenger::ChannelId getId() const override; + void sendChannelOpenResponse(const proto::messages::ChannelOpenResponse& response, SendPromise::Pointer promise) override; + +private: + using std::enable_shared_from_this::shared_from_this; + void messageHandler(messenger::Message::Pointer message, IMediaStatusServiceChannelEventHandler::Pointer eventHandler); + void handleChannelOpenRequest(const common::DataConstBuffer& payload, IMediaStatusServiceChannelEventHandler::Pointer eventHandler); + void handleMetadataUpdate(const common::DataConstBuffer& payload, IMediaStatusServiceChannelEventHandler::Pointer eventHandler); + void handlePlaybackUpdate(const common::DataConstBuffer& payload, IMediaStatusServiceChannelEventHandler::Pointer eventHandler); + +}; + +} +} +} diff --git a/include/aasdk/Channel/Navigation/INavigationStatusServiceChannel.hpp b/include/aasdk/Channel/Navigation/INavigationStatusServiceChannel.hpp new file mode 100644 index 0000000..87c4910 --- /dev/null +++ b/include/aasdk/Channel/Navigation/INavigationStatusServiceChannel.hpp @@ -0,0 +1,50 @@ +/* +* This file is part of aasdk library project. +* Copyright (C) 2018 f1x.studio (Michal Szwaj) +* +* aasdk is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. + +* aasdk is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with aasdk. If not, see . +*/ + +#pragma once + +#include +#include +#include +#include +#include + + +namespace aasdk +{ +namespace channel +{ +namespace navigation +{ + +class INavigationStatusServiceChannel +{ +public: + typedef std::shared_ptr Pointer; + + INavigationStatusServiceChannel() = default; + virtual ~INavigationStatusServiceChannel() = default; + + virtual void receive(INavigationStatusServiceChannelEventHandler::Pointer eventHandler) = 0; + virtual void sendChannelOpenResponse(const proto::messages::ChannelOpenResponse& response, SendPromise::Pointer promise) = 0; + virtual messenger::ChannelId getId() const = 0; +}; + +} +} +} diff --git a/include/aasdk/Channel/Navigation/INavigationStatusServiceChannelEventHandler.hpp b/include/aasdk/Channel/Navigation/INavigationStatusServiceChannelEventHandler.hpp new file mode 100644 index 0000000..8c9a1a5 --- /dev/null +++ b/include/aasdk/Channel/Navigation/INavigationStatusServiceChannelEventHandler.hpp @@ -0,0 +1,52 @@ +/* +* This file is part of aasdk library project. +* Copyright (C) 2018 f1x.studio (Michal Szwaj) +* +* aasdk is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. + +* aasdk is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with aasdk. If not, see . +*/ + +#pragma once + +#include +#include +#include +#include +#include + + +namespace aasdk +{ +namespace channel +{ +namespace navigation +{ + +class INavigationStatusServiceChannelEventHandler +{ +public: + typedef std::shared_ptr Pointer; + + INavigationStatusServiceChannelEventHandler() = default; + virtual ~INavigationStatusServiceChannelEventHandler() = default; + + virtual void onChannelOpenRequest(const proto::messages::ChannelOpenRequest& request) = 0; + virtual void onChannelError(const error::Error& e) = 0; + virtual void onStatusUpdate(const proto::messages::NavigationStatus& navStatus) = 0; + virtual void onTurnEvent(const proto::messages::NavigationTurnEvent& turnEvent) = 0; + virtual void onDistanceEvent(const proto::messages::NavigationDistanceEvent& distanceEvent) = 0; +}; + +} +} +} diff --git a/include/aasdk/Channel/Navigation/NavigationStatusServiceChannel.hpp b/include/aasdk/Channel/Navigation/NavigationStatusServiceChannel.hpp new file mode 100644 index 0000000..b74b974 --- /dev/null +++ b/include/aasdk/Channel/Navigation/NavigationStatusServiceChannel.hpp @@ -0,0 +1,52 @@ +/* +* This file is part of aasdk library project. +* Copyright (C) 2018 f1x.studio (Michal Szwaj) +* +* aasdk is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. + +* aasdk is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with aasdk. If not, see . +*/ + +#pragma once + +#include +#include + + +namespace aasdk +{ +namespace channel +{ +namespace navigation +{ + +class NavigationStatusServiceChannel: public INavigationStatusServiceChannel, public ServiceChannel, public std::enable_shared_from_this +{ +public: + NavigationStatusServiceChannel(boost::asio::io_service::strand& strand, messenger::IMessenger::Pointer messenger); + + void receive(INavigationStatusServiceChannelEventHandler::Pointer eventHandler) override; + messenger::ChannelId getId() const override; + void sendChannelOpenResponse(const proto::messages::ChannelOpenResponse& response, SendPromise::Pointer promise) override; + +private: + using std::enable_shared_from_this::shared_from_this; + void messageHandler(messenger::Message::Pointer message, INavigationStatusServiceChannelEventHandler::Pointer eventHandler); + void handleChannelOpenRequest(const common::DataConstBuffer& payload, INavigationStatusServiceChannelEventHandler::Pointer eventHandler); + void handleStatusUpdate(const common::DataConstBuffer& payload, INavigationStatusServiceChannelEventHandler::Pointer eventHandler); + void handleTurnEvent(const common::DataConstBuffer& payload, INavigationStatusServiceChannelEventHandler::Pointer eventHandler); + void handleDistanceEvent(const common::DataConstBuffer& payload, INavigationStatusServiceChannelEventHandler::Pointer eventHandler); +}; + +} +} +} diff --git a/include/aasdk/Messenger/ChannelId.hpp b/include/aasdk/Messenger/ChannelId.hpp index 16c922f..29b70c9 100644 --- a/include/aasdk/Messenger/ChannelId.hpp +++ b/include/aasdk/Messenger/ChannelId.hpp @@ -37,6 +37,8 @@ enum class ChannelId SYSTEM_AUDIO, AV_INPUT, BLUETOOTH, + NAVIGATION, + MEDIA_STATUS, NONE = 255 }; diff --git a/src/Channel/AV/MediaStatusServiceChannel.cpp b/src/Channel/AV/MediaStatusServiceChannel.cpp new file mode 100644 index 0000000..d5563b1 --- /dev/null +++ b/src/Channel/AV/MediaStatusServiceChannel.cpp @@ -0,0 +1,146 @@ +/* +* This file is part of aasdk library project. +* Copyright (C) 2018 f1x.studio (Michal Szwaj) +* +* aasdk is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. + +* aasdk is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with aasdk. If not, see . +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace aasdk +{ +namespace channel +{ +namespace av +{ + +MediaStatusServiceChannel::MediaStatusServiceChannel(boost::asio::io_service::strand& strand, messenger::IMessenger::Pointer messenger) + : ServiceChannel(strand, std::move(messenger), messenger::ChannelId::MEDIA_STATUS) +{ + +} + +void MediaStatusServiceChannel::receive(IMediaStatusServiceChannelEventHandler::Pointer eventHandler) +{ + auto receivePromise = messenger::ReceivePromise::defer(strand_); + receivePromise->then(std::bind(&MediaStatusServiceChannel::messageHandler, this->shared_from_this(), std::placeholders::_1, eventHandler), + std::bind(&IMediaStatusServiceChannelEventHandler::onChannelError, eventHandler,std::placeholders::_1)); + + messenger_->enqueueReceive(channelId_, std::move(receivePromise)); +} + +messenger::ChannelId MediaStatusServiceChannel::getId() const +{ + return channelId_; +} + +void MediaStatusServiceChannel::sendChannelOpenResponse(const proto::messages::ChannelOpenResponse& response, SendPromise::Pointer promise) +{ + AASDK_LOG(info) << "[MediaStatusServiceChannel] channel open response "; + auto message(std::make_shared(channelId_, messenger::EncryptionType::ENCRYPTED, messenger::MessageType::CONTROL)); + message->insertPayload(messenger::MessageId(proto::ids::ControlMessage::CHANNEL_OPEN_RESPONSE).getData()); + message->insertPayload(response); + + this->send(std::move(message), std::move(promise)); +} + + +void MediaStatusServiceChannel::messageHandler(messenger::Message::Pointer message, IMediaStatusServiceChannelEventHandler::Pointer eventHandler) +{ + messenger::MessageId messageId(message->getPayload()); + common::DataConstBuffer payload(message->getPayload(), messageId.getSizeOf()); + + switch(messageId.getId()) + { + case proto::ids::ControlMessage::CHANNEL_OPEN_REQUEST: + this->handleChannelOpenRequest(payload, std::move(eventHandler)); + break; + + case proto::ids::MediaInfoChannelMessage::METADATA: + this->handleMetadataUpdate(payload, std::move(eventHandler)); + break; + + case proto::ids::MediaInfoChannelMessage::PLAYBACK: + this->handlePlaybackUpdate(payload, std::move(eventHandler)); + break; + + default: + AASDK_LOG(error) << "[MediaStatusServiceChannel] message not handled: " << messageId.getId() << " : " << dump(payload); + this->receive(std::move(eventHandler)); + break; + } + + + +} + +void MediaStatusServiceChannel::handleMetadataUpdate(const common::DataConstBuffer& payload, IMediaStatusServiceChannelEventHandler::Pointer eventHandler) +{ + proto::messages::MediaInfoChannelMetadataData metadata; + if(metadata.ParseFromArray(payload.cdata, payload.size)) + { + eventHandler->onMetadataUpdate(metadata); + } + else + { + eventHandler->onChannelError(error::Error(error::ErrorCode::PARSE_PAYLOAD)); + AASDK_LOG(error) << "[MediaStatusServiceChannel] encountered error with message: " << dump(payload); + } + +} + + +void MediaStatusServiceChannel::handlePlaybackUpdate(const common::DataConstBuffer& payload, IMediaStatusServiceChannelEventHandler::Pointer eventHandler) +{ + proto::messages::MediaInfoChannelPlaybackData playback; + if(playback.ParseFromArray(payload.cdata, payload.size)) + { + eventHandler->onPlaybackUpdate(playback); + } + else + { + eventHandler->onChannelError(error::Error(error::ErrorCode::PARSE_PAYLOAD)); + AASDK_LOG(error) << "[MediaStatusServiceChannel] encountered error with message: " << dump(payload); + } + +} + +void MediaStatusServiceChannel::handleChannelOpenRequest(const common::DataConstBuffer& payload, IMediaStatusServiceChannelEventHandler::Pointer eventHandler) +{ + AASDK_LOG(info) << "[MediaStatusServiceChannel] channel open request "; + + proto::messages::ChannelOpenRequest request; + if(request.ParseFromArray(payload.cdata, payload.size)) + { + eventHandler->onChannelOpenRequest(request); + } + else + { + eventHandler->onChannelError(error::Error(error::ErrorCode::PARSE_PAYLOAD)); + } +} + + +} +} +} diff --git a/src/Channel/Navigation/NavigationStatusServiceChannel.cpp b/src/Channel/Navigation/NavigationStatusServiceChannel.cpp new file mode 100644 index 0000000..726837a --- /dev/null +++ b/src/Channel/Navigation/NavigationStatusServiceChannel.cpp @@ -0,0 +1,162 @@ +/* +* This file is part of aasdk library project. +* Copyright (C) 2018 f1x.studio (Michal Szwaj) +* +* aasdk is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. + +* aasdk is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with aasdk. If not, see . +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace aasdk +{ +namespace channel +{ +namespace navigation +{ + +NavigationStatusServiceChannel::NavigationStatusServiceChannel(boost::asio::io_service::strand& strand, messenger::IMessenger::Pointer messenger) + : ServiceChannel(strand, std::move(messenger), messenger::ChannelId::NAVIGATION) +{ + +} + +void NavigationStatusServiceChannel::receive(INavigationStatusServiceChannelEventHandler::Pointer eventHandler) +{ + AASDK_LOG(info) << "[NavigationStatusServiceChannel] receive "; + + auto receivePromise = messenger::ReceivePromise::defer(strand_); + receivePromise->then(std::bind(&NavigationStatusServiceChannel::messageHandler, this->shared_from_this(), std::placeholders::_1, eventHandler), + std::bind(&INavigationStatusServiceChannelEventHandler::onChannelError, eventHandler,std::placeholders::_1)); + + messenger_->enqueueReceive(channelId_, std::move(receivePromise)); +} + +messenger::ChannelId NavigationStatusServiceChannel::getId() const +{ + return channelId_; +} + +void NavigationStatusServiceChannel::sendChannelOpenResponse(const proto::messages::ChannelOpenResponse& response, SendPromise::Pointer promise) +{ + AASDK_LOG(info) << "[NavigationStatusServiceChannel] channel open response "; + + auto message(std::make_shared(channelId_, messenger::EncryptionType::ENCRYPTED, messenger::MessageType::CONTROL)); + message->insertPayload(messenger::MessageId(proto::ids::ControlMessage::CHANNEL_OPEN_RESPONSE).getData()); + message->insertPayload(response); + + this->send(std::move(message), std::move(promise)); +} + + +void NavigationStatusServiceChannel::messageHandler(messenger::Message::Pointer message, INavigationStatusServiceChannelEventHandler::Pointer eventHandler) +{ + AASDK_LOG(info) << "[NavigationStatusServiceChannel] message handler "; + + messenger::MessageId messageId(message->getPayload()); + common::DataConstBuffer payload(message->getPayload(), messageId.getSizeOf()); + + switch(messageId.getId()) + { + case proto::ids::ControlMessage::CHANNEL_OPEN_REQUEST: + this->handleChannelOpenRequest(payload, std::move(eventHandler)); + break; + case proto::ids::NavigationChannelMessage::STATUS: + this->handleStatusUpdate(payload, std::move(eventHandler)); + break; + case proto::ids::NavigationChannelMessage::TURN_EVENT: + this->handleTurnEvent(payload, std::move(eventHandler)); + break; + case proto::ids::NavigationChannelMessage::DISTANCE_EVENT: + this->handleDistanceEvent(payload, std::move(eventHandler)); + break; + + + default: + AASDK_LOG(error) << "[NavigationStatusServiceChannel] message not handled: " << messageId.getId() << " : " << dump(payload); + this->receive(std::move(eventHandler)); + break; + } +} + +void NavigationStatusServiceChannel::handleChannelOpenRequest(const common::DataConstBuffer& payload, INavigationStatusServiceChannelEventHandler::Pointer eventHandler) +{ + AASDK_LOG(info) << "[NavigationStatusServiceChannel] channel open request "; + + proto::messages::ChannelOpenRequest request; + if(request.ParseFromArray(payload.cdata, payload.size)) + { + eventHandler->onChannelOpenRequest(request); + } + else + { + eventHandler->onChannelError(error::Error(error::ErrorCode::PARSE_PAYLOAD)); + } +} + +void NavigationStatusServiceChannel::handleStatusUpdate(const common::DataConstBuffer& payload, INavigationStatusServiceChannelEventHandler::Pointer eventHandler) +{ + proto::messages::NavigationStatus navStatus; + if(navStatus.ParseFromArray(payload.cdata, payload.size)) + { + eventHandler->onStatusUpdate(navStatus); + } + else + { + eventHandler->onChannelError(error::Error(error::ErrorCode::PARSE_PAYLOAD)); + AASDK_LOG(error) << "[NavigationStatusServiceChannel] encountered error with message: " << dump(payload); + } + +} + +void NavigationStatusServiceChannel::handleTurnEvent(const common::DataConstBuffer& payload, INavigationStatusServiceChannelEventHandler::Pointer eventHandler) +{ + proto::messages::NavigationTurnEvent turnEvent; + if(turnEvent.ParseFromArray(payload.cdata, payload.size)) + { + eventHandler->onTurnEvent(turnEvent); + } + else + { + eventHandler->onChannelError(error::Error(error::ErrorCode::PARSE_PAYLOAD)); + AASDK_LOG(error) << "[NavigationStatusServiceChannel] encountered error with message: " << dump(payload); + } + +} + +void NavigationStatusServiceChannel::handleDistanceEvent(const common::DataConstBuffer& payload, INavigationStatusServiceChannelEventHandler::Pointer eventHandler) +{ + proto::messages::NavigationDistanceEvent distanceEvent; + if(distanceEvent.ParseFromArray(payload.cdata, payload.size)) + { + eventHandler->onDistanceEvent(distanceEvent); + } + else + { + eventHandler->onChannelError(error::Error(error::ErrorCode::PARSE_PAYLOAD)); + AASDK_LOG(error) << "[NavigationStatusServiceChannel] encountered error with message: " << dump(payload); + } + +} + +} +} +} diff --git a/src/Common/Data.cpp b/src/Common/Data.cpp index 397752f..ec689f1 100644 --- a/src/Common/Data.cpp +++ b/src/Common/Data.cpp @@ -19,6 +19,9 @@ #include #include #include +#include +#include +#include namespace aasdk @@ -130,6 +133,20 @@ std::string dump(const Data& data) return dump(DataConstBuffer(data)); } + +std::string uint8_to_hex_string(const uint8_t *v, const size_t s) { + std::stringstream ss; + + ss << std::hex << std::setfill('0'); + + for (int i = 0; i < s; i++) { + ss << " "; + ss << std::hex << std::setw(2) << static_cast(v[i]); + } + + return ss.str(); +} + std::string dump(const DataConstBuffer& buffer) { if(buffer.size == 0) @@ -138,7 +155,7 @@ std::string dump(const DataConstBuffer& buffer) } else { - std::string hexDump = "[" + std::to_string(buffer.size) + "] "; + std::string hexDump = "[" + uint8_to_hex_string(buffer.cdata, buffer.size) + " ] "; //boost::algorithm::hex(bufferBegin(buffer), bufferEnd(buffer), back_inserter(hexDump)); return hexDump; } diff --git a/src/Messenger/ChannelId.cpp b/src/Messenger/ChannelId.cpp index a54b701..66ca3ca 100644 --- a/src/Messenger/ChannelId.cpp +++ b/src/Messenger/ChannelId.cpp @@ -46,6 +46,8 @@ std::string channelIdToString(ChannelId channelId) return "AV_INPUT"; case ChannelId::BLUETOOTH: return "BLUETOOTH"; + case ChannelId::NAVIGATION: + return "NAVIGATION"; case ChannelId::NONE: return "NONE"; default: