mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
add Hue EntertainmentAPI + Forwarder & other Fixes (#592)
* whitespaces + typo fixes * JS / LGTM fixes * SSDP Handler crash fix * MessageForwarder handlePriorityChanges Slave fixes * use aboutToQuit Signal * complete rewriten Hue Entertainment API structure combined Philips Hue and Entertainment API with new MbedTLS based SSL UDP Provider * add required cross-compile submodules * logical rebuild fn: initLeds, setLights + new logs -more detailed checks and error handling inside iniLeds and setLights - logical script procedure before ProviderUdpSSL init - first steps for multiple ProviderUdpSSL usage - better fallback support to old RestAPI, if entertainment api is not supported - just 4 u LordGrey: new log fn for cosmetic config outputs ;) * add OSX CompileHowTo - undo from CrossCompileHowTo * whitespace fixes * lightID toString fix * fix unsigned int E-API + debug output * bugfixes, reworked black signal detection, wizard: - change device config field light-ids from int to string -> real unsigned int fix - add signal detection brightness minimum threshold value 0.0 for 0% brightness - 1.0 for 100% brightness to count for blacklight signal detection reason: input may not 100% black, like mine - i have a deep dark gray input signal -> my threshold value is set to 0.005 for 0.5% minimum brightness = 1 (from max 255) to count as black - wizard optimations, with fallback without entertainment support (beta state) - whitespace fixes * cleanup + minor fixes * change fixed Hue UPD SSL config to _devConfig paras * Hotfix SSL Connection, new light models, wizard: - Fix UPD SSL Connection failed Problems - add new supported gamut C light models: LCG002, LCA001, LCA002, LCA003 - wizard: extend fallback support to classic mode + hints * whitespace, typo fix * uncheck useEntertainmentAPI, if noAPISupport detected + hint * coredump fix -> add _blackLightsTimer nullptr init * code cleanup / remove old debugs + whitespacefixes * add gamut C LCP001, LCP002 * SSL UDP config made more flexible + remove qDebug -> switch to hyerion.ng _log -> replace logCommand with verbose -> code cleanups etc... * extended mbedtls debugging infos * add adjustable ssl timeout settings * error handling * streamdebugger bugfixes * UPDSSL psk / psk_identity bugfixes! + hue wizard fn typo fix + - verbose option available without dependencies - whitespace fixes * Philips Hue Assistant now recognizes non-original bridges better... + Added note if no clientkey is set when using the entertainment API + User creation (+ clientkey) for non-original bridges can now also be used + Minor changes and bug fixes * CMAKE mbedTLS detection * minor bug fixes + code cleanups * FindMbedTLS.cmake remove Path-Hints + wizard.js: ajax timeout handling Test - content_grabber.js: run relevant code only, if V4L2_AVAIL is true: conf_grabber don't displays other devices, if V4L2 is not available * compile mbedtls via cmake as static lib * remove libmbedtls-dev from compileHowto / scripts * Fix Windows build * Fix windows build (part 2) * removed unnecessary osx x11 include directory path * QTimer Shutdown bugfix * cmake win32 fix + minor bugfixes * cmake debug msg used mbedtls libs * Bugfix: noSignalDetection wasn't switchedOn again if no signal was previously detected * Some code fixes based on alerts from lgtm.com Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
This commit is contained in:
37
dependencies/CMakeLists-mbedtls.txt.in
vendored
Normal file
37
dependencies/CMakeLists-mbedtls.txt.in
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
|
||||
project(mbedtls)
|
||||
|
||||
set(DOWNLOAD_DIR "@MBEDTLS_DOWNLOAD_DIR@")
|
||||
set(SOURCE_DIR "@MBEDTLS_SOURCE_DIR@")
|
||||
set(BINARY_DIR "@MBEDTLS_BINARY_DIR@")
|
||||
set(INSTALL_DIR "@MBEDTLS_INSTALL_DIR@")
|
||||
set(CMAKE_ARGS "@MBEDTLS_CMAKE_ARGS@")
|
||||
set(LOGGING "@MBEDTLS_LOGGING@")
|
||||
|
||||
include(ExternalProject)
|
||||
|
||||
ExternalProject_Add(
|
||||
mbedtls
|
||||
GIT_REPOSITORY "https://github.com/ARMmbed/mbedtls.git"
|
||||
GIT_TAG origin/master
|
||||
BUILD_ALWAYS OFF
|
||||
DOWNLOAD_DIR "${DOWNLOAD_DIR}"
|
||||
SOURCE_DIR "${SOURCE_DIR}"
|
||||
BINARY_DIR "${BINARY_DIR}"
|
||||
INSTALL_DIR "${INSTALL_DIR}"
|
||||
CMAKE_ARGS ${CMAKE_ARGS}
|
||||
CONFIGURE_COMMAND ""
|
||||
UPDATE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
LOG_DOWNLOAD ${LOGGING}
|
||||
LOG_UPDATE ${LOGGING}
|
||||
LOG_PATCH ${LOGGING}
|
||||
LOG_CONFIGURE ${LOGGING}
|
||||
LOG_BUILD ${LOGGING}
|
||||
LOG_INSTALL ${LOGGING}
|
||||
LOG_TEST ${LOGGING}
|
||||
LOG_MERGED_STDOUTERR ${LOGGING}
|
||||
LOG_OUTPUT_ON_FAILURE ${LOGGING}
|
||||
)
|
130
dependencies/CMakeLists.txt
vendored
130
dependencies/CMakeLists.txt
vendored
@@ -58,7 +58,6 @@ endif()
|
||||
|
||||
message(STATUS "Using flatbuffers compiler: " ${FLATBUFFERS_FLATC_EXECUTABLE})
|
||||
|
||||
|
||||
function(compile_flattbuffer_schema SRC_FBS OUTPUT_DIR)
|
||||
string(REGEX REPLACE "\\.fbs$" "_generated.h" GEN_HEADER ${SRC_FBS})
|
||||
set_property(SOURCE ${GEN_HEADER} PROPERTY SKIP_AUTOMOC ON)
|
||||
@@ -193,3 +192,132 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
|
||||
set(${SRCS} ${${SRCS}} PARENT_SCOPE)
|
||||
set(${HDRS} ${${HDRS}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
#=============================================================================
|
||||
# MBEDTLS
|
||||
#=============================================================================
|
||||
|
||||
set(USE_SYSTEM_MBEDTLS_LIBS ${DEFAULT_USE_SYSTEM_MBEDTLS_LIBS} CACHE BOOL "use mbedtls library from system")
|
||||
|
||||
if (USE_SYSTEM_MBEDTLS_LIBS)
|
||||
find_package(mbedtls REQUIRED)
|
||||
if (NOT MBEDTLS_FOUND)
|
||||
message(STATUS "Could NOT find mbedtls system libraries, build static mbedtls libraries")
|
||||
#Fallback: build mbedtls static libray inside project
|
||||
set(DEFAULT_USE_SYSTEM_MBEDTLS_LIBS OFF PARENT_SCOPE)
|
||||
set(USE_SYSTEM_MBEDTLS_LIBS OFF)
|
||||
endif (NOT MBEDTLS_FOUND)
|
||||
endif (USE_SYSTEM_MBEDTLS_LIBS)
|
||||
|
||||
if (NOT USE_SYSTEM_MBEDTLS_LIBS)
|
||||
set(DEFAULT_USE_SYSTEM_MBEDTLS_LIBS OFF CACHE BOOL "system mbedtls libraries not found, disable use system mbedtls libraries")
|
||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared mbedtls libraries")
|
||||
|
||||
set(ENABLE_TESTING OFF CACHE BOOL "Disable mbedTLS tests")
|
||||
set(ENABLE_PROGRAMS OFF CACHE BOOL "Disable mbedTLS programs")
|
||||
set(USE_SHARED_MBEDTLS_LIBRARY OFF CACHE BOOL "Disable mbedTLS shared libraries")
|
||||
set(USE_STATIC_MBEDTLS_LIBRARY ON CACHE BOOL "Enable mbedTLS static libraries")
|
||||
|
||||
set(MBEDTLS_DOWNLOAD_DIR "${CMAKE_BINARY_DIR}/dependencies/external/mbedtls/download")
|
||||
set(MBEDTLS_SOURCE_DIR "${CMAKE_BINARY_DIR}/dependencies/external/mbedtls/src")
|
||||
set(MBEDTLS_BINARY_DIR "${CMAKE_BINARY_DIR}/dependencies/external/mbedtls/build")
|
||||
set(MBEDTLS_INSTALL_DIR "${CMAKE_BINARY_DIR}")
|
||||
if(${CMAKE_BUILD_TYPE} EQUAL "Debug")
|
||||
set(MBEDTLS_LOGGING 1)
|
||||
else ()
|
||||
set(MBEDTLS_LOGGING 0)
|
||||
endif ()
|
||||
|
||||
set(MBEDTLS_CMAKE_ARGS
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=${MBEDTLS_INSTALL_DIR}
|
||||
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
|
||||
-DUSE_SHARED_MBEDTLS_LIBRARY:BOOL=OFF
|
||||
-DUSE_STATIC_MBEDTLS_LIBRARY:BOOL=ON
|
||||
-DENABLE_TESTING:BOOL=OFF
|
||||
-DENABLE_PROGRAMS:BOOL=OFF
|
||||
-DLINK_WITH_PTHREAD:BOOL=ON
|
||||
-Wno-dev
|
||||
#-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=TRUE
|
||||
)
|
||||
|
||||
set(ENABLE_MBEDTLS_FETCH_CONTENT ON)
|
||||
|
||||
if (ENABLE_MBEDTLS_FETCH_CONTENT AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.11)
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
mbedtls
|
||||
GIT_REPOSITORY https://github.com/ARMmbed/mbedtls.git
|
||||
GIT_TAG origin/master
|
||||
BUILD_ALWAYS OFF
|
||||
GIT_PROGRESS 1
|
||||
DOWNLOAD_DIR "${MBEDTLS_DOWNLOAD_DIR}"
|
||||
SOURCE_DIR "${MBEDTLS_SOURCE_DIR}"
|
||||
BINARY_DIR "${MBEDTLS_BINARY_DIR}"
|
||||
INSTALL_DIR "${MBEDTLS_INSTALL_DIR}"
|
||||
CMAKE_ARGS ${MBEDTLS_CMAKE_ARGS}
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
LOG_DOWNLOAD ${MBEDTLS_LOGGING}
|
||||
LOG_UPDATE ${MBEDTLS_LOGGING}
|
||||
LOG_PATCH ${MBEDTLS_LOGGING}
|
||||
LOG_CONFIGURE ${MBEDTLS_LOGGING}
|
||||
LOG_BUILD ${MBEDTLS_LOGGING}
|
||||
LOG_INSTALL ${MBEDTLS_LOGGING}
|
||||
LOG_TEST ${MBEDTLS_LOGGING}
|
||||
LOG_MERGED_STDOUTERR ${MBEDTLS_LOGGING}
|
||||
LOG_OUTPUT_ON_FAILURE ${MBEDTLS_LOGGING}
|
||||
)
|
||||
|
||||
if (CMAKE_VERSION VERSION_LESS 3.14)
|
||||
macro (FetchContent_MakeAvailable NAME)
|
||||
FetchContent_GetProperties(${NAME})
|
||||
if (NOT ${NAME}_POPULATED)
|
||||
FetchContent_Populate(${NAME})
|
||||
add_subdirectory(${${NAME}_SOURCE_DIR} ${${NAME}_BINARY_DIR})
|
||||
endif ()
|
||||
endmacro ()
|
||||
endif ()
|
||||
|
||||
FetchContent_MakeAvailable(mbedtls)
|
||||
else ()
|
||||
set(ENABLE_MBEDTLS_FETCH_CONTENT OFF PARENT_SCOPE)
|
||||
if(NOT DEFINED BUILD_MBEDTLS_ONCE)
|
||||
set(BUILD_MBEDTLS_ONCE CACHE INTERNAL "Done")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/dependencies/CMakeLists-mbedtls.txt.in ${MBEDTLS_DOWNLOAD_DIR}/CMakeLists.txt @ONLY)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH=${MBEDTLS_INSTALL_DIR} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -G "${CMAKE_GENERATOR}" . WORKING_DIRECTORY ${MBEDTLS_DOWNLOAD_DIR})
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} --build . WORKING_DIRECTORY ${MBEDTLS_DOWNLOAD_DIR})
|
||||
add_subdirectory(${MBEDTLS_SOURCE_DIR} ${MBEDTLS_BINARY_DIR})
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
set (MBEDTLS_INCLUDE_DIR "${MBEDTLS_SOURCE_DIR}/include")
|
||||
set (MBEDTLS_INCLUDE_DIR ${MBEDTLS_INCLUDE_DIR} PARENT_SCOPE)
|
||||
if (MBEDTLS_INCLUDE_DIR AND EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h")
|
||||
file(STRINGS "${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h" _MBEDTLS_VERSION_STRING REGEX "^#[\t ]*define[\t ]+MBEDTLS_VERSION_STRING[\t ]+\"[0-9]+.[0-9]+.[0-9]+\"")
|
||||
string(REGEX REPLACE "^.*MBEDTLS_VERSION_STRING.*([0-9]+.[0-9]+.[0-9]+).*" "\\1" MBEDTLS_VERSION "${_MBEDTLS_VERSION_STRING}")
|
||||
message(STATUS "Using static mbedtls libraries (build version \"${MBEDTLS_VERSION}\")")
|
||||
endif ()
|
||||
|
||||
include_directories(${MBEDTLS_INCLUDE_DIR})
|
||||
|
||||
if(WIN32)
|
||||
set (MBEDTLS_LIB_INSTALL_DIR_WITH_LIB_PREFIX "${MBEDTLS_INSTALL_DIR}/lib/${CMAKE_CFG_INTDIR}/")
|
||||
else()
|
||||
set (MBEDTLS_LIB_INSTALL_DIR_WITH_LIB_PREFIX "${MBEDTLS_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}")
|
||||
endif ()
|
||||
|
||||
set (MBEDTLS_SSL_LIBRARY "${MBEDTLS_LIB_INSTALL_DIR_WITH_LIB_PREFIX}mbedtls${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
set (MBEDTLS_X509_LIBRARY "${MBEDTLS_LIB_INSTALL_DIR_WITH_LIB_PREFIX}mbedx509${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
set (MBEDTLS_CRYPTO_LIBRARY "${MBEDTLS_LIB_INSTALL_DIR_WITH_LIB_PREFIX}mbedcrypto${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
set (MBEDTLS_LIBRARIES ${MBEDTLS_SSL_LIBRARY} ${MBEDTLS_X509_LIBRARY} ${MBEDTLS_CRYPTO_LIBRARY})
|
||||
set (MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARIES} PARENT_SCOPE)
|
||||
|
||||
if(${CMAKE_BUILD_TYPE} EQUAL "Debug")
|
||||
message(STATUS "mbedtls libraries: ${MBEDTLS_LIBRARIES}")
|
||||
endif ()
|
||||
|
||||
mark_as_advanced (MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARIES MBEDTLS_SSL_LIBRARY MBEDTLS_X509_LIBRARY MBEDTLS_CRYPTO_LIBRARY)
|
||||
|
||||
endif (NOT USE_SYSTEM_MBEDTLS_LIBS)
|
||||
|
Reference in New Issue
Block a user