diff --git a/.gitignore b/.gitignore index 539f6e085..07447b905 100644 --- a/.gitignore +++ b/.gitignore @@ -17,38 +17,38 @@ Makefile */Makefile */*/Makefile */*/*/Makefile -*/*/WPEFramework*Config.cmake -*/*/WPEFramework*ConfigVersion.cmake +*/*/Thunder*Config.cmake +*/*/Thunder*ConfigVersion.cmake */*/CompileSettingsDebugConfig.cmake */*/CompileSettingsDebugConfigVersion.cmake -*/*/*/WPEFramework*Config.cmake -*/*/*/WPEFramework*ConfigVersion.cmake +*/*/*/Thunder*Config.cmake +*/*/*/Thunder*ConfigVersion.cmake *.pc *.so.* *.so /cppcheck_report.txt /cppcheck_log.txt clion-environment/ -/clion-environment/WPEFrameworkPlugins/RemoteControl/RemoteControl.json -/clion-environment/WPEFrameworkPlugins/Commander/Commander.json -/clion-environment/WPEFrameworkPlugins/DeviceInfo/DeviceInfo.json -/clion-environment/WPEFrameworkPlugins/LocationSync/LocationSync.json -/clion-environment/WPEFrameworkPlugins/Monitor/Monitor.json -/clion-environment/WPEFrameworkPlugins/TimeSync/TimeSync.json -/clion-environment/WPEFrameworkPlugins/TraceControl/Tracing.json -/clion-environment/WPEFrameworkPlugins/WebProxy/WebProxy.json -/clion-environment/WPEFrameworkPlugins/WebServer/WebServer.json -/clion-environment/WPEFrameworkPlugins/WebShell/WebShell.json +/clion-environment/ThunderPlugins/RemoteControl/RemoteControl.json +/clion-environment/ThunderPlugins/Commander/Commander.json +/clion-environment/ThunderPlugins/DeviceInfo/DeviceInfo.json +/clion-environment/ThunderPlugins/LocationSync/LocationSync.json +/clion-environment/ThunderPlugins/Monitor/Monitor.json +/clion-environment/ThunderPlugins/TimeSync/TimeSync.json +/clion-environment/ThunderPlugins/TraceControl/Tracing.json +/clion-environment/ThunderPlugins/WebProxy/WebProxy.json +/clion-environment/ThunderPlugins/WebServer/WebServer.json +/clion-environment/ThunderPlugins/WebShell/WebShell.json workspace/ /.vs /artifacts/Debug *.user /artifacts/Release *.pyc -Source/WPEFramework/WPEFramework -Source/WPEFramework/WPEFramework-1.0.0 -Source/WPEProcess/WPEProcess -Source/WPEProcess/WPEProcess-1.0.0 -Source/WPEFramework/scripts/wpeframework +Source/Thunder/Thunder +Source/Thunder/Thunder-1.0.0 +Source/ThunderPlugin/ThunderPlugin +Source/ThunderPlugin/ThunderPlugin-1.0.0 +Source/Thunder/scripts/wpeframework */*/generated/ site/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 18cdc5b7a..a5eac124c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ cmake_minimum_required(VERSION 3.3) -project(WPEFramework) +project(Thunder) set(VERSION_MAJOR 1) set(VERSION_MINOR 0) diff --git a/README.md b/README.md index dc7cc276a..49ff9dbae 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ![Linux Build](https://github.com/rdkcentral/Thunder/actions/workflows/Build%20Thunder%20on%20Linux.yml/badge.svg) ![Windows Build](https://github.com/rdkcentral/Thunder/actions/workflows/Build%20Thunder%20on%20Windows.yml/badge.svg) ![Unit Test](https://github.com/rdkcentral/Thunder/actions/workflows/Test%20Thunder.yml/badge.svg) -Thunder (also known as WPEFramework) is an open-source plugin-based device abstraction layer, where business functionality can be implemented as plugins and applications can query and control those plugins. Using Thunder provides a consistent interface-driven development model for both plugins and client applications, with an RPC engine that is suited to both web-based and native apps. +Thunder (also known as Thunder) is an open-source plugin-based device abstraction layer, where business functionality can be implemented as plugins and applications can query and control those plugins. Using Thunder provides a consistent interface-driven development model for both plugins and client applications, with an RPC engine that is suited to both web-based and native apps. Designed from the ground up for embedded platforms and written in C++11, Thunder can be run on even the most low-power of devices (including ARM and MIPS-based platforms). diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 3c66a9216..f82f638dc 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -97,9 +97,9 @@ if(PLUGINS) endif() if(PROCESS) - add_subdirectory(WPEProcess) + add_subdirectory(ThunderPlugin) endif() if(EXECUTABLE) - add_subdirectory(WPEFramework) + add_subdirectory(Thunder) endif() diff --git a/Source/WPEFramework.sln b/Source/Thunder.sln similarity index 97% rename from Source/WPEFramework.sln rename to Source/Thunder.sln index d2ff1c937..007e0d4f2 100644 --- a/Source/WPEFramework.sln +++ b/Source/Thunder.sln @@ -61,14 +61,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "interfaces", "interfaces\in {B63FDAE4-53A4-4B19-BFEC-6E6A2EF841F5} = {B63FDAE4-53A4-4B19-BFEC-6E6A2EF841F5} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "comprocess", "WPEProcess\comprocess.vcxproj", "{B88DE14D-3E0D-440E-A753-CE7ADD5DF3CA}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "comprocess", "ThunderPlugin\comprocess.vcxproj", "{B88DE14D-3E0D-440E-A753-CE7ADD5DF3CA}" ProjectSection(ProjectDependencies) = postProject {0936A7B8-E995-452D-8062-CA9311854018} = {0936A7B8-E995-452D-8062-CA9311854018} {B63FDAE4-53A4-4B19-BFEC-6E6A2EF841F5} = {B63FDAE4-53A4-4B19-BFEC-6E6A2EF841F5} {0CA4C3EA-2DD4-4BB3-804C-331D09CC3402} = {0CA4C3EA-2DD4-4BB3-804C-331D09CC3402} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bridge", "WPEFramework\bridge.vcxproj", "{F3DF5408-637E-49DB-BF6B-0B7D17509AC0}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bridge", "Thunder\bridge.vcxproj", "{F3DF5408-637E-49DB-BF6B-0B7D17509AC0}" ProjectSection(ProjectDependencies) = postProject {B88DE14D-3E0D-440E-A753-CE7ADD5DF3CA} = {B88DE14D-3E0D-440E-A753-CE7ADD5DF3CA} {6A3B427D-D8AF-4D2A-B400-924D2596DCF7} = {6A3B427D-D8AF-4D2A-B400-924D2596DCF7} @@ -107,9 +107,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JSONRPCClient", "..\..\Thun EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configurations", "Configurations", "{008FC636-F920-4BA2-B90F-F100E723FA51}" ProjectSection(SolutionItems) = preProject - WPEFramework\ExampleConfigAll.json = WPEFramework\ExampleConfigAll.json - WPEFramework\ExampleConfigLinux.json = WPEFramework\ExampleConfigLinux.json - WPEFramework\ExampleConfigWindows.json = WPEFramework\ExampleConfigWindows.json + Thunder\ExampleConfigAll.json = Thunder\ExampleConfigAll.json + Thunder\ExampleConfigLinux.json = Thunder\ExampleConfigLinux.json + Thunder\ExampleConfigWindows.json = Thunder\ExampleConfigWindows.json EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Thunder", "Thunder", "{D7AD4AF2-B32F-44C6-9F19-90484D586346}" diff --git a/Source/WPEFramework/CMakeLists.txt b/Source/Thunder/CMakeLists.txt similarity index 100% rename from Source/WPEFramework/CMakeLists.txt rename to Source/Thunder/CMakeLists.txt diff --git a/Source/WPEFramework/Config.h b/Source/Thunder/Config.h similarity index 99% rename from Source/WPEFramework/Config.h rename to Source/Thunder/Config.h index 6d6c2964e..f23d3706c 100644 --- a/Source/WPEFramework/Config.h +++ b/Source/Thunder/Config.h @@ -22,7 +22,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace PluginHost { /** diff --git a/Source/Thunder/ConfigBuildroot.json b/Source/Thunder/ConfigBuildroot.json new file mode 100644 index 000000000..49da390d0 --- /dev/null +++ b/Source/Thunder/ConfigBuildroot.json @@ -0,0 +1,13 @@ +{ + "port":9888, + "binding":"0.0.0.0", + "idletime":180, + "persistentpath":"/tmp", + "datapath":"/opt/thunder/Plugins/", + "plugins": + [ + {"callsign":"Tracing","locator":"/opt/thunder/libtracecontrol.so", "classname":"TraceControl", "configuration":{"console":true,"remote":{"port":4444,"binding":"0.0.0.0"}}}, + {"callsign":"FanControl", "locator":"/opt/thunder/libfancontrol.so", "classname":"FanControl", "configuration":{"deviceid":"/dev/ttyACM0"}}, + {"callsign":"DelayedResponse", "locator":"/opt/thunder/libdelayedresponse.so", "classname":"DelayedResponse", "configuration":{"minimum":0,"maximum":30}} + ] +} diff --git a/Source/WPEFramework/Controller.cpp b/Source/Thunder/Controller.cpp similarity index 99% rename from Source/WPEFramework/Controller.cpp rename to Source/Thunder/Controller.cpp index 2d105400d..db9fb0b32 100644 --- a/Source/WPEFramework/Controller.cpp +++ b/Source/Thunder/Controller.cpp @@ -22,7 +22,7 @@ #include -namespace WPEFramework { +namespace Thunder { namespace { diff --git a/Source/WPEFramework/Controller.h b/Source/Thunder/Controller.h similarity index 99% rename from Source/WPEFramework/Controller.h rename to Source/Thunder/Controller.h index 2f1b646d7..f6c19bf7e 100644 --- a/Source/WPEFramework/Controller.h +++ b/Source/Thunder/Controller.h @@ -29,7 +29,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Plugin { PUSH_WARNING(DISABLE_WARNING_DEPRECATED_USE) // for now we must support the deprecated interface for backwards compatibility reasons diff --git a/Source/WPEFramework/ControllerPlugin.json b/Source/Thunder/ControllerPlugin.json similarity index 100% rename from Source/WPEFramework/ControllerPlugin.json rename to Source/Thunder/ControllerPlugin.json diff --git a/Source/WPEFramework/ExampleConfigAll.json b/Source/Thunder/ExampleConfigAll.json similarity index 97% rename from Source/WPEFramework/ExampleConfigAll.json rename to Source/Thunder/ExampleConfigAll.json index a12807c15..be9bd47dd 100644 --- a/Source/WPEFramework/ExampleConfigAll.json +++ b/Source/Thunder/ExampleConfigAll.json @@ -3,8 +3,8 @@ "binding":"0.0.0.0", "idletime":180, "persistentpath":"/tmp", - "datapath":"/usr/share/wpeframework/", - "systempath":"/usr/lib/wpeframework/", + "datapath":"/usr/share/thunder/", + "systempath":"/usr/lib/thunder/", "webserver":"/boot/www", "plugins": [ diff --git a/Source/WPEFramework/ExampleConfigLinux.json b/Source/Thunder/ExampleConfigLinux.json similarity index 98% rename from Source/WPEFramework/ExampleConfigLinux.json rename to Source/Thunder/ExampleConfigLinux.json index 18c08834d..095b35d25 100644 --- a/Source/WPEFramework/ExampleConfigLinux.json +++ b/Source/Thunder/ExampleConfigLinux.json @@ -3,8 +3,8 @@ "binding":"0.0.0.0", "idletime":180, "persistentpath":"/tmp", - "datapath":"/usr/share/wpeframework/", - "systempath":"/usr/lib/wpeframework/", + "datapath":"/usr/share/thunder/", + "systempath":"/usr/lib/thunder/", "webserver":"/boot/www", "plugins": [ diff --git a/Source/WPEFramework/ExampleConfigWindows.json b/Source/Thunder/ExampleConfigWindows.json similarity index 100% rename from Source/WPEFramework/ExampleConfigWindows.json rename to Source/Thunder/ExampleConfigWindows.json diff --git a/Source/WPEFramework/GenericConfig.cmake b/Source/Thunder/GenericConfig.cmake similarity index 99% rename from Source/WPEFramework/GenericConfig.cmake rename to Source/Thunder/GenericConfig.cmake index 9e8b6892b..e0c1daa29 100644 --- a/Source/WPEFramework/GenericConfig.cmake +++ b/Source/Thunder/GenericConfig.cmake @@ -297,7 +297,7 @@ else() CUSTOM_PARAMS_WHITELIST "${CMAKE_CURRENT_LIST_DIR}/params.config" INSTALL_PATH "../${CMAKE_INSTALL_SYSCONFDIR}/${NAMESPACE}/" INSTALL_NAME "config.json" - PLUGINS "WPEFramework" + PLUGINS "Thunder" ) endif(CMAKE_VERSION VERSION_LESS 3.20.0 AND LEGACY_CONFIG_GENERATOR) diff --git a/Source/WPEFramework/IRemoteInstantiation.h b/Source/Thunder/IRemoteInstantiation.h similarity index 98% rename from Source/WPEFramework/IRemoteInstantiation.h rename to Source/Thunder/IRemoteInstantiation.h index d9ed3e06e..f3249295b 100644 --- a/Source/WPEFramework/IRemoteInstantiation.h +++ b/Source/Thunder/IRemoteInstantiation.h @@ -21,7 +21,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace PluginHost { struct IRemoteInstantiation : virtual public Core::IUnknown { diff --git a/Source/WPEFramework/Module.h b/Source/Thunder/Module.h similarity index 98% rename from Source/WPEFramework/Module.h rename to Source/Thunder/Module.h index e4e0a29e0..883c1412d 100644 --- a/Source/WPEFramework/Module.h +++ b/Source/Thunder/Module.h @@ -37,7 +37,7 @@ #define TREE_REFERENCE engineering_build_for_debug_purpose_only #endif -namespace WPEFramework { +namespace Thunder { namespace PluginHost { static constexpr uint8_t Major = 4; static constexpr uint8_t Minor = 0; diff --git a/Source/WPEFramework/PluginHost.cpp b/Source/Thunder/PluginHost.cpp similarity index 99% rename from Source/WPEFramework/PluginHost.cpp rename to Source/Thunder/PluginHost.cpp index 6ca04ffb4..76e4666f8 100644 --- a/Source/WPEFramework/PluginHost.cpp +++ b/Source/Thunder/PluginHost.cpp @@ -27,7 +27,7 @@ MODULE_NAME_DECLARATION(BUILD_REFERENCE) -namespace WPEFramework { +namespace Thunder { static PluginHost::Config* _config = nullptr; static PluginHost::Server* _dispatcher = nullptr; static bool _background = false; @@ -79,7 +79,7 @@ namespace PluginHost { } }; - class AdapterObserver : public WPEFramework::Core::AdapterObserver::INotification { + class AdapterObserver : public Thunder::Core::AdapterObserver::INotification { public: static int32_t constexpr WaitTime = 3000; //Just wait for 3 seconds @@ -165,7 +165,7 @@ POP_WARNING() static void StartShutdown() { _adminLock.Lock(); if ((_dispatcher != nullptr) && (_instance == nullptr)) { - _instance = new WPEFramework::PluginHost::ExitHandler(_dispatcher); + _instance = new Thunder::PluginHost::ExitHandler(_dispatcher); _dispatcher = nullptr; _instance->Run(); } diff --git a/Source/WPEFramework/PluginServer.cpp b/Source/Thunder/PluginServer.cpp similarity index 99% rename from Source/WPEFramework/PluginServer.cpp rename to Source/Thunder/PluginServer.cpp index 95b1f0597..8a82aa43a 100644 --- a/Source/WPEFramework/PluginServer.cpp +++ b/Source/Thunder/PluginServer.cpp @@ -32,7 +32,7 @@ #include "../extensions/hibernate/hibernate.h" #endif -namespace WPEFramework { +namespace Thunder { ENUM_CONVERSION_BEGIN(Core::ProcessInfo::scheduler) @@ -369,7 +369,7 @@ namespace PluginHost { _reason = why; State(PRECONDITION); - if (WPEFramework::Messaging::LocalLifetimeType::IsEnabled() == true) { + if (Thunder::Messaging::LocalLifetimeType::IsEnabled() == true) { string feedback; uint8_t index = 1; uint32_t delta(_precondition.Delta(_administrator.SubSystemInfo().Value())); diff --git a/Source/WPEFramework/PluginServer.h b/Source/Thunder/PluginServer.h similarity index 99% rename from Source/WPEFramework/PluginServer.h rename to Source/Thunder/PluginServer.h index e0ce2d268..73cbaf6f0 100644 --- a/Source/WPEFramework/PluginServer.h +++ b/Source/Thunder/PluginServer.h @@ -37,7 +37,7 @@ #define MAX_EXTERNAL_WAITS 2000 /* Wait for 2 Seconds */ -namespace WPEFramework { +namespace Thunder { namespace Core { namespace System { diff --git a/Source/WPEFramework/PostMortem.cpp b/Source/Thunder/PostMortem.cpp similarity index 96% rename from Source/WPEFramework/PostMortem.cpp rename to Source/Thunder/PostMortem.cpp index 288dd233b..8378247a4 100644 --- a/Source/WPEFramework/PostMortem.cpp +++ b/Source/Thunder/PostMortem.cpp @@ -19,7 +19,7 @@ #include "PluginServer.h" -namespace WPEFramework { +namespace Thunder { namespace PluginHost { @@ -43,4 +43,4 @@ namespace PluginHost { } } -} } // WPEFramework::PluginHost +} } // Thunder::PluginHost diff --git a/Source/WPEFramework/PostMortem.h b/Source/Thunder/PostMortem.h similarity index 99% rename from Source/WPEFramework/PostMortem.h rename to Source/Thunder/PostMortem.h index 7c9fed9c7..02d8d6c32 100644 --- a/Source/WPEFramework/PostMortem.h +++ b/Source/Thunder/PostMortem.h @@ -21,7 +21,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace PluginHost { class CallstackData : public Core::JSON::Container { diff --git a/Source/WPEFramework/Probe.cpp b/Source/Thunder/Probe.cpp similarity index 99% rename from Source/WPEFramework/Probe.cpp rename to Source/Thunder/Probe.cpp index a5bdb9a55..18bfa149d 100644 --- a/Source/WPEFramework/Probe.cpp +++ b/Source/Thunder/Probe.cpp @@ -19,7 +19,7 @@ #include "Probe.h" -namespace WPEFramework { +namespace Thunder { namespace Plugin { /* static */ const string Probe::SearchTarget(_T("urn:metrological-com:service:wpe:1")); diff --git a/Source/WPEFramework/Probe.h b/Source/Thunder/Probe.h similarity index 99% rename from Source/WPEFramework/Probe.h rename to Source/Thunder/Probe.h index 7a11afb70..8b7707876 100644 --- a/Source/WPEFramework/Probe.h +++ b/Source/Thunder/Probe.h @@ -25,7 +25,7 @@ #include #endif -namespace WPEFramework { +namespace Thunder { namespace Plugin { class Probe { diff --git a/Source/WPEFramework/SystemInfo.cpp b/Source/Thunder/SystemInfo.cpp similarity index 99% rename from Source/WPEFramework/SystemInfo.cpp rename to Source/Thunder/SystemInfo.cpp index bd6203d0e..3541436d8 100644 --- a/Source/WPEFramework/SystemInfo.cpp +++ b/Source/Thunder/SystemInfo.cpp @@ -18,7 +18,7 @@ */ #include "SystemInfo.h" -namespace WPEFramework { +namespace Thunder { namespace PluginHost { PUSH_WARNING(DISABLE_WARNING_THIS_IN_MEMBER_INITIALIZER_LIST) @@ -275,4 +275,4 @@ POP_WARNING() } } //namspace Plugin -} // namespace WPEFramework +} // namespace Thunder diff --git a/Source/WPEFramework/SystemInfo.h b/Source/Thunder/SystemInfo.h similarity index 99% rename from Source/WPEFramework/SystemInfo.h rename to Source/Thunder/SystemInfo.h index d63bbe10e..74020f739 100644 --- a/Source/WPEFramework/SystemInfo.h +++ b/Source/Thunder/SystemInfo.h @@ -23,7 +23,7 @@ #include "Module.h" #include "Config.h" -namespace WPEFramework { +namespace Thunder { namespace PluginHost { class SystemInfo : public PluginHost::ISubSystem { diff --git a/Source/WPEFramework/WPEFramework.conf.in b/Source/Thunder/Thunder.conf.in similarity index 100% rename from Source/WPEFramework/WPEFramework.conf.in rename to Source/Thunder/Thunder.conf.in diff --git a/Source/WPEFramework/WarningReportingCategories.cpp b/Source/Thunder/WarningReportingCategories.cpp similarity index 98% rename from Source/WPEFramework/WarningReportingCategories.cpp rename to Source/Thunder/WarningReportingCategories.cpp index 4af47f96c..8cf9c301f 100644 --- a/Source/WPEFramework/WarningReportingCategories.cpp +++ b/Source/Thunder/WarningReportingCategories.cpp @@ -20,7 +20,7 @@ #include "Module.h" #include "WarningReportingCategories.h" -namespace WPEFramework { +namespace Thunder { namespace WarningReporting { diff --git a/Source/WPEFramework/WarningReportingCategories.h b/Source/Thunder/WarningReportingCategories.h similarity index 99% rename from Source/WPEFramework/WarningReportingCategories.h rename to Source/Thunder/WarningReportingCategories.h index a79e4e312..de94cae34 100644 --- a/Source/WPEFramework/WarningReportingCategories.h +++ b/Source/Thunder/WarningReportingCategories.h @@ -21,7 +21,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace WarningReporting { class EXTERNAL TooLongPluginState { diff --git a/Source/WPEFramework/bridge.vcxproj b/Source/Thunder/bridge.vcxproj similarity index 100% rename from Source/WPEFramework/bridge.vcxproj rename to Source/Thunder/bridge.vcxproj diff --git a/Source/WPEFramework/bridge.vcxproj.filters b/Source/Thunder/bridge.vcxproj.filters similarity index 100% rename from Source/WPEFramework/bridge.vcxproj.filters rename to Source/Thunder/bridge.vcxproj.filters diff --git a/Source/WPEFramework/doc/ControllerPlugin.md b/Source/Thunder/doc/ControllerPlugin.md similarity index 99% rename from Source/WPEFramework/doc/ControllerPlugin.md rename to Source/Thunder/doc/ControllerPlugin.md index 09cad1ebf..a35a1a338 100644 --- a/Source/WPEFramework/doc/ControllerPlugin.md +++ b/Source/Thunder/doc/ControllerPlugin.md @@ -58,7 +58,7 @@ The table below provides and overview of terms and abbreviations used in this do | [HTTP](http://www.w3.org/Protocols) | HTTP specification | | [JSON-RPC](https://www.jsonrpc.org/specification) | JSON-RPC 2.0 specification | | [JSON](http://www.json.org/) | JSON specification | -| [Thunder](https://github.com/WebPlatformForEmbedded/Thunder/blob/master/doc/WPE%20-%20API%20-%20WPEFramework.docx) | Thunder API Reference | +| [Thunder](https://github.com/WebPlatformForEmbedded/Thunder/blob/master/doc/WPE%20-%20API%20-%20Thunder.docx) | Thunder API Reference | # Configuration diff --git a/Source/WPEFramework/params.config b/Source/Thunder/params.config similarity index 100% rename from Source/WPEFramework/params.config rename to Source/Thunder/params.config diff --git a/Source/WPEFramework/scripts/CMakeLists.txt b/Source/Thunder/scripts/CMakeLists.txt similarity index 72% rename from Source/WPEFramework/scripts/CMakeLists.txt rename to Source/Thunder/scripts/CMakeLists.txt index 01bf29c13..b43457529 100644 --- a/Source/WPEFramework/scripts/CMakeLists.txt +++ b/Source/Thunder/scripts/CMakeLists.txt @@ -19,29 +19,29 @@ set(SYSTEMD_SERVICE "false" CACHE STRING "Select systemd service scripts, by def set(SYSTEM_ROOT_PATH "root" CACHE STRING "System root directory location") if (SYSTEMD_SERVICE) - file(READ wpeframework.service.in WPEFRAMEWORK_SYSTEMD_SERVICE) + file(READ thunder.service.in THUNDER_SYSTEMD_SERVICE) string( REGEX REPLACE "EXTRA_DEPENDS" "${SYSTEMD_EXTRA_DEPENDS}" - MOD_WPEFRAMEWORK_SYSTEMD_SERVICE "${WPEFRAMEWORK_SYSTEMD_SERVICE}" + MOD_THUNDER_SYSTEMD_SERVICE "${THUNDER_SYSTEMD_SERVICE}" ) - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/wpeframework.service "${MOD_WPEFRAMEWORK_SYSTEMD_SERVICE}") + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/thunder.service "${MOD_THUNDER_SYSTEMD_SERVICE}") install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/../${CMAKE_INSTALL_LIBDIR}) install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/wpeframework.service + FILES ${CMAKE_CURRENT_BINARY_DIR}/thunder.service PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ DESTINATION ${CMAKE_INSTALL_PREFIX}/../${SYSTEMD_INSTALL_PATH}/system/ ) else() - file(READ wpeframework.in WPEFRAMEWORK_INITD) + file(READ thunder.in THUNDER_INITD) string( REGEX REPLACE "ROOT_PATH" "${SYSTEM_ROOT_PATH}/${NAMESPACE}" - MOD_WPEFRAMEWORK_INITD "${WPEFRAMEWORK_INITD}" + MOD_THUNDER_INITD "${THUNDER_INITD}" ) - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/wpeframework "${MOD_WPEFRAMEWORK_INITD}") + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/thunder "${MOD_THUNDER_INITD}") install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/wpeframework + FILES ${CMAKE_CURRENT_BINARY_DIR}/thunder PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ DESTINATION ../${CMAKE_INSTALL_SYSCONFDIR}/init.d/ ) diff --git a/Source/WPEFramework/scripts/wpeframework.in b/Source/Thunder/scripts/thunder.in similarity index 74% rename from Source/WPEFramework/scripts/wpeframework.in rename to Source/Thunder/scripts/thunder.in index ef9101d78..c596f5a8c 100755 --- a/Source/WPEFramework/scripts/wpeframework.in +++ b/Source/Thunder/scripts/thunder.in @@ -16,15 +16,15 @@ start() { # needed for wayland/westeros/weston export XDG_RUNTIME_DIR=/tmp - echo -n "Starting WPEFramework: " - start-stop-daemon -S -q -b -m -p /var/run/WPEFramework.pid --exec /usr/bin/WPEFramework -- -b /dev/null 2>&1 + echo -n "Starting Thunder: " + start-stop-daemon -S -q -b -m -p /var/run/Thunder.pid --exec /usr/bin/Thunder -- -b /dev/null 2>&1 [ $? == 0 ] && echo "OK" || echo "FAIL" } stop() { - echo -n "Stopping WPEFramework: " - start-stop-daemon -K -q -p /var/run/WPEFramework.pid + echo -n "Stopping Thunder: " + start-stop-daemon -K -q -p /var/run/Thunder.pid [ $? == 0 ] && echo "OK" || echo "FAIL" - rm -rf /var/run/WPEFramework.pid + rm -rf /var/run/Thunder.pid } restart() { stop diff --git a/Source/WPEFramework/scripts/wpeframework.service.in b/Source/Thunder/scripts/thunder.service.in similarity index 60% rename from Source/WPEFramework/scripts/wpeframework.service.in rename to Source/Thunder/scripts/thunder.service.in index ac897e07d..3ac3fa423 100755 --- a/Source/WPEFramework/scripts/wpeframework.service.in +++ b/Source/Thunder/scripts/thunder.service.in @@ -1,14 +1,14 @@ [Unit] -Description=wpeframework +Description=thunder Wants=multi-user.target After=multi-user.target EXTRA_DEPENDS [Service] -PIDFile=/var/run/WPEFramework.pid -EnvironmentFile=-/etc/wpeframework/WPEFramework.env +PIDFile=/var/run/Thunder.pid +EnvironmentFile=-/etc/thunder/Thunder.env Environment="WAYLAND_DISPLAY=wayland-0" Environment="XDG_RUNTIME_DIR=/run" -ExecStart=-/usr/bin/WPEFramework -b +ExecStart=-/usr/bin/Thunder -b ExecStop=/bin/kill $MAINPID [Install] diff --git a/Source/WPEProcess/CMakeLists.txt b/Source/ThunderPlugin/CMakeLists.txt similarity index 100% rename from Source/WPEProcess/CMakeLists.txt rename to Source/ThunderPlugin/CMakeLists.txt diff --git a/Source/WPEProcess/Module.h b/Source/ThunderPlugin/Module.h similarity index 100% rename from Source/WPEProcess/Module.h rename to Source/ThunderPlugin/Module.h diff --git a/Source/WPEProcess/Process.cpp b/Source/ThunderPlugin/Process.cpp similarity index 99% rename from Source/WPEProcess/Process.cpp rename to Source/ThunderPlugin/Process.cpp index d0b2b1194..3bff387ab 100644 --- a/Source/WPEProcess/Process.cpp +++ b/Source/ThunderPlugin/Process.cpp @@ -9,7 +9,7 @@ MODULE_NAME_DECLARATION(BUILD_REFERENCE) -namespace WPEFramework { +namespace Thunder { static string _background = _T("false"); namespace Process { @@ -533,9 +533,9 @@ class ProcessFlow { } // Process -} // WPEFramework +} // Thunder -using namespace WPEFramework; +using namespace Thunder; #ifdef __WINDOWS__ int _tmain(int argc, _TCHAR* argv[]) diff --git a/Source/WPEProcess/comprocess.vcxproj b/Source/ThunderPlugin/comprocess.vcxproj similarity index 100% rename from Source/WPEProcess/comprocess.vcxproj rename to Source/ThunderPlugin/comprocess.vcxproj diff --git a/Source/WPEProcess/comprocess.vcxproj.filters b/Source/ThunderPlugin/comprocess.vcxproj.filters similarity index 100% rename from Source/WPEProcess/comprocess.vcxproj.filters rename to Source/ThunderPlugin/comprocess.vcxproj.filters diff --git a/Source/WPEFramework/ConfigBuildroot.json b/Source/WPEFramework/ConfigBuildroot.json deleted file mode 100644 index 83b8362ee..000000000 --- a/Source/WPEFramework/ConfigBuildroot.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "port":9888, - "binding":"0.0.0.0", - "idletime":180, - "persistentpath":"/tmp", - "datapath":"/opt/wpeframework/Plugins/", - "plugins": - [ - {"callsign":"Tracing","locator":"/opt/wpeframework/libtracecontrol.so", "classname":"TraceControl", "configuration":{"console":true,"remote":{"port":4444,"binding":"0.0.0.0"}}}, - {"callsign":"FanControl", "locator":"/opt/wpeframework/libfancontrol.so", "classname":"FanControl", "configuration":{"deviceid":"/dev/ttyACM0"}}, - {"callsign":"DelayedResponse", "locator":"/opt/wpeframework/libdelayedresponse.so", "classname":"DelayedResponse", "configuration":{"minimum":0,"maximum":30}} - ] -} diff --git a/Source/com/Administrator.cpp b/Source/com/Administrator.cpp index 035f441cb..df630928e 100644 --- a/Source/com/Administrator.cpp +++ b/Source/com/Administrator.cpp @@ -20,7 +20,7 @@ #include "Administrator.h" #include "IUnknown.h" -namespace WPEFramework { +namespace Thunder { namespace RPC { Administrator::Administrator() diff --git a/Source/com/Administrator.h b/Source/com/Administrator.h index c279b2eb0..58d590b3f 100644 --- a/Source/com/Administrator.h +++ b/Source/com/Administrator.h @@ -23,7 +23,7 @@ #include "Messages.h" #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace ProxyStub { diff --git a/Source/com/CMakeLists.txt b/Source/com/CMakeLists.txt index 337670dc9..1ab21951e 100644 --- a/Source/com/CMakeLists.txt +++ b/Source/com/CMakeLists.txt @@ -17,7 +17,7 @@ set(TARGET ${NAMESPACE}COM) -ProxyStubGenerator(NAMESPACE "WPEFramework::RPC" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/ICOM.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") +ProxyStubGenerator(NAMESPACE "Thunder::RPC" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/ICOM.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") add_library(${TARGET} Module.cpp diff --git a/Source/com/Communicator.cpp b/Source/com/Communicator.cpp index b34610995..1429d7f62 100644 --- a/Source/com/Communicator.cpp +++ b/Source/com/Communicator.cpp @@ -26,7 +26,7 @@ #include "ProcessInfo.h" #endif -namespace WPEFramework { +namespace Thunder { namespace RPC { class ProcessShutdown; diff --git a/Source/com/Communicator.h b/Source/com/Communicator.h index dd2a8647f..d8f9ceae8 100644 --- a/Source/com/Communicator.h +++ b/Source/com/Communicator.h @@ -40,7 +40,7 @@ #include "../warningreporting/WarningReportingUnit.h" #endif -namespace WPEFramework { +namespace Thunder { namespace RPC { class EXTERNAL Object { @@ -1679,7 +1679,7 @@ POP_WARNING() return (result); } - // Open and offer the requested interface (Applicable if the WPEProcess starts the RPCClient) + // Open and offer the requested interface (Applicable if the ThunderPlugin starts the RPCClient) uint32_t Open(const uint32_t waitTime, const uint32_t interfaceId, void* implementation, const uint32_t exchangeId); template diff --git a/Source/com/ConnectorType.cpp b/Source/com/ConnectorType.cpp index ce7e7fdc3..a6dac0e62 100644 --- a/Source/com/ConnectorType.cpp +++ b/Source/com/ConnectorType.cpp @@ -18,7 +18,7 @@ */ #include "ConnectorType.h" -namespace WPEFramework { +namespace Thunder { namespace RPC { diff --git a/Source/com/ConnectorType.h b/Source/com/ConnectorType.h index d2939a2c8..cfc25b809 100644 --- a/Source/com/ConnectorType.h +++ b/Source/com/ConnectorType.h @@ -21,16 +21,16 @@ #include "Module.h" #include "Communicator.h" -namespace WPEFramework { +namespace Thunder { namespace RPC { EXTERNAL Core::ProxyType DefaultInvokeServer(); EXTERNAL Core::ProxyType WorkerPoolInvokeServer(); // This class is not thread safe. It is assumed that the Controller IUnknown - // is always set prior to any retrieval (WPEFramework/WPEProcess startup) and + // is always set prior to any retrieval (Thunder/ThunderPlugin startup) and // the interface is only revoked at process hsutdown, after shutting down all - // the other class (shutdown of WPEFrmaework or WPEProcess. So no need to + // the other class (shutdown of Thunder or ThunderPlugin. So no need to // lock the access to the _controller member variable. class EXTERNAL ConnectorController { private: @@ -158,4 +158,4 @@ namespace RPC { }; } // namespace RPC -} // namespace WPEFramework +} // namespace Thunder diff --git a/Source/com/ICOM.h b/Source/com/ICOM.h index d9312e646..5d58f1cc7 100644 --- a/Source/com/ICOM.h +++ b/Source/com/ICOM.h @@ -24,7 +24,7 @@ // @stubgen:include "IIteratorType.h" -namespace WPEFramework { +namespace Thunder { namespace RPC { struct EXTERNAL IRemoteConnection : virtual public Core::IUnknown { diff --git a/Source/com/IIteratorType.h b/Source/com/IIteratorType.h index 5e6fdd478..ab6b18450 100644 --- a/Source/com/IIteratorType.h +++ b/Source/com/IIteratorType.h @@ -20,7 +20,7 @@ #pragma once #include -namespace WPEFramework { +namespace Thunder { namespace RPC { diff --git a/Source/com/IStringIterator.h b/Source/com/IStringIterator.h index 64d24922c..321890d1d 100644 --- a/Source/com/IStringIterator.h +++ b/Source/com/IStringIterator.h @@ -25,7 +25,7 @@ #include "Module.h" #include "ICOM.h" -namespace WPEFramework { +namespace Thunder { namespace RPC { typedef IteratorType StringIterator; diff --git a/Source/com/IUnknown.cpp b/Source/com/IUnknown.cpp index eba11e909..bb09281af 100644 --- a/Source/com/IUnknown.cpp +++ b/Source/com/IUnknown.cpp @@ -21,7 +21,7 @@ #include "Administrator.h" #include "Communicator.h" -namespace WPEFramework { +namespace Thunder { namespace ProxyStub { // ------------------------------------------------------------------------------------------- // STUB diff --git a/Source/com/IUnknown.h b/Source/com/IUnknown.h index 9d79e2a1e..89fc25d31 100644 --- a/Source/com/IUnknown.h +++ b/Source/com/IUnknown.h @@ -25,7 +25,7 @@ #include "Administrator.h" #include "Messages.h" -namespace WPEFramework { +namespace Thunder { namespace RPC { class Communicator; diff --git a/Source/com/IValueIterator.h b/Source/com/IValueIterator.h index 188553fa7..33f97fc93 100644 --- a/Source/com/IValueIterator.h +++ b/Source/com/IValueIterator.h @@ -25,7 +25,7 @@ #include "Module.h" #include "ICOM.h" -namespace WPEFramework { +namespace Thunder { namespace RPC { typedef IteratorType ValueIterator; diff --git a/Source/com/Ids.h b/Source/com/Ids.h index 4bf0ae7e7..9c387bdbb 100644 --- a/Source/com/Ids.h +++ b/Source/com/Ids.h @@ -21,7 +21,7 @@ #include -namespace WPEFramework { +namespace Thunder { namespace RPC { enum IDS { diff --git a/Source/com/IteratorType.h b/Source/com/IteratorType.h index 175ba8fd9..2e77b7bfc 100644 --- a/Source/com/IteratorType.h +++ b/Source/com/IteratorType.h @@ -20,7 +20,7 @@ #pragma once -namespace WPEFramework { +namespace Thunder { namespace RPC { diff --git a/Source/com/Messages.h b/Source/com/Messages.h index 65b5be29c..8263c2cc2 100644 --- a/Source/com/Messages.h +++ b/Source/com/Messages.h @@ -21,7 +21,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace RPC { // As COMRPC might run between a 32 bit and 64 bit system, the largest must be accommodated. diff --git a/Source/com/com.vcxproj b/Source/com/com.vcxproj index 6773e9338..a20a48959 100644 --- a/Source/com/com.vcxproj +++ b/Source/com/com.vcxproj @@ -137,7 +137,7 @@ $(IntDir)$(TargetName).pdb - python "$(ToolPath)\ProxyStubGenerator\StubGenerator.py" --namespace WPEFramework::RPC --outdir "$(ProjectDir)generated/" "$(ProjectDir)ICOM.h" + python "$(ToolPath)\ProxyStubGenerator\StubGenerator.py" --namespace Thunder::RPC --outdir "$(ProjectDir)generated/" "$(ProjectDir)ICOM.h" @@ -158,7 +158,7 @@ $(IntDir)$(TargetName).pdb - python "$(ToolPath)\ProxyStubGenerator\StubGenerator.py" --namespace WPEFramework::RPC --outdir "$(ProjectDir)generated/" "$(ProjectDir)ICOM.h" + python "$(ToolPath)\ProxyStubGenerator\StubGenerator.py" --namespace Thunder::RPC --outdir "$(ProjectDir)generated/" "$(ProjectDir)ICOM.h" @@ -179,7 +179,7 @@ $(IntDir)$(TargetName).pdb - python "$(ToolPath)\ProxyStubGenerator\StubGenerator.py" --namespace WPEFramework::RPC --outdir "$(ProjectDir)generated/" "$(ProjectDir)ICOM.h" + python "$(ToolPath)\ProxyStubGenerator\StubGenerator.py" --namespace Thunder::RPC --outdir "$(ProjectDir)generated/" "$(ProjectDir)ICOM.h" @@ -204,7 +204,7 @@ $(IntDir)$(TargetName).pdb - python "$(ToolPath)\ProxyStubGenerator\StubGenerator.py" --namespace WPEFramework::RPC --outdir "$(ProjectDir)generated/" "$(ProjectDir)ICOM.h" + python "$(ToolPath)\ProxyStubGenerator\StubGenerator.py" --namespace Thunder::RPC --outdir "$(ProjectDir)generated/" "$(ProjectDir)ICOM.h" diff --git a/Source/core/ASN1.h b/Source/core/ASN1.h index f67a5db50..c78bf7331 100644 --- a/Source/core/ASN1.h +++ b/Source/core/ASN1.h @@ -31,7 +31,7 @@ // ---- Helper types and constants ---- // ---- Helper functions ---- -namespace WPEFramework { +namespace Thunder { namespace Core { namespace ASN1 { diff --git a/Source/core/AccessControl.h b/Source/core/AccessControl.h index 42333a1a1..71d40acdf 100644 --- a/Source/core/AccessControl.h +++ b/Source/core/AccessControl.h @@ -28,7 +28,7 @@ #include #endif -namespace WPEFramework { +namespace Thunder { namespace Core { struct AccessControl { diff --git a/Source/core/CallsignTLS.cpp b/Source/core/CallsignTLS.cpp index baac18ed7..f9d4d8222 100644 --- a/Source/core/CallsignTLS.cpp +++ b/Source/core/CallsignTLS.cpp @@ -22,7 +22,7 @@ #if defined(__CORE_WARNING_REPORTING__) || defined(__CORE_EXCEPTION_CATCHING__) -namespace WPEFramework { +namespace Thunder { namespace Core { const TCHAR* CallsignTLS::Callsign() { diff --git a/Source/core/CallsignTLS.h b/Source/core/CallsignTLS.h index 7df46bbd6..c5e0b879e 100644 --- a/Source/core/CallsignTLS.h +++ b/Source/core/CallsignTLS.h @@ -30,12 +30,12 @@ #else #define WARNING_REPORTING_THREAD_SETCALLSIGN_GUARD(CALLSIGN) \ - WPEFramework::Core::CallsignTLS::CallSignTLSGuard callsignguard(CALLSIGN); + Thunder::Core::CallsignTLS::CallSignTLSGuard callsignguard(CALLSIGN); #define WARNING_REPORTING_THREAD_SETCALLSIGN(CALLSIGN) \ - WPEFramework::Core::CallsignTLS::Callsign(CALLSIGN); + Thunder::Core::CallsignTLS::Callsign(CALLSIGN); -namespace WPEFramework { +namespace Thunder { namespace Core { diff --git a/Source/core/CyclicBuffer.cpp b/Source/core/CyclicBuffer.cpp index b597beb30..9ba5c58d7 100644 --- a/Source/core/CyclicBuffer.cpp +++ b/Source/core/CyclicBuffer.cpp @@ -20,7 +20,7 @@ #include "CyclicBuffer.h" #include "ProcessInfo.h" -namespace WPEFramework { +namespace Thunder { namespace Core { namespace { @@ -697,4 +697,4 @@ namespace Core { return cursor.Size(); } } -} // namespace WPEFramework::Core +} // namespace Thunder::Core diff --git a/Source/core/CyclicBuffer.h b/Source/core/CyclicBuffer.h index 724f32957..187d88c70 100644 --- a/Source/core/CyclicBuffer.h +++ b/Source/core/CyclicBuffer.h @@ -34,7 +34,7 @@ // ---- Helper types and constants ---- -namespace WPEFramework { +namespace Thunder { namespace Core { // Rationale: diff --git a/Source/core/DataBuffer.h b/Source/core/DataBuffer.h index 535739d70..880e29a94 100644 --- a/Source/core/DataBuffer.h +++ b/Source/core/DataBuffer.h @@ -26,7 +26,7 @@ #include "Portability.h" #include "Proxy.h" -namespace WPEFramework { +namespace Thunder { namespace Core { // ---- Referenced classes and types ---- @@ -57,6 +57,6 @@ namespace WPEFramework { uint8_t m_Buffer[BLOCKSIZE]; }; } // namespace Core -} //namespace WPEFramework +} //namespace Thunder #endif // __DATABUFFER_H diff --git a/Source/core/DataElement.cpp b/Source/core/DataElement.cpp index 8838693da..70acfc8b4 100644 --- a/Source/core/DataElement.cpp +++ b/Source/core/DataElement.cpp @@ -19,7 +19,7 @@ #include "DataElement.h" -namespace WPEFramework { +namespace Thunder { namespace Core { // CRC32 lookup table for polynomial 0x04c11db7 diff --git a/Source/core/DataElement.h b/Source/core/DataElement.h index f5a866227..0db0074b6 100644 --- a/Source/core/DataElement.h +++ b/Source/core/DataElement.h @@ -28,7 +28,7 @@ #include "Proxy.h" #include "Serialization.h" -namespace WPEFramework { +namespace Thunder { namespace Core { // ---- Referenced classes and types ---- diff --git a/Source/core/DataElementFile.cpp b/Source/core/DataElementFile.cpp index bf93fe72a..e7734fd6c 100644 --- a/Source/core/DataElementFile.cpp +++ b/Source/core/DataElementFile.cpp @@ -32,7 +32,7 @@ #include #endif -namespace WPEFramework { +namespace Thunder { namespace Core { DataElementFile::DataElementFile(File& file, const uint32_t type) : DataElement() diff --git a/Source/core/DataElementFile.h b/Source/core/DataElementFile.h index 8ef48c068..91ec9e9bd 100644 --- a/Source/core/DataElementFile.h +++ b/Source/core/DataElementFile.h @@ -37,7 +37,7 @@ // ---- Helper functions ---- // ---- Class Definition ---- -namespace WPEFramework { +namespace Thunder { namespace Core { // The datapackage is the abstract of a package that needs to be send over the line. class EXTERNAL DataElementFile : public DataElement { diff --git a/Source/core/DoorBell.cpp b/Source/core/DoorBell.cpp index 3d95e8495..7729a1618 100644 --- a/Source/core/DoorBell.cpp +++ b/Source/core/DoorBell.cpp @@ -28,7 +28,7 @@ #define __ERRORRESULT__ errno #endif -namespace WPEFramework { +namespace Thunder { namespace Core { diff --git a/Source/core/DoorBell.h b/Source/core/DoorBell.h index 1ac40de66..c7815f6b2 100644 --- a/Source/core/DoorBell.h +++ b/Source/core/DoorBell.h @@ -24,7 +24,7 @@ #include "SocketPort.h" #include "Sync.h" -namespace WPEFramework { +namespace Thunder { namespace Core { class EXTERNAL DoorBell { diff --git a/Source/core/Enumerate.h b/Source/core/Enumerate.h index 5cb819ebe..ac2ac54bf 100644 --- a/Source/core/Enumerate.h +++ b/Source/core/Enumerate.h @@ -29,7 +29,7 @@ #include "Portability.h" #include "TextFragment.h" -namespace WPEFramework { +namespace Thunder { namespace Core { // ---- Referenced classes and types ---- @@ -42,7 +42,7 @@ namespace Core { template<> EXTERNAL const typename Core::EnumerateConversion \ EXTERNAL const Core::EnumerateConversion* EnumerateType::Table(const uint16_t index) \ { \ - static WPEFramework::Core::EnumerateConversion table[] = { + static Thunder::Core::EnumerateConversion table[] = { #define ENUM_CONVERSION_END(ENUMERATE) \ { \ @@ -50,7 +50,7 @@ namespace Core { template<> EXTERNAL const typename Core::EnumerateConversion)) - 1) ? &table[index] : nullptr); \ + return (index < ((sizeof(table) / sizeof(Thunder::Core::EnumerateConversion)) - 1) ? &table[index] : nullptr); \ } \ } diff --git a/Source/core/Factory.h b/Source/core/Factory.h index 780564c61..bd17176ea 100644 --- a/Source/core/Factory.h +++ b/Source/core/Factory.h @@ -25,7 +25,7 @@ #include "Portability.h" #include "Proxy.h" -namespace WPEFramework { +namespace Thunder { namespace Core { template class FactoryType { diff --git a/Source/core/FileObserver.h b/Source/core/FileObserver.h index 5789fa56d..db22c7fac 100644 --- a/Source/core/FileObserver.h +++ b/Source/core/FileObserver.h @@ -25,7 +25,7 @@ #include "Thread.h" #include "FileSystem.h" -namespace WPEFramework { +namespace Thunder { namespace Core { #ifdef __LINUX__ @@ -551,4 +551,4 @@ class FileSystemMonitor { #endif } // namespace Core -} // namespace WPEFramework +} // namespace Thunder diff --git a/Source/core/FileSystem.cpp b/Source/core/FileSystem.cpp index 1d54c7182..e233ffbc0 100644 --- a/Source/core/FileSystem.cpp +++ b/Source/core/FileSystem.cpp @@ -20,7 +20,7 @@ #include "AccessControl.h" #include "FileSystem.h" -namespace WPEFramework { +namespace Thunder { namespace Core { File::File() diff --git a/Source/core/FileSystem.h b/Source/core/FileSystem.h index a29f1c17f..0ca1fcbdc 100644 --- a/Source/core/FileSystem.h +++ b/Source/core/FileSystem.h @@ -34,7 +34,7 @@ #endif #endif -namespace WPEFramework { +namespace Thunder { namespace Core { PUSH_WARNING(DISABLE_WARNING_UNUSED_FUNCTIONS) diff --git a/Source/core/Frame.h b/Source/core/Frame.h index c1e97c66e..1795c9f28 100644 --- a/Source/core/Frame.h +++ b/Source/core/Frame.h @@ -22,7 +22,7 @@ #include "Module.h" #include "Serialization.h" -namespace WPEFramework { +namespace Thunder { namespace Core { namespace Frame { diff --git a/Source/core/IAction.h b/Source/core/IAction.h index c76026213..aaf7975c3 100644 --- a/Source/core/IAction.h +++ b/Source/core/IAction.h @@ -24,7 +24,7 @@ #include "Trace.h" #include "TextFragment.h" -namespace WPEFramework { +namespace Thunder { namespace Core { template struct IDispatchType { diff --git a/Source/core/IIterator.h b/Source/core/IIterator.h index 2764c98cf..561085cd1 100644 --- a/Source/core/IIterator.h +++ b/Source/core/IIterator.h @@ -26,7 +26,7 @@ #include -namespace WPEFramework { +namespace Thunder { namespace Core { struct IIterator { virtual ~IIterator() = default; diff --git a/Source/core/IObserver.h b/Source/core/IObserver.h index 6a3b098c1..926d1f624 100644 --- a/Source/core/IObserver.h +++ b/Source/core/IObserver.h @@ -23,7 +23,7 @@ #include "Module.h" #include "Portability.h" -namespace WPEFramework { +namespace Thunder { namespace Core { template struct IObserverType { diff --git a/Source/core/IPCChannel.h b/Source/core/IPCChannel.h index 9e058b40a..e948cdc65 100644 --- a/Source/core/IPCChannel.h +++ b/Source/core/IPCChannel.h @@ -30,7 +30,7 @@ #include "Trace.h" #include "TypeTraits.h" -namespace WPEFramework { +namespace Thunder { namespace Core { template diff --git a/Source/core/IPCConnector.h b/Source/core/IPCConnector.h index bd36d84ed..73c2ace83 100644 --- a/Source/core/IPCConnector.h +++ b/Source/core/IPCConnector.h @@ -28,7 +28,7 @@ #include "SocketPort.h" #include "TypeTraits.h" -namespace WPEFramework { +namespace Thunder { namespace Core { diff --git a/Source/core/IPCMessage.h b/Source/core/IPCMessage.h index 1d6e9a101..3c656c160 100644 --- a/Source/core/IPCMessage.h +++ b/Source/core/IPCMessage.h @@ -23,7 +23,7 @@ #include "Portability.h" #include "Frame.h" -namespace WPEFramework { +namespace Thunder { namespace Core { diff --git a/Source/core/IPFrame.h b/Source/core/IPFrame.h index 46b4cd8d5..713c8f785 100644 --- a/Source/core/IPFrame.h +++ b/Source/core/IPFrame.h @@ -32,7 +32,7 @@ using ip = iphdr; #include #endif -namespace WPEFramework { +namespace Thunder { namespace Core { @@ -475,4 +475,4 @@ namespace Core { } }; -} } // namespace WPEFramework::Core +} } // namespace Thunder::Core diff --git a/Source/core/ISO639.cpp b/Source/core/ISO639.cpp index 4a20f2099..15f7bdcd8 100644 --- a/Source/core/ISO639.cpp +++ b/Source/core/ISO639.cpp @@ -19,7 +19,7 @@ #include "ISO639.h" -namespace WPEFramework { +namespace Thunder { namespace Core { static struct ISO639Entry g_ISO639Lookup[] = { diff --git a/Source/core/ISO639.h b/Source/core/ISO639.h index 8a715dc4d..cf632119e 100644 --- a/Source/core/ISO639.h +++ b/Source/core/ISO639.h @@ -24,7 +24,7 @@ #include "Portability.h" #include "Trace.h" -namespace WPEFramework { +namespace Thunder { namespace Core { struct ISO639Entry { diff --git a/Source/core/IWarningReportingControl.h b/Source/core/IWarningReportingControl.h index c3e75e623..808bd27b2 100644 --- a/Source/core/IWarningReportingControl.h +++ b/Source/core/IWarningReportingControl.h @@ -22,7 +22,7 @@ #include "Module.h" #include "MessageStore.h" -namespace WPEFramework { +namespace Thunder { namespace WarningReporting { diff --git a/Source/core/JSON.cpp b/Source/core/JSON.cpp index 0efaa7eb7..469ba9050 100644 --- a/Source/core/JSON.cpp +++ b/Source/core/JSON.cpp @@ -21,7 +21,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Core { namespace JSON { diff --git a/Source/core/JSON.h b/Source/core/JSON.h index aca7e9f5e..eb8dd51d7 100644 --- a/Source/core/JSON.h +++ b/Source/core/JSON.h @@ -32,7 +32,7 @@ #include "TextFragment.h" #include "TypeTraits.h" -namespace WPEFramework { +namespace Thunder { namespace Core { @@ -4379,7 +4379,7 @@ namespace Core { class EXTERNAL VariantContainer : public Container { private: - using Elements = std::unordered_map; + using Elements = std::unordered_map; public: class Iterator { @@ -4887,10 +4887,10 @@ namespace Core { } // namespace JSON } // namespace Core -} // namespace WPEFramework +} // namespace Thunder -using JsonObject = WPEFramework::Core::JSON::VariantContainer; -using JsonValue = WPEFramework::Core::JSON::Variant; -using JsonArray = WPEFramework::Core::JSON::ArrayType; +using JsonObject = Thunder::Core::JSON::VariantContainer; +using JsonValue = Thunder::Core::JSON::Variant; +using JsonArray = Thunder::Core::JSON::ArrayType; #endif // __JSON_H diff --git a/Source/core/JSONRPC.cpp b/Source/core/JSONRPC.cpp index 33f19c227..bc5a3c259 100644 --- a/Source/core/JSONRPC.cpp +++ b/Source/core/JSONRPC.cpp @@ -19,7 +19,7 @@ #include "JSONRPC.h" -namespace WPEFramework { +namespace Thunder { namespace Core { @@ -28,4 +28,4 @@ namespace Core { /* static */ constexpr TCHAR Message::DefaultVersion[]; } } -} // namespace WPEramework::Core::JSONRPC +} // namespace Thunder::Core::JSONRPC diff --git a/Source/core/JSONRPC.h b/Source/core/JSONRPC.h index c4b01cb82..3423afece 100644 --- a/Source/core/JSONRPC.h +++ b/Source/core/JSONRPC.h @@ -27,7 +27,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Core { diff --git a/Source/core/KeyValue.h b/Source/core/KeyValue.h index 974563ab1..047fa0479 100644 --- a/Source/core/KeyValue.h +++ b/Source/core/KeyValue.h @@ -23,7 +23,7 @@ #include "Module.h" #include "Portability.h" -namespace WPEFramework { +namespace Thunder { namespace Core { template diff --git a/Source/core/Library.cpp b/Source/core/Library.cpp index 4a59f4096..a4412d150 100644 --- a/Source/core/Library.cpp +++ b/Source/core/Library.cpp @@ -25,7 +25,7 @@ #include #endif -namespace WPEFramework { +namespace Thunder { namespace Core { static const TCHAR* GlobalSymbols = "Global Symbols"; diff --git a/Source/core/Library.h b/Source/core/Library.h index 2dfdfe46a..48c46ed1d 100644 --- a/Source/core/Library.h +++ b/Source/core/Library.h @@ -23,7 +23,7 @@ #include "Module.h" #include "Portability.h" -namespace WPEFramework { +namespace Thunder { namespace Core { class EXTERNAL Library { private: diff --git a/Source/core/Link.h b/Source/core/Link.h index fa7116db6..2c97589c1 100644 --- a/Source/core/Link.h +++ b/Source/core/Link.h @@ -25,7 +25,7 @@ #include "Portability.h" #include "Proxy.h" -namespace WPEFramework { +namespace Thunder { namespace Core { template class LinkType { diff --git a/Source/core/LockableContainer.h b/Source/core/LockableContainer.h index 1b7fbebfe..6ddf84a3b 100644 --- a/Source/core/LockableContainer.h +++ b/Source/core/LockableContainer.h @@ -24,7 +24,7 @@ #include "ReadWriteLock.h" -namespace WPEFramework { +namespace Thunder { namespace Core { template diff --git a/Source/core/Measurement.h b/Source/core/Measurement.h index 0b4c3c92c..a1ba75712 100644 --- a/Source/core/Measurement.h +++ b/Source/core/Measurement.h @@ -24,7 +24,7 @@ #include "Number.h" #include "Portability.h" -namespace WPEFramework { +namespace Thunder { namespace Core { template class MeasurementType { diff --git a/Source/core/Media.h b/Source/core/Media.h index 126c1fe7f..363b2c87a 100644 --- a/Source/core/Media.h +++ b/Source/core/Media.h @@ -23,7 +23,7 @@ #include "Module.h" #include "Portability.h" -namespace WPEFramework { +namespace Thunder { namespace Core { struct IMedia { virtual ~IMedia() = default; diff --git a/Source/core/MessageException.cpp b/Source/core/MessageException.cpp index a71eb8d58..1be7b1420 100644 --- a/Source/core/MessageException.cpp +++ b/Source/core/MessageException.cpp @@ -22,7 +22,7 @@ #include "MessageException.h" #include "Serialization.h" -namespace WPEFramework { +namespace Thunder { namespace Core { PUSH_WARNING(DISABLE_WARNING_DEPRECATED_USE) diff --git a/Source/core/MessageException.h b/Source/core/MessageException.h index ab1359fa0..ca5ff0997 100644 --- a/Source/core/MessageException.h +++ b/Source/core/MessageException.h @@ -26,7 +26,7 @@ #include "Portability.h" #include "TextFragment.h" -namespace WPEFramework { +namespace Thunder { namespace Core { class MessageException : public std::exception { diff --git a/Source/core/MessageStore.cpp b/Source/core/MessageStore.cpp index 17549e9c3..ad15dc551 100644 --- a/Source/core/MessageStore.cpp +++ b/Source/core/MessageStore.cpp @@ -24,7 +24,7 @@ #include "Enumerate.h" #include "Singleton.h" -namespace WPEFramework { +namespace Thunder { ENUM_CONVERSION_BEGIN(Core::Messaging::Metadata::type) { Core::Messaging::Metadata::type::TRACING, _TXT("Tracing") }, diff --git a/Source/core/MessageStore.h b/Source/core/MessageStore.h index cd0648aa8..dfa6a71e0 100644 --- a/Source/core/MessageStore.h +++ b/Source/core/MessageStore.h @@ -21,7 +21,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace Core { diff --git a/Source/core/Netlink.cpp b/Source/core/Netlink.cpp index 3a7c7e9d4..58ca83f66 100644 --- a/Source/core/Netlink.cpp +++ b/Source/core/Netlink.cpp @@ -24,7 +24,7 @@ // #define DEBUG_FRAMES 1 -namespace WPEFramework { +namespace Thunder { namespace Core { @@ -238,4 +238,4 @@ namespace Core { { } } -} // namespace WPEFramework::Core +} // namespace Thunder::Core diff --git a/Source/core/Netlink.h b/Source/core/Netlink.h index 78965521d..c84bdde5e 100644 --- a/Source/core/Netlink.h +++ b/Source/core/Netlink.h @@ -31,7 +31,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Core { @@ -420,7 +420,7 @@ namespace Core { PendingList _pending; }; } // namespace Core -} // namespace WPEFramework +} // namespace Thunder #endif // __WINDOWS__ diff --git a/Source/core/NetworkInfo.cpp b/Source/core/NetworkInfo.cpp index 6e325ed82..4dc67f788 100644 --- a/Source/core/NetworkInfo.cpp +++ b/Source/core/NetworkInfo.cpp @@ -49,7 +49,7 @@ #include #endif -namespace WPEFramework { +namespace Thunder { namespace Core { diff --git a/Source/core/NetworkInfo.h b/Source/core/NetworkInfo.h index 2a5e00fe9..977185a42 100644 --- a/Source/core/NetworkInfo.h +++ b/Source/core/NetworkInfo.h @@ -26,7 +26,7 @@ #include "Portability.h" #include "SocketPort.h" -namespace WPEFramework { +namespace Thunder { namespace Core { class RoutingTable { public: diff --git a/Source/core/NodeId.cpp b/Source/core/NodeId.cpp index 32542f0fb..b8f32d872 100644 --- a/Source/core/NodeId.cpp +++ b/Source/core/NodeId.cpp @@ -43,7 +43,7 @@ #include "NodeId.h" -namespace WPEFramework { +namespace Thunder { namespace Core { static bool IsIPv4Address(const TCHAR hostname[]) { diff --git a/Source/core/NodeId.h b/Source/core/NodeId.h index cebd9aa24..0066c5b56 100644 --- a/Source/core/NodeId.h +++ b/Source/core/NodeId.h @@ -57,7 +57,7 @@ #include "TextFragment.h" -namespace WPEFramework { +namespace Thunder { namespace Core { class EXTERNAL NodeId { private: diff --git a/Source/core/Number.cpp b/Source/core/Number.cpp index b507f5998..86b3d2d47 100644 --- a/Source/core/Number.cpp +++ b/Source/core/Number.cpp @@ -21,7 +21,7 @@ #include "Number.h" -namespace WPEFramework { +namespace Thunder { namespace Core { extern "C" { unsigned char FromDigits(const TCHAR element) diff --git a/Source/core/Number.h b/Source/core/Number.h index 704983a11..ac5cb7e60 100644 --- a/Source/core/Number.h +++ b/Source/core/Number.h @@ -25,7 +25,7 @@ #include "TextFragment.h" #include "TypeTraits.h" -namespace WPEFramework { +namespace Thunder { namespace Core { extern "C" { EXTERNAL unsigned char FromDigits(const TCHAR element); diff --git a/Source/core/Optional.h b/Source/core/Optional.h index 3fbb23606..1e2b289de 100644 --- a/Source/core/Optional.h +++ b/Source/core/Optional.h @@ -22,7 +22,7 @@ #include "Portability.h" -namespace WPEFramework { +namespace Thunder { namespace Core { template class OptionalType { diff --git a/Source/core/Parser.cpp b/Source/core/Parser.cpp index 4b008bcb6..c845c6e9c 100644 --- a/Source/core/Parser.cpp +++ b/Source/core/Parser.cpp @@ -19,7 +19,7 @@ #include "Parser.h" -namespace WPEFramework { +namespace Thunder { namespace Core { uint32_t TextParser::ReadText(const TCHAR delimiters[], const uint32_t offset) const diff --git a/Source/core/Parser.h b/Source/core/Parser.h index 0a123dac3..0af048165 100644 --- a/Source/core/Parser.h +++ b/Source/core/Parser.h @@ -30,7 +30,7 @@ #include "Portability.h" #include "Range.h" -namespace WPEFramework { +namespace Thunder { namespace Core { template class ParserType { diff --git a/Source/core/Portability.cpp b/Source/core/Portability.cpp index 695ff7f3e..1f9a7eb3e 100644 --- a/Source/core/Portability.cpp +++ b/Source/core/Portability.cpp @@ -34,7 +34,7 @@ #endif #endif -using namespace WPEFramework; +using namespace Thunder; #ifdef __WINDOWS__ @@ -196,7 +196,7 @@ uint32_t GetCallStack(const ThreadId threadId, void* addresses[], const uint32_t extern "C" { -void DumpCallStack(const ThreadId threadId VARIABLE_IS_NOT_USED, std::list& stackList VARIABLE_IS_NOT_USED) +void DumpCallStack(const ThreadId threadId VARIABLE_IS_NOT_USED, std::list& stackList VARIABLE_IS_NOT_USED) { #if defined(THUNDER_BACKTRACE) void* callstack[32]; @@ -338,7 +338,7 @@ uint64_t ntohll(const uint64_t& value) } #endif -namespace WPEFramework { +namespace Thunder { namespace Core { #ifndef va_copy diff --git a/Source/core/Portability.h b/Source/core/Portability.h index b215ff95d..02356f53f 100644 --- a/Source/core/Portability.h +++ b/Source/core/Portability.h @@ -684,7 +684,7 @@ typedef DWORD ThreadId; #define DEBUG_VARIABLE(x) #endif -namespace WPEFramework { +namespace Thunder { namespace Core { @@ -956,6 +956,7 @@ namespace Core { } } +namespace WPEFramework = Thunder; extern "C" { #ifdef __WINDOWS__ @@ -963,7 +964,7 @@ extern int EXTERNAL inet_aton(const char* cp, struct in_addr* inp); extern void EXTERNAL usleep(const uint32_t value); #endif -void EXTERNAL DumpCallStack(const ThreadId threadId, std::list& stack); +void EXTERNAL DumpCallStack(const ThreadId threadId, std::list& stack); uint32_t EXTERNAL GetCallStack(const ThreadId threadId, void* addresses[], const uint32_t bufferSize); } diff --git a/Source/core/Process.h b/Source/core/Process.h index 2581d474a..82f70a94f 100644 --- a/Source/core/Process.h +++ b/Source/core/Process.h @@ -24,7 +24,7 @@ #include "Module.h" #include "Portability.h" -namespace WPEFramework { +namespace Thunder { namespace Core { class Process { diff --git a/Source/core/ProcessInfo.cpp b/Source/core/ProcessInfo.cpp index a81ade771..dde1c4c69 100644 --- a/Source/core/ProcessInfo.cpp +++ b/Source/core/ProcessInfo.cpp @@ -40,7 +40,7 @@ #include #endif -namespace WPEFramework { +namespace Thunder { namespace Core { #ifndef __WINDOWS__ const uint32_t PageSize = getpagesize(); diff --git a/Source/core/ProcessInfo.h b/Source/core/ProcessInfo.h index 9a902b548..56c5c0103 100644 --- a/Source/core/ProcessInfo.h +++ b/Source/core/ProcessInfo.h @@ -23,7 +23,7 @@ #include "IIterator.h" #include "Portability.h" -namespace WPEFramework { +namespace Thunder { namespace Core { // On 64 bits deployments, this is probably a uint64_t, lets prepare for it :-) @@ -423,5 +423,5 @@ namespace Core { }; } // namespace Core -} // namespace WPEFramework +} // namespace Thunder diff --git a/Source/core/Proxy.h b/Source/core/Proxy.h index f54c89d3c..e0a3c5313 100644 --- a/Source/core/Proxy.h +++ b/Source/core/Proxy.h @@ -38,7 +38,7 @@ // ---- Class Definition ---- -namespace WPEFramework { +namespace Thunder { namespace Core { template diff --git a/Source/core/Queue.h b/Source/core/Queue.h index 447944b7e..21b85bdb6 100644 --- a/Source/core/Queue.h +++ b/Source/core/Queue.h @@ -34,7 +34,7 @@ #include "StateTrigger.h" #include "Sync.h" -namespace WPEFramework { +namespace Thunder { namespace Core { template class QueueType { diff --git a/Source/core/Range.h b/Source/core/Range.h index 81ac4ee30..f828e2371 100644 --- a/Source/core/Range.h +++ b/Source/core/Range.h @@ -30,7 +30,7 @@ // ---- Helper types and constants ---- // ---- Helper functions ---- -namespace WPEFramework { +namespace Thunder { namespace Core { template class RangeType { diff --git a/Source/core/ReadWriteLock.h b/Source/core/ReadWriteLock.h index 700213179..4dfa76fee 100644 --- a/Source/core/ReadWriteLock.h +++ b/Source/core/ReadWriteLock.h @@ -25,7 +25,7 @@ #include "StateTrigger.h" #include "Sync.h" -namespace WPEFramework { +namespace Thunder { namespace Core { class EXTERNAL ReadWriteLock { diff --git a/Source/core/Rectangle.h b/Source/core/Rectangle.h index 902c3532f..9f95638ee 100644 --- a/Source/core/Rectangle.h +++ b/Source/core/Rectangle.h @@ -27,7 +27,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace Core { class EXTERNAL Rectangle { diff --git a/Source/core/RequestResponse.h b/Source/core/RequestResponse.h index cf09655dc..9b64d4eb1 100644 --- a/Source/core/RequestResponse.h +++ b/Source/core/RequestResponse.h @@ -22,7 +22,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace Platform { template diff --git a/Source/core/ResourceMonitor.cpp b/Source/core/ResourceMonitor.cpp index cfed866da..1ac6e9276 100644 --- a/Source/core/ResourceMonitor.cpp +++ b/Source/core/ResourceMonitor.cpp @@ -20,7 +20,7 @@ #include "ResourceMonitor.h" #include "Singleton.h" -namespace WPEFramework { +namespace Thunder { namespace Core { @@ -38,4 +38,4 @@ namespace Core { #endif } } -} // namespace WPEFramework::Core +} // namespace Thunder::Core diff --git a/Source/core/ResourceMonitor.h b/Source/core/ResourceMonitor.h index 75aad130b..a7a93dae5 100644 --- a/Source/core/ResourceMonitor.h +++ b/Source/core/ResourceMonitor.h @@ -26,7 +26,7 @@ #include "Trace.h" #include "Timer.h" -namespace WPEFramework { +namespace Thunder { namespace Core { @@ -592,4 +592,4 @@ namespace Core { ~ResourceMonitor() = default; }; } -} // namespace WPEFramework::Core +} // namespace Thunder::Core diff --git a/Source/core/SerialPort.cpp b/Source/core/SerialPort.cpp index 39e570367..63af34ee6 100644 --- a/Source/core/SerialPort.cpp +++ b/Source/core/SerialPort.cpp @@ -49,7 +49,7 @@ #define ERROR_AGAIN ERROR_IO_PENDING #endif -namespace WPEFramework { +namespace Thunder { namespace Core { ////////////////////////////////////////////////////////////////////// diff --git a/Source/core/SerialPort.h b/Source/core/SerialPort.h index 9bd8cd343..e075f1f9c 100644 --- a/Source/core/SerialPort.h +++ b/Source/core/SerialPort.h @@ -33,7 +33,7 @@ #include "Portability.h" #include "ResourceMonitor.h" -namespace WPEFramework { +namespace Thunder { namespace Core { #ifdef __WINDOWS__ diff --git a/Source/core/Serialization.cpp b/Source/core/Serialization.cpp index 4abb7aa5d..32ab29575 100644 --- a/Source/core/Serialization.cpp +++ b/Source/core/Serialization.cpp @@ -19,7 +19,7 @@ #include "Serialization.h" -namespace WPEFramework { +namespace Thunder { namespace Core { PUSH_WARNING(DISABLE_WARNING_DEPRECATED_USE) diff --git a/Source/core/Serialization.h b/Source/core/Serialization.h index 55f0a3ef4..d15c32bf6 100644 --- a/Source/core/Serialization.h +++ b/Source/core/Serialization.h @@ -25,7 +25,7 @@ #include "Portability.h" #include "TextFragment.h" -namespace WPEFramework { +namespace Thunder { namespace Core { #ifdef _UNICODE inline int ToCharacter(const char* character, TCHAR converted[], unsigned int count) diff --git a/Source/core/Services.cpp b/Source/core/Services.cpp index fde145d1a..50b297025 100644 --- a/Source/core/Services.cpp +++ b/Source/core/Services.cpp @@ -19,7 +19,7 @@ #include "Services.h" -namespace WPEFramework { +namespace Thunder { namespace Core { /* static */ ServiceAdministrator ServiceAdministrator::_systemServiceAdministrator; diff --git a/Source/core/Services.h b/Source/core/Services.h index 434e74d8f..f9cb79614 100644 --- a/Source/core/Services.h +++ b/Source/core/Services.h @@ -34,7 +34,7 @@ #include "WarningReportingControl.h" #include "WarningReportingCategories.h" -namespace WPEFramework { +namespace Thunder { namespace Core { class EXTERNAL ServiceAdministrator { @@ -335,10 +335,10 @@ namespace Core { #define SERVICE_REGISTRATION(...) SERVICE_REGISTRATION_NAME(PUSH_COUNT_ARGS(__VA_ARGS__), __VA_ARGS__) #define SERVICE_REGISTRATION_3(ACTUALCLASS, MAJOR, MINOR) \ -static WPEFramework::Core::PublishedServiceType ServiceMetadata_##ACTUALCLASS(WPEFramework::Core::System::MODULE_NAME, MAJOR, MINOR, 0); +static Thunder::Core::PublishedServiceType ServiceMetadata_##ACTUALCLASS(Thunder::Core::System::MODULE_NAME, MAJOR, MINOR, 0); #define SERVICE_REGISTRATION_4(ACTUALCLASS, MAJOR, MINOR, PATCH) \ -static WPEFramework::Core::PublishedServiceType ServiceMetadata_##ACTUALCLASS(WPEFramework::Core::System::MODULE_NAME, MAJOR, MINOR, PATCH); +static Thunder::Core::PublishedServiceType ServiceMetadata_##ACTUALCLASS(Thunder::Core::System::MODULE_NAME, MAJOR, MINOR, PATCH); #ifdef BEGIN_INTERFACE_MAP @@ -360,9 +360,9 @@ static WPEFramework::Core::PublishedServiceType ServiceMetadata_##A #define BEGIN_INTERFACE_MAP(ACTUALCLASS) \ void* QueryInterface(const uint32_t interfaceNumber) override \ { \ - if (interfaceNumber == WPEFramework::Core::IUnknown::ID) { \ + if (interfaceNumber == Thunder::Core::IUnknown::ID) { \ AddRef(); \ - return (static_cast(static_cast(this))); \ + return (static_cast(static_cast(this))); \ } #define INTERFACE_ENTRY(TYPE) \ diff --git a/Source/core/SharedBuffer.cpp b/Source/core/SharedBuffer.cpp index 8363e7924..c26704943 100644 --- a/Source/core/SharedBuffer.cpp +++ b/Source/core/SharedBuffer.cpp @@ -22,7 +22,7 @@ // TODO: remove if no longer needed for simple tracing. #include -namespace WPEFramework { +namespace Thunder { namespace Core { diff --git a/Source/core/SharedBuffer.h b/Source/core/SharedBuffer.h index 5eb9fcd8c..664e34d98 100644 --- a/Source/core/SharedBuffer.h +++ b/Source/core/SharedBuffer.h @@ -34,7 +34,7 @@ // ---- Helper types and constants ---- -namespace WPEFramework { +namespace Thunder { namespace Core { // Rationale: @@ -220,6 +220,6 @@ namespace Core { uint8_t* _customerAdministration; }; } -} // namespace WPEFramework::Core +} // namespace Thunder::Core #endif // __SHARED_BUFFER_H diff --git a/Source/core/Singleton.cpp b/Source/core/Singleton.cpp index 6ebbb3b9e..7f7a05fb2 100644 --- a/Source/core/Singleton.cpp +++ b/Source/core/Singleton.cpp @@ -20,7 +20,7 @@ #include "Singleton.h" #include "Portability.h" -namespace WPEFramework { +namespace Thunder { namespace Core { /* static */ Singleton::SingletonList& Singleton::ListInstance() diff --git a/Source/core/Singleton.h b/Source/core/Singleton.h index b59b7c83a..7b321dc74 100644 --- a/Source/core/Singleton.h +++ b/Source/core/Singleton.h @@ -32,7 +32,7 @@ // ---- Referenced classes and types ---- // ---- Helper functions ---- -namespace WPEFramework { +namespace Thunder { namespace Core { class EXTERNAL Singleton { private: diff --git a/Source/core/SocketPort.cpp b/Source/core/SocketPort.cpp index 7f0764cfc..26f1fa0c0 100644 --- a/Source/core/SocketPort.cpp +++ b/Source/core/SocketPort.cpp @@ -64,7 +64,7 @@ PUSH_WARNING(DISABLE_WARNING_THIS_IN_MEMBER_INITIALIZER_LIST) #endif -namespace WPEFramework { +namespace Thunder { namespace Core { #ifdef __DEBUG__ diff --git a/Source/core/SocketPort.h b/Source/core/SocketPort.h index 5c4f3cc54..006d32a69 100644 --- a/Source/core/SocketPort.h +++ b/Source/core/SocketPort.h @@ -45,7 +45,7 @@ #include #endif -namespace WPEFramework { +namespace Thunder { namespace Core { class EXTERNAL SocketPort : public IResource { private: diff --git a/Source/core/SocketServer.h b/Source/core/SocketServer.h index 9247896f6..aca3a38ab 100644 --- a/Source/core/SocketServer.h +++ b/Source/core/SocketServer.h @@ -25,7 +25,7 @@ #include "Proxy.h" #include "SocketPort.h" -namespace WPEFramework { +namespace Thunder { namespace Core { template class SocketServerType { diff --git a/Source/core/StateTrigger.h b/Source/core/StateTrigger.h index 26e41f62a..7e48d3fbd 100644 --- a/Source/core/StateTrigger.h +++ b/Source/core/StateTrigger.h @@ -33,7 +33,7 @@ #include "Sync.h" -namespace WPEFramework { +namespace Thunder { namespace Core { template class StateTrigger { diff --git a/Source/core/StopWatch.h b/Source/core/StopWatch.h index 1a19d3644..ad0f5d612 100644 --- a/Source/core/StopWatch.h +++ b/Source/core/StopWatch.h @@ -23,7 +23,7 @@ #include "Portability.h" #include "SystemInfo.h" -namespace WPEFramework { +namespace Thunder { namespace Core { class StopWatch { @@ -53,4 +53,4 @@ namespace Core { uint64_t _lastMeasurement; }; -} } // namespace WPEFramework::Core +} } // namespace Thunder::Core diff --git a/Source/core/Stream.h b/Source/core/Stream.h index 8b6347544..387e504f4 100644 --- a/Source/core/Stream.h +++ b/Source/core/Stream.h @@ -30,7 +30,7 @@ // ---- Helper types and constants ---- // ---- Helper functions ---- -namespace WPEFramework { +namespace Thunder { namespace Core { struct IStream { virtual ~IStream() = default; diff --git a/Source/core/StreamJSON.h b/Source/core/StreamJSON.h index 97eb5918c..279f012de 100644 --- a/Source/core/StreamJSON.h +++ b/Source/core/StreamJSON.h @@ -24,7 +24,7 @@ #include "Module.h" #include "Portability.h" -namespace WPEFramework { +namespace Thunder { namespace Core { template // = Core::JSON::IElement> class StreamJSONType { diff --git a/Source/core/StreamText.h b/Source/core/StreamText.h index c1298d0ba..b6b27d35f 100644 --- a/Source/core/StreamText.h +++ b/Source/core/StreamText.h @@ -23,7 +23,7 @@ #include "Module.h" #include "Portability.h" -namespace WPEFramework { +namespace Thunder { namespace Core { class TerminatorNull { public: diff --git a/Source/core/StreamTypeLengthValue.h b/Source/core/StreamTypeLengthValue.h index abc61ce2e..e92bdc68d 100644 --- a/Source/core/StreamTypeLengthValue.h +++ b/Source/core/StreamTypeLengthValue.h @@ -24,7 +24,7 @@ #include -namespace WPEFramework { +namespace Thunder { namespace Exchange { diff --git a/Source/core/Sync.cpp b/Source/core/Sync.cpp index d854f6c9d..a1c9d854e 100644 --- a/Source/core/Sync.cpp +++ b/Source/core/Sync.cpp @@ -62,7 +62,7 @@ __gnu_cxx::recursive_init_error::~recursive_init_error() } #endif -namespace WPEFramework { +namespace Thunder { namespace Core { #ifdef __WINDOWS__ diff --git a/Source/core/Sync.h b/Source/core/Sync.h index 7e1ddd9de..63540c773 100644 --- a/Source/core/Sync.h +++ b/Source/core/Sync.h @@ -32,7 +32,7 @@ #include #endif -namespace WPEFramework { +namespace Thunder { namespace Core { // =========================================================================== // class CriticalSection diff --git a/Source/core/Synchronize.h b/Source/core/Synchronize.h index d0c97877c..c725296c7 100644 --- a/Source/core/Synchronize.h +++ b/Source/core/Synchronize.h @@ -23,7 +23,7 @@ #include "Module.h" #include "Portability.h" -namespace WPEFramework { +namespace Thunder { namespace Core { template class SynchronizeType { diff --git a/Source/core/SynchronousChannel.h b/Source/core/SynchronousChannel.h index b3eb504d6..a3967bd00 100644 --- a/Source/core/SynchronousChannel.h +++ b/Source/core/SynchronousChannel.h @@ -21,7 +21,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace Core { @@ -414,4 +414,4 @@ namespace Core { } // namespace Core -} // namespace WPEFramework +} // namespace Thunder diff --git a/Source/core/SystemInfo.cpp b/Source/core/SystemInfo.cpp index 3d3443f52..78d035b98 100644 --- a/Source/core/SystemInfo.cpp +++ b/Source/core/SystemInfo.cpp @@ -65,7 +65,7 @@ long get_avphys_pages (void); #endif -namespace WPEFramework { +namespace Thunder { namespace Core { /* static */ SystemInfo SystemInfo::_systemInfo; @@ -530,4 +530,4 @@ namespace Core { } // Extern "C":: System } // namespace Core -} // namespace WPEFramework +} // namespace Thunder diff --git a/Source/core/SystemInfo.h b/Source/core/SystemInfo.h index e826a4e32..604664228 100644 --- a/Source/core/SystemInfo.h +++ b/Source/core/SystemInfo.h @@ -34,7 +34,7 @@ #define ROOT_META_DATA_1 RootMetaData_ #define ROOT_META_DATA CONCAT_STRINGS(ROOT_META_DATA_1,MODULE_NAME) -namespace WPEFramework { +namespace Thunder { namespace Core { struct EXTERNAL IService { @@ -55,7 +55,7 @@ namespace Core { }; namespace System { - extern "C" EXTERNAL_EXPORT const WPEFramework::Core::IService::IMetadata * ROOT_META_DATA; + extern "C" EXTERNAL_EXPORT const Thunder::Core::IService::IMetadata * ROOT_META_DATA; extern "C" EXTERNAL_EXPORT const char* MODULE_NAME; @@ -253,14 +253,14 @@ namespace Core { #endif }; // class SystemInfo } // namespace Core -} // namespace WPEFramework +} // namespace Thunder #define MODULE_NAME_DECLARATION(buildref) \ extern "C" { \ - namespace WPEFramework { \ + namespace Thunder { \ namespace Core { \ namespace System { \ - EXTERNAL_EXPORT const WPEFramework::Core::IService::IMetadata* ROOT_META_DATA = nullptr; \ + EXTERNAL_EXPORT const Thunder::Core::IService::IMetadata* ROOT_META_DATA = nullptr; \ EXTERNAL_EXPORT const char* MODULE_NAME = DEFINE_STRING(MODULE_NAME); \ EXTERNAL_EXPORT const char* ModuleBuildRef() { return (DEFINE_STRING(buildref)); } \ EXTERNAL_EXPORT const IService::IMetadata* ModuleServiceMetadata() {return(ROOT_META_DATA);} \ @@ -271,7 +271,7 @@ namespace Core { #define MODULE_NAME_ARCHIVE_DECLARATION \ extern "C" { \ - namespace WPEFramework { \ + namespace Thunder { \ namespace Core { \ namespace System { \ EXTERNAL_EXPORT const char* MODULE_NAME = DEFINE_STRING(MODULE_NAME); \ diff --git a/Source/core/TextFragment.h b/Source/core/TextFragment.h index a244c1766..821f913d6 100644 --- a/Source/core/TextFragment.h +++ b/Source/core/TextFragment.h @@ -24,7 +24,7 @@ #include "Portability.h" #include "Trace.h" -namespace WPEFramework { +namespace Thunder { namespace Core { class Fractional; diff --git a/Source/core/TextReader.cpp b/Source/core/TextReader.cpp index bea85f015..86f0e8383 100644 --- a/Source/core/TextReader.cpp +++ b/Source/core/TextReader.cpp @@ -19,7 +19,7 @@ #include "TextReader.h" -namespace WPEFramework { +namespace Thunder { namespace Core { TextFragment TextReader::ReadLine() const diff --git a/Source/core/TextReader.h b/Source/core/TextReader.h index 9a80f5d49..b0e4bb08b 100644 --- a/Source/core/TextReader.h +++ b/Source/core/TextReader.h @@ -26,7 +26,7 @@ #include "DataElement.h" #include "TextFragment.h" -namespace WPEFramework { +namespace Thunder { namespace Core { // ---- Referenced classes and types ---- diff --git a/Source/core/TextStreamRedirectType.h b/Source/core/TextStreamRedirectType.h index 2d8c4a056..6f214caea 100644 --- a/Source/core/TextStreamRedirectType.h +++ b/Source/core/TextStreamRedirectType.h @@ -17,7 +17,7 @@ * limitations under the License. */ -namespace WPEFramework { +namespace Thunder { namespace Core { template class TextStreamRedirectType { diff --git a/Source/core/Thread.cpp b/Source/core/Thread.cpp index 4b51966fe..fec3cc738 100644 --- a/Source/core/Thread.cpp +++ b/Source/core/Thread.cpp @@ -31,7 +31,7 @@ // CLASS: Thread //----------------------------------------------------------------------------------------------- -namespace WPEFramework { +namespace Thunder { namespace Core { //Definitions of static members diff --git a/Source/core/Thread.h b/Source/core/Thread.h index 01ec620ff..6f92bd4d3 100644 --- a/Source/core/Thread.h +++ b/Source/core/Thread.h @@ -32,7 +32,7 @@ #include "TextFragment.h" #include "Time.h" -namespace WPEFramework { +namespace Thunder { namespace Core { template class ThreadLocalStorageType { diff --git a/Source/core/ThreadPool.h b/Source/core/ThreadPool.h index 2603dca9a..461122090 100644 --- a/Source/core/ThreadPool.h +++ b/Source/core/ThreadPool.h @@ -23,7 +23,7 @@ #include "ResourceMonitor.h" #include "Number.h" -namespace WPEFramework { +namespace Thunder { namespace Core { @@ -434,7 +434,7 @@ POP_WARNING() #ifdef __CORE_WARNING_REPORTING__ // Add an entry into the JobMonitor list DispatchedJobMetaData data{Thread::ThreadId(), - string(WPEFramework::Core::CallsignTLS::CallsignAccess<&WPEFramework::Core::System::MODULE_NAME>::Callsign()), + string(Thunder::Core::CallsignTLS::CallsignAccess<&Thunder::Core::System::MODULE_NAME>::Callsign()), Time::Now().Ticks(), 0}; _parent.SaveDispatchedJobContext(data); diff --git a/Source/core/Time.cpp b/Source/core/Time.cpp index 12ec6fedd..459ddcc68 100644 --- a/Source/core/Time.cpp +++ b/Source/core/Time.cpp @@ -29,12 +29,12 @@ namespace { // Start day of the UNIX epoch (1970-01-01), also counting from BCE constexpr uint32_t DayUNIXEpochStarts = 719163; - constexpr uint32_t NTPToUNIXSeconds = (DayUNIXEpochStarts - DayNTPStarts) * WPEFramework::Core::Time::SecondsPerDay; + constexpr uint32_t NTPToUNIXSeconds = (DayUNIXEpochStarts - DayNTPStarts) * Thunder::Core::Time::SecondsPerDay; } -namespace WPEFramework { +namespace Thunder { namespace Core { static bool IsLeapYear(const uint16_t year) diff --git a/Source/core/Time.h b/Source/core/Time.h index cd0c85da0..2eb7b095f 100644 --- a/Source/core/Time.h +++ b/Source/core/Time.h @@ -23,7 +23,7 @@ #include "Portability.h" #include "TextFragment.h" -namespace WPEFramework { +namespace Thunder { namespace Core { class EXTERNAL Time { diff --git a/Source/core/Timer.h b/Source/core/Timer.h index ceb360881..466df1eb8 100644 --- a/Source/core/Timer.h +++ b/Source/core/Timer.h @@ -42,7 +42,7 @@ PUSH_WARNING(DISABLE_WARNING_THIS_IN_MEMBER_INITIALIZER_LIST) // Description: Helper class to use pointers or proxies (if lifetime management needs to be automated) // as a carrier to be executed by the threadpooltype. // -namespace WPEFramework { +namespace Thunder { namespace Core { template class TimerType { diff --git a/Source/core/TokenizedStringList.h b/Source/core/TokenizedStringList.h index 42915d005..0b98cd8e2 100644 --- a/Source/core/TokenizedStringList.h +++ b/Source/core/TokenizedStringList.h @@ -20,7 +20,7 @@ #pragma once #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace Core { template diff --git a/Source/core/Trace.cpp b/Source/core/Trace.cpp index 964727bd6..96ea3a11c 100644 --- a/Source/core/Trace.cpp +++ b/Source/core/Trace.cpp @@ -23,7 +23,7 @@ #include "TextFragment.h" #include "Trace.h" -namespace WPEFramework { +namespace Thunder { namespace Core { class Demangling { public: diff --git a/Source/core/Trace.h b/Source/core/Trace.h index 17d2b607f..3298e2701 100644 --- a/Source/core/Trace.h +++ b/Source/core/Trace.h @@ -27,7 +27,7 @@ #include #endif -namespace WPEFramework { +namespace Thunder { namespace Core { template inline constexpr size_t FileNameOffset(const T(&str)[S], size_t i = S - 1) @@ -70,20 +70,20 @@ namespace WPEFramework { #ifdef __WINDOWS__ #define TRACE_FORMATTING_IMPL(fmt, ...) \ do { \ - ::fprintf(stderr, "\033[1;32m[%s:%d](%s)" fmt "\033[0m\n", &__FILE__[WPEFramework::Core::FileNameOffset(__FILE__)], __LINE__, __FUNCTION__, TRACE_PROCESS_ID, TRACE_THREAD_ID, ##__VA_ARGS__); \ + ::fprintf(stderr, "\033[1;32m[%s:%d](%s)" fmt "\033[0m\n", &__FILE__[Thunder::Core::FileNameOffset(__FILE__)], __LINE__, __FUNCTION__, TRACE_PROCESS_ID, TRACE_THREAD_ID, ##__VA_ARGS__); \ fflush(stderr); \ } while (0) #else #if INTPTR_MAX == INT64_MAX #define TRACE_FORMATTING_IMPL(fmt, ...) \ do { \ - ::fprintf(stderr, "\033[1;32m[%s:%d](%s)" fmt "\033[0m\n", &__FILE__[WPEFramework::Core::FileNameOffset(__FILE__)], __LINE__, __FUNCTION__, TRACE_PROCESS_ID, TRACE_THREAD_ID, ##__VA_ARGS__); \ + ::fprintf(stderr, "\033[1;32m[%s:%d](%s)" fmt "\033[0m\n", &__FILE__[Thunder::Core::FileNameOffset(__FILE__)], __LINE__, __FUNCTION__, TRACE_PROCESS_ID, TRACE_THREAD_ID, ##__VA_ARGS__); \ fflush(stderr); \ } while (0) #else #define TRACE_FORMATTING_IMPL(fmt, ...) \ do { \ - ::fprintf(stderr, "\033[1;32m[%s:%d](%s)" fmt "\033[0m\n", &__FILE__[WPEFramework::Core::FileNameOffset(__FILE__)], __LINE__, __FUNCTION__, TRACE_PROCESS_ID, TRACE_THREAD_ID, ##__VA_ARGS__); \ + ::fprintf(stderr, "\033[1;32m[%s:%d](%s)" fmt "\033[0m\n", &__FILE__[Thunder::Core::FileNameOffset(__FILE__)], __LINE__, __FUNCTION__, TRACE_PROCESS_ID, TRACE_THREAD_ID, ##__VA_ARGS__); \ fflush(stderr); \ } while (0) #endif @@ -158,9 +158,9 @@ namespace WPEFramework { do { \ if (!(expr)) { \ ASSERT_LOGGER("===== $$ [%d]: ASSERT [%s:%d] (%s)\n", TRACE_PROCESS_ID, __FILE__, __LINE__, #expr); \ - std::list entries; \ + std::list entries; \ DumpCallStack(0, entries); \ - for(const WPEFramework::Core::callstack_info& entry : entries) { \ + for(const Thunder::Core::callstack_info& entry : entries) { \ fprintf(stderr, "[%s]:[%s]:[%d]\n", entry.module.c_str(), entry.function.c_str(), entry.line); \ } \ fflush(stderr); \ @@ -172,9 +172,9 @@ namespace WPEFramework { do { \ if (!(expr)) { \ ASSERT_LOGGER("===== $$ [%d]: ASSERT [%s:%d] (%s)\n " #format "\n", TRACE_PROCESS_ID, __FILE__, __LINE__, #expr, ##__VA_ARGS__); \ - std::list entries; \ + std::list entries; \ DumpCallStack(0, entries); \ - for(const WPEFramework::Core::callstack_info& entry : entries) { \ + for(const Thunder::Core::callstack_info& entry : entries) { \ fprintf(stderr, "[%s]:[%s]:[%d]\n", entry.module.c_str(), entry.function.c_str(), entry.line); \ } \ fflush(stderr); \ @@ -207,7 +207,7 @@ namespace WPEFramework { Core::LogMessage(Core::ToString(__FILE__).c_str(), __LINE__, MESSAGE)); \ } -namespace WPEFramework { +namespace Thunder { namespace Core { class TextFragment; diff --git a/Source/core/TriState.h b/Source/core/TriState.h index 3d1901c6e..366d4ce8e 100644 --- a/Source/core/TriState.h +++ b/Source/core/TriState.h @@ -23,7 +23,7 @@ #include "Module.h" #include "Optional.h" -namespace WPEFramework { +namespace Thunder { namespace Core { class TriState { diff --git a/Source/core/TypeTraits.h b/Source/core/TypeTraits.h index b1774e2fb..9f761c230 100644 --- a/Source/core/TypeTraits.h +++ b/Source/core/TypeTraits.h @@ -23,7 +23,7 @@ #include "Portability.h" #include -namespace WPEFramework { +namespace Thunder { template using EnableIfParameter = typename std::enable_if::type; diff --git a/Source/core/ValueRecorder.h b/Source/core/ValueRecorder.h index 382042650..4b23708c4 100644 --- a/Source/core/ValueRecorder.h +++ b/Source/core/ValueRecorder.h @@ -36,7 +36,7 @@ // ---- Helper functions ---- // ---- Class Definition ---- -namespace WPEFramework { +namespace Thunder { namespace Core { // C = continuation. [1] Next byte is part of this element, [0] Last part of element // T = Type. [1] = Time / [0] = Value diff --git a/Source/core/WarningReportingCategories.cpp b/Source/core/WarningReportingCategories.cpp index e18bf2ee2..2d22757fe 100644 --- a/Source/core/WarningReportingCategories.cpp +++ b/Source/core/WarningReportingCategories.cpp @@ -21,7 +21,7 @@ #include "WarningReportingControl.h" #include "WarningReportingCategories.h" -namespace WPEFramework { +namespace Thunder { namespace WarningReporting { diff --git a/Source/core/WarningReportingCategories.h b/Source/core/WarningReportingCategories.h index cc7620fcc..7d22e8532 100644 --- a/Source/core/WarningReportingCategories.h +++ b/Source/core/WarningReportingCategories.h @@ -22,7 +22,7 @@ #include "Module.h" #include -namespace WPEFramework { +namespace Thunder { namespace WarningReporting { class EXTERNAL TooLongWaitingForLock { diff --git a/Source/core/WarningReportingControl.cpp b/Source/core/WarningReportingControl.cpp index b1f189457..96797ff4c 100644 --- a/Source/core/WarningReportingControl.cpp +++ b/Source/core/WarningReportingControl.cpp @@ -27,13 +27,13 @@ namespace { -class WarningReportingBoundsCategoryConfig : public WPEFramework::Core::JSON::Container { +class WarningReportingBoundsCategoryConfig : public Thunder::Core::JSON::Container { public: WarningReportingBoundsCategoryConfig(const WarningReportingBoundsCategoryConfig&) = delete; WarningReportingBoundsCategoryConfig& operator=(const WarningReportingBoundsCategoryConfig&) = delete; WarningReportingBoundsCategoryConfig() - : WPEFramework::Core::JSON::Container() + : Thunder::Core::JSON::Container() , ReportBound() , WarningBound() , CategoryConfig(false) @@ -46,18 +46,18 @@ class WarningReportingBoundsCategoryConfig : public WPEFramework::Core::JSON::Co ~WarningReportingBoundsCategoryConfig() override = default; public: - WPEFramework::Core::JSON::DecUInt64 ReportBound; - WPEFramework::Core::JSON::DecUInt64 WarningBound; - WPEFramework::Core::JSON::String CategoryConfig; + Thunder::Core::JSON::DecUInt64 ReportBound; + Thunder::Core::JSON::DecUInt64 WarningBound; + Thunder::Core::JSON::String CategoryConfig; }; -class ExcludedCategoriesValuesConfig : public WPEFramework::Core::JSON::Container { +class ExcludedCategoriesValuesConfig : public Thunder::Core::JSON::Container { public: ExcludedCategoriesValuesConfig(const WarningReportingBoundsCategoryConfig&) = delete; ExcludedCategoriesValuesConfig& operator=(const WarningReportingBoundsCategoryConfig&) = delete; ExcludedCategoriesValuesConfig() - : WPEFramework::Core::JSON::Container() + : Thunder::Core::JSON::Container() , ExcludedCallsigns() , ExcludedModules() { @@ -68,12 +68,12 @@ class ExcludedCategoriesValuesConfig : public WPEFramework::Core::JSON::Containe ~ExcludedCategoriesValuesConfig() override = default; public: - WPEFramework::Core::JSON::ArrayType ExcludedCallsigns; - WPEFramework::Core::JSON::ArrayType ExcludedModules; + Thunder::Core::JSON::ArrayType ExcludedCallsigns; + Thunder::Core::JSON::ArrayType ExcludedModules; }; } -namespace WPEFramework { +namespace Thunder { namespace WarningReporting { WarningReportingUnitProxy::WarningReportingUnitProxy() diff --git a/Source/core/WarningReportingControl.h b/Source/core/WarningReportingControl.h index b291a08c7..61a919f85 100644 --- a/Source/core/WarningReportingControl.h +++ b/Source/core/WarningReportingControl.h @@ -77,42 +77,42 @@ // - BoundsType to indicate type for boubnds values #define ANNOUNCE_WARNING(CATEGORY) \ - WPEFramework::WarningReporting::WarningReportingType>::IsEnabled() + Thunder::WarningReporting::WarningReportingType>::IsEnabled() #define REPORT_WARNING(CATEGORY, ...) \ - if (WPEFramework::WarningReporting::WarningReportingType::IsEnabled()) { \ - WPEFramework::WarningReporting::WarningReportingType __message__; \ - if (__message__.Analyze(WPEFramework::Core::System::MODULE_NAME, \ - WPEFramework::Core::CallsignTLS::CallsignAccess<&WPEFramework::Core::System::MODULE_NAME>::Callsign(), \ + if (Thunder::WarningReporting::WarningReportingType::IsEnabled()) { \ + Thunder::WarningReporting::WarningReportingType __message__; \ + if (__message__.Analyze(Thunder::Core::System::MODULE_NAME, \ + Thunder::Core::CallsignTLS::CallsignAccess<&Thunder::Core::System::MODULE_NAME>::Callsign(), \ ##__VA_ARGS__) \ == true) { \ - WPEFramework::WarningReporting::WarningReportingUnitProxy::Instance().ReportWarningEvent( \ - WPEFramework::Core::CallsignTLS::CallsignAccess<&WPEFramework::Core::System::MODULE_NAME>::Callsign(), \ + Thunder::WarningReporting::WarningReportingUnitProxy::Instance().ReportWarningEvent( \ + Thunder::Core::CallsignTLS::CallsignAccess<&Thunder::Core::System::MODULE_NAME>::Callsign(), \ __message__); \ } \ } #define REPORT_OUTOFBOUNDS_WARNING(CATEGORY, ACTUALVALUE, ...) \ - if (WPEFramework::WarningReporting::WarningReportingType>::IsEnabled() == true) { \ - WPEFramework::WarningReporting::WarningReportingType> __message__; \ - if (__message__.Analyze(WPEFramework::Core::System::MODULE_NAME, WPEFramework::Core::CallsignTLS::CallsignAccess<&WPEFramework::Core::System::MODULE_NAME>::Callsign(), \ + if (Thunder::WarningReporting::WarningReportingType>::IsEnabled() == true) { \ + Thunder::WarningReporting::WarningReportingType> __message__; \ + if (__message__.Analyze(Thunder::Core::System::MODULE_NAME, Thunder::Core::CallsignTLS::CallsignAccess<&Thunder::Core::System::MODULE_NAME>::Callsign(), \ ACTUALVALUE, \ ##__VA_ARGS__) \ == true) { \ - WPEFramework::WarningReporting::WarningReportingUnitProxy::Instance().ReportWarningEvent( \ - WPEFramework::Core::CallsignTLS::CallsignAccess<&WPEFramework::Core::System::MODULE_NAME>::Callsign(), \ + Thunder::WarningReporting::WarningReportingUnitProxy::Instance().ReportWarningEvent( \ + Thunder::Core::CallsignTLS::CallsignAccess<&Thunder::Core::System::MODULE_NAME>::Callsign(), \ __message__); \ } \ } #define REPORT_OUTOFBOUNDS_WARNING_EX(CATEGORY, CALLSIGN, ACTUALVALUE, ...) \ - if (WPEFramework::WarningReporting::WarningReportingType>::IsEnabled() == true) { \ - WPEFramework::WarningReporting::WarningReportingType> __message__; \ - if (__message__.Analyze(WPEFramework::Core::System::MODULE_NAME, CALLSIGN, \ + if (Thunder::WarningReporting::WarningReportingType>::IsEnabled() == true) { \ + Thunder::WarningReporting::WarningReportingType> __message__; \ + if (__message__.Analyze(Thunder::Core::System::MODULE_NAME, CALLSIGN, \ ACTUALVALUE, \ ##__VA_ARGS__) \ == true) { \ - WPEFramework::WarningReporting::WarningReportingUnitProxy::Instance().ReportWarningEvent( \ + Thunder::WarningReporting::WarningReportingUnitProxy::Instance().ReportWarningEvent( \ CALLSIGN, \ __message__); \ } \ @@ -120,25 +120,25 @@ #define REPORT_DURATION_WARNING(CODE, CATEGORY, ...) \ - if (WPEFramework::WarningReporting::WarningReportingType>::IsEnabled() == true) { \ - uint64_t start = WPEFramework::Core::SystemInfo::Instance().Ticks(); \ + if (Thunder::WarningReporting::WarningReportingType>::IsEnabled() == true) { \ + uint64_t start = Thunder::Core::SystemInfo::Instance().Ticks(); \ CODE \ - uint64_t duration = (WPEFramework::Core::SystemInfo::Instance().Ticks() - start) / WPEFramework::Core::Time::MicroSecondsPerMilliSecond; \ - WPEFramework::WarningReporting::WarningReportingType> __message__; \ - if (__message__.Analyze(WPEFramework::Core::System::MODULE_NAME, \ - WPEFramework::Core::CallsignTLS::CallsignAccess<&WPEFramework::Core::System::MODULE_NAME>::Callsign(), \ + uint64_t duration = (Thunder::Core::SystemInfo::Instance().Ticks() - start) / Thunder::Core::Time::MicroSecondsPerMilliSecond; \ + Thunder::WarningReporting::WarningReportingType> __message__; \ + if (__message__.Analyze(Thunder::Core::System::MODULE_NAME, \ + Thunder::Core::CallsignTLS::CallsignAccess<&Thunder::Core::System::MODULE_NAME>::Callsign(), \ duration, \ ##__VA_ARGS__) \ == true) { \ - WPEFramework::WarningReporting::WarningReportingUnitProxy::Instance().ReportWarningEvent( \ - WPEFramework::Core::CallsignTLS::CallsignAccess<&WPEFramework::Core::System::MODULE_NAME>::Callsign(), \ + Thunder::WarningReporting::WarningReportingUnitProxy::Instance().ReportWarningEvent( \ + Thunder::Core::CallsignTLS::CallsignAccess<&Thunder::Core::System::MODULE_NAME>::Callsign(), \ __message__); \ } \ } else { \ CODE \ } -namespace WPEFramework { +namespace Thunder { namespace Core { template @@ -396,7 +396,7 @@ namespace WarningReporting { WarningReportingControl() : _categoryName(CallCategoryName()) , _enabled(0x03) - , _metadata(WPEFramework::Core::Messaging::Metadata::type::REPORTING, _categoryName, WPEFramework::Core::Messaging::MODULE_REPORTING) + , _metadata(Thunder::Core::Messaging::Metadata::type::REPORTING, _categoryName, Thunder::Core::Messaging::MODULE_REPORTING) { // Register Our control unit, so it can be influenced from the outside // if nessecary.. diff --git a/Source/core/WorkerPool.cpp b/Source/core/WorkerPool.cpp index e48126cd4..f209de769 100644 --- a/Source/core/WorkerPool.cpp +++ b/Source/core/WorkerPool.cpp @@ -19,7 +19,7 @@ #include "WorkerPool.h" -namespace WPEFramework { +namespace Thunder { namespace Core { diff --git a/Source/core/WorkerPool.h b/Source/core/WorkerPool.h index 1e938658c..d522f4ecf 100644 --- a/Source/core/WorkerPool.h +++ b/Source/core/WorkerPool.h @@ -23,7 +23,7 @@ #include "ThreadPool.h" #include "Timer.h" -namespace WPEFramework { +namespace Thunder { namespace Core { diff --git a/Source/core/XGetopt.cpp b/Source/core/XGetopt.cpp index cff541312..f6e9b9080 100644 --- a/Source/core/XGetopt.cpp +++ b/Source/core/XGetopt.cpp @@ -219,7 +219,7 @@ static int getopt(int argc, TCHAR* argv[], TCHAR* optstring) #endif -namespace WPEFramework { +namespace Thunder { namespace Core { void Options::Parse() { diff --git a/Source/core/XGetopt.h b/Source/core/XGetopt.h index 29b6193b0..92d3b872f 100644 --- a/Source/core/XGetopt.h +++ b/Source/core/XGetopt.h @@ -23,7 +23,7 @@ #include "Module.h" #include "Portability.h" -namespace WPEFramework { +namespace Thunder { namespace Core { class EXTERNAL Options { public: diff --git a/Source/cryptalgo/AES.cpp b/Source/cryptalgo/AES.cpp index a2636b0d9..c2e2f7a0f 100644 --- a/Source/cryptalgo/AES.cpp +++ b/Source/cryptalgo/AES.cpp @@ -19,7 +19,7 @@ #include "AES.h" -namespace WPEFramework { +namespace Thunder { namespace Crypto { AESEncryption::AESEncryption(const aesType type) @@ -344,4 +344,4 @@ namespace Crypto { return (result); } } -} // namespace WPEFramework::Crypto +} // namespace Thunder::Crypto diff --git a/Source/cryptalgo/AES.h b/Source/cryptalgo/AES.h index 9800bec10..5a6392e2a 100644 --- a/Source/cryptalgo/AES.h +++ b/Source/cryptalgo/AES.h @@ -23,7 +23,7 @@ #include "AESImplementation.h" #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace Crypto { enum aesType : uint8_t { diff --git a/Source/cryptalgo/HMAC.h b/Source/cryptalgo/HMAC.h index 696c5243e..41bea0e88 100644 --- a/Source/cryptalgo/HMAC.h +++ b/Source/cryptalgo/HMAC.h @@ -31,7 +31,7 @@ // ---- Helper types and constants ---- // ---- Helper functions ---- -namespace WPEFramework { +namespace Thunder { namespace Crypto { template class HMACType { diff --git a/Source/cryptalgo/Hash.cpp b/Source/cryptalgo/Hash.cpp index 2220c795c..d9c31e14d 100644 --- a/Source/cryptalgo/Hash.cpp +++ b/Source/cryptalgo/Hash.cpp @@ -207,7 +207,7 @@ wv[h] = t1 + t2; \ } -namespace WPEFramework { +namespace Thunder { namespace Crypto { // -------------------------------------------------------------------------------------------- // MD5 functionality @@ -1939,4 +1939,4 @@ namespace Crypto { return *this; } } -} // namespace WPEFramework::Crypto +} // namespace Thunder::Crypto diff --git a/Source/cryptalgo/Hash.h b/Source/cryptalgo/Hash.h index 72a52796d..47bb8269b 100644 --- a/Source/cryptalgo/Hash.h +++ b/Source/cryptalgo/Hash.h @@ -80,7 +80,7 @@ // ---- Helper types and constants ---- // ---- Helper functions ---- -namespace WPEFramework { +namespace Thunder { namespace Crypto { enum EnumHashType { HASH_MD5 = 16, diff --git a/Source/cryptalgo/HashStream.h b/Source/cryptalgo/HashStream.h index 5fefb928e..61589135d 100644 --- a/Source/cryptalgo/HashStream.h +++ b/Source/cryptalgo/HashStream.h @@ -32,7 +32,7 @@ // ---- Helper types and constants ---- // ---- Helper functions ---- -namespace WPEFramework { +namespace Thunder { namespace Crypto { struct IHashStream { virtual ~IHashStream() = default; diff --git a/Source/cryptalgo/Random.cpp b/Source/cryptalgo/Random.cpp index edcd1c33c..705bca2a8 100644 --- a/Source/cryptalgo/Random.cpp +++ b/Source/cryptalgo/Random.cpp @@ -31,7 +31,7 @@ #include #endif // SECURESOCKETS_ENABLED -namespace WPEFramework { +namespace Thunder { namespace Crypto { // -------------------------------------------------------------------------------------------- // RANDOM functionality @@ -215,4 +215,4 @@ namespace Crypto { #endif } } -} // namespace WPEFramework::Crypto +} // namespace Thunder::Crypto diff --git a/Source/cryptalgo/Random.h b/Source/cryptalgo/Random.h index ac5e1a244..90c7e9fb4 100644 --- a/Source/cryptalgo/Random.h +++ b/Source/cryptalgo/Random.h @@ -31,7 +31,7 @@ // ---- Helper types and constants ---- // ---- Helper functions ---- -namespace WPEFramework { +namespace Thunder { namespace Crypto { extern EXTERNAL void Reseed(); extern EXTERNAL void Random(uint8_t& value); diff --git a/Source/cryptalgo/SecureSocketPort.cpp b/Source/cryptalgo/SecureSocketPort.cpp index 4de7b3f2b..764b94398 100644 --- a/Source/cryptalgo/SecureSocketPort.cpp +++ b/Source/cryptalgo/SecureSocketPort.cpp @@ -47,7 +47,7 @@ namespace { } #endif -namespace WPEFramework { +namespace Thunder { namespace Crypto { @@ -240,4 +240,4 @@ void SecureSocketPort::Handler::Update() { } } -} } // namespace WPEFramework::Crypto +} } // namespace Thunder::Crypto diff --git a/Source/cryptalgo/SecureSocketPort.h b/Source/cryptalgo/SecureSocketPort.h index d92e75a8a..280a44ae3 100644 --- a/Source/cryptalgo/SecureSocketPort.h +++ b/Source/cryptalgo/SecureSocketPort.h @@ -25,7 +25,7 @@ struct x509_store_ctx_st; struct x509_st; struct ssl_st; -namespace WPEFramework { +namespace Thunder { namespace Crypto { class EXTERNAL SecureSocketPort : public Core::IResource { diff --git a/Source/extensions/localtracer/example/main.cpp b/Source/extensions/localtracer/example/main.cpp index 6e881da3f..bd81b85c1 100644 --- a/Source/extensions/localtracer/example/main.cpp +++ b/Source/extensions/localtracer/example/main.cpp @@ -8,7 +8,7 @@ MODULE_NAME_DECLARATION(BUILD_REFERENCE) -using namespace WPEFramework; +using namespace Thunder; constexpr char module[] = "LocalTraceTest"; @@ -60,7 +60,7 @@ int main(int /*argc*/, const char* argv[]) tracer.Close(); - WPEFramework::Core::Singleton::Dispose(); + Thunder::Core::Singleton::Dispose(); return 0; } diff --git a/Source/extensions/localtracer/include/localtracer/localtracer.h b/Source/extensions/localtracer/include/localtracer/localtracer.h index e7fed2dcd..c725dbed7 100644 --- a/Source/extensions/localtracer/include/localtracer/localtracer.h +++ b/Source/extensions/localtracer/include/localtracer/localtracer.h @@ -6,7 +6,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Messaging { class EXTERNAL LocalTracer { public: diff --git a/Source/extensions/privilegedrequest/example/main.cpp b/Source/extensions/privilegedrequest/example/main.cpp index f79f710a2..42072b463 100644 --- a/Source/extensions/privilegedrequest/example/main.cpp +++ b/Source/extensions/privilegedrequest/example/main.cpp @@ -24,7 +24,7 @@ MODULE_NAME_DECLARATION(BUILD_REFERENCE) -using namespace WPEFramework; +using namespace Thunder; constexpr char fileNameTemplate[] = "/tmp/shared_file_test_XXXXXX"; diff --git a/Source/extensions/privilegedrequest/include/privilegedrequest/PrivilegedRequest.h b/Source/extensions/privilegedrequest/include/privilegedrequest/PrivilegedRequest.h index 6c9739a74..68d2bfa89 100644 --- a/Source/extensions/privilegedrequest/include/privilegedrequest/PrivilegedRequest.h +++ b/Source/extensions/privilegedrequest/include/privilegedrequest/PrivilegedRequest.h @@ -32,7 +32,7 @@ #include #endif -namespace WPEFramework { +namespace Thunder { namespace Core { class PrivilegedRequest { @@ -459,4 +459,4 @@ namespace Core { Connection _link; }; } -} // Namespace WPEFramework::Core +} // Namespace Thunder::Core diff --git a/Source/extensions/processcontainers/Messaging.h b/Source/extensions/processcontainers/Messaging.h index ea6f958bf..6ce158898 100644 --- a/Source/extensions/processcontainers/Messaging.h +++ b/Source/extensions/processcontainers/Messaging.h @@ -23,7 +23,7 @@ #include "../messaging/messaging.h" -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { class EXTERNAL ProcessContainerization { @@ -68,5 +68,5 @@ namespace ProcessContainers { } // ProcessContainers -} // WPEFramework +} // Thunder diff --git a/Source/extensions/processcontainers/ProcessContainer.h b/Source/extensions/processcontainers/ProcessContainer.h index 6ebe768f2..ed5283846 100644 --- a/Source/extensions/processcontainers/ProcessContainer.h +++ b/Source/extensions/processcontainers/ProcessContainer.h @@ -21,7 +21,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { using IStringIterator = Core::IteratorType, const string>; @@ -132,4 +132,4 @@ namespace ProcessContainers { virtual IContainer* Get(const string& id) = 0; }; } // ProcessContainers -} // WPEFramework +} // Thunder diff --git a/Source/extensions/processcontainers/common/BaseAdministrator.h b/Source/extensions/processcontainers/common/BaseAdministrator.h index 5b187e9c2..67a8bcda9 100644 --- a/Source/extensions/processcontainers/common/BaseAdministrator.h +++ b/Source/extensions/processcontainers/common/BaseAdministrator.h @@ -22,7 +22,7 @@ #include "processcontainers/ProcessContainer.h" #include "processcontainers/common/BaseContainerIterator.h" -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { template @@ -106,4 +106,4 @@ namespace ProcessContainers { }; } // ProcessContainers -} // WPEFramework +} // Thunder diff --git a/Source/extensions/processcontainers/common/BaseContainerIterator.h b/Source/extensions/processcontainers/common/BaseContainerIterator.h index f736abc15..e650c2a25 100644 --- a/Source/extensions/processcontainers/common/BaseContainerIterator.h +++ b/Source/extensions/processcontainers/common/BaseContainerIterator.h @@ -22,7 +22,7 @@ #include "processcontainers/ProcessContainer.h" #include "processcontainers/common/BaseRefCount.h" -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { class BaseContainerIterator : public BaseRefCount { @@ -91,4 +91,4 @@ namespace ProcessContainers { }; } // ProcessContainers -} // WPEFramework +} // Thunder diff --git a/Source/extensions/processcontainers/common/BaseRefCount.h b/Source/extensions/processcontainers/common/BaseRefCount.h index f715e583a..65c78f028 100644 --- a/Source/extensions/processcontainers/common/BaseRefCount.h +++ b/Source/extensions/processcontainers/common/BaseRefCount.h @@ -28,7 +28,7 @@ #include "../Module.h" -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { template @@ -64,4 +64,4 @@ namespace ProcessContainers { }; } // ProcessContainers -} // WPEFramework +} // Thunder diff --git a/Source/extensions/processcontainers/common/CGroupContainerInfo.h b/Source/extensions/processcontainers/common/CGroupContainerInfo.h index 371744085..d4a6c7653 100644 --- a/Source/extensions/processcontainers/common/CGroupContainerInfo.h +++ b/Source/extensions/processcontainers/common/CGroupContainerInfo.h @@ -22,7 +22,7 @@ #include "processcontainers/ProcessContainer.h" #include "processcontainers/common/BaseRefCount.h" -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { struct CGroupMemoryInfo : public BaseRefCount { @@ -220,4 +220,4 @@ namespace ProcessContainers { }; } // ProcessContainers -} // WPEFramework +} // Thunder diff --git a/Source/extensions/processcontainers/implementations/AWCImplementation/AWC.cpp b/Source/extensions/processcontainers/implementations/AWCImplementation/AWC.cpp index aa47dde6a..be27629a8 100644 --- a/Source/extensions/processcontainers/implementations/AWCImplementation/AWC.cpp +++ b/Source/extensions/processcontainers/implementations/AWCImplementation/AWC.cpp @@ -5,7 +5,7 @@ #include "Tracing.h" -using namespace WPEFramework::ProcessContainers; +using namespace Thunder::ProcessContainers; AWCStateChangeNotifier::AWCStateChangeNotifier() : _listeners(), _mutex() {}; diff --git a/Source/extensions/processcontainers/implementations/AWCImplementation/AWC.h b/Source/extensions/processcontainers/implementations/AWCImplementation/AWC.h index ebf88701e..ec7b63c3f 100644 --- a/Source/extensions/processcontainers/implementations/AWCImplementation/AWC.h +++ b/Source/extensions/processcontainers/implementations/AWCImplementation/AWC.h @@ -4,7 +4,7 @@ #include -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { @@ -37,4 +37,4 @@ class AWCListener : public awc::AWCClient::Listener }; } /* ProcessContainers */ -} /* WPEFramework */ +} /* Thunder */ diff --git a/Source/extensions/processcontainers/implementations/AWCImplementation/AWCContainerAdministrator.cpp b/Source/extensions/processcontainers/implementations/AWCImplementation/AWCContainerAdministrator.cpp index 6e95166a7..a19a2a9fc 100644 --- a/Source/extensions/processcontainers/implementations/AWCImplementation/AWCContainerAdministrator.cpp +++ b/Source/extensions/processcontainers/implementations/AWCImplementation/AWCContainerAdministrator.cpp @@ -5,8 +5,8 @@ #include "AWCProxyContainer.h" #include "processcontainers/Tracing.h" -using namespace WPEFramework::ProcessContainers; -using namespace WPEFramework::Core; +using namespace Thunder::ProcessContainers; +using namespace Thunder::Core; PluginConfig::PluginConfig(const std::string &path): diff --git a/Source/extensions/processcontainers/implementations/AWCImplementation/AWCContainerAdministrator.h b/Source/extensions/processcontainers/implementations/AWCImplementation/AWCContainerAdministrator.h index a19ac35e1..7bbd97eba 100644 --- a/Source/extensions/processcontainers/implementations/AWCImplementation/AWCContainerAdministrator.h +++ b/Source/extensions/processcontainers/implementations/AWCImplementation/AWCContainerAdministrator.h @@ -9,7 +9,7 @@ #include "processcontainers/common/BaseAdministrator.h" #include "core/JSON.h" -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { struct PluginConfig: public Core::JSON::Container @@ -44,4 +44,4 @@ class AWCContainerAdministrator: }; } /* ProcessContainers */ -} /* WPEFramework */ +} /* Thunder */ diff --git a/Source/extensions/processcontainers/implementations/AWCImplementation/AWCContainerBase.cpp b/Source/extensions/processcontainers/implementations/AWCImplementation/AWCContainerBase.cpp index 50f5f4488..42f39bd01 100644 --- a/Source/extensions/processcontainers/implementations/AWCImplementation/AWCContainerBase.cpp +++ b/Source/extensions/processcontainers/implementations/AWCImplementation/AWCContainerBase.cpp @@ -1,6 +1,6 @@ #include "AWCContainerBase.h" -using namespace WPEFramework::ProcessContainers; +using namespace Thunder::ProcessContainers; struct AWCMemoryInfo : public BaseRefCount { AWCMemoryInfo() diff --git a/Source/extensions/processcontainers/implementations/AWCImplementation/AWCContainerBase.h b/Source/extensions/processcontainers/implementations/AWCImplementation/AWCContainerBase.h index 3736980f8..97de719f7 100644 --- a/Source/extensions/processcontainers/implementations/AWCImplementation/AWCContainerBase.h +++ b/Source/extensions/processcontainers/implementations/AWCImplementation/AWCContainerBase.h @@ -3,7 +3,7 @@ #include "common/BaseRefCount.h" #include "processcontainers/ProcessContainer.h" -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { class AWCContainerBase: @@ -21,4 +21,4 @@ class AWCContainerBase: }; } /* ProcessContainers */ -} /* WPEFramework */ +} /* Thunder */ diff --git a/Source/extensions/processcontainers/implementations/AWCImplementation/AWCImplementation.cpp b/Source/extensions/processcontainers/implementations/AWCImplementation/AWCImplementation.cpp index 87d568f7f..7cab1da72 100644 --- a/Source/extensions/processcontainers/implementations/AWCImplementation/AWCImplementation.cpp +++ b/Source/extensions/processcontainers/implementations/AWCImplementation/AWCImplementation.cpp @@ -22,7 +22,7 @@ #include "processcontainers/Tracing.h" -using namespace WPEFramework::ProcessContainers; +using namespace Thunder::ProcessContainers; AWCContainer::AWCContainer(const string& id, awc::AWCClient * client, AWCStateChangeNotifier * notifier): AWCContainerBase(id) diff --git a/Source/extensions/processcontainers/implementations/AWCImplementation/AWCImplementation.h b/Source/extensions/processcontainers/implementations/AWCImplementation/AWCImplementation.h index 98ac20278..53038f1fe 100644 --- a/Source/extensions/processcontainers/implementations/AWCImplementation/AWCImplementation.h +++ b/Source/extensions/processcontainers/implementations/AWCImplementation/AWCImplementation.h @@ -25,7 +25,7 @@ #include "AWC.h" #include "AWCContainerBase.h" -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { class AWCContainer: @@ -59,5 +59,5 @@ class AWCContainer: }; } /* ProcessContainers */ -} /* WPEFramework */ +} /* Thunder */ diff --git a/Source/extensions/processcontainers/implementations/AWCImplementation/AWCProxyContainer.cpp b/Source/extensions/processcontainers/implementations/AWCImplementation/AWCProxyContainer.cpp index a75b827ed..a2676cbb3 100644 --- a/Source/extensions/processcontainers/implementations/AWCImplementation/AWCProxyContainer.cpp +++ b/Source/extensions/processcontainers/implementations/AWCImplementation/AWCProxyContainer.cpp @@ -3,7 +3,7 @@ #define CHECK(cond) ASSERT((cond)) -using namespace WPEFramework::ProcessContainers; +using namespace Thunder::ProcessContainers; AWCProxyContainer::DBusInterface::DBusInterface( AWCProxyContainer *container): diff --git a/Source/extensions/processcontainers/implementations/AWCImplementation/AWCProxyContainer.h b/Source/extensions/processcontainers/implementations/AWCImplementation/AWCProxyContainer.h index 79b5e1e18..092ce7647 100644 --- a/Source/extensions/processcontainers/implementations/AWCImplementation/AWCProxyContainer.h +++ b/Source/extensions/processcontainers/implementations/AWCImplementation/AWCProxyContainer.h @@ -6,7 +6,7 @@ #include "AWCContainerBase.h" -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { class AWCProxyContainer: public AWCContainerBase @@ -55,4 +55,4 @@ class AWCProxyContainer: public AWCContainerBase }; } /* ProcessContainers */ -} /* WPEFramework */ +} /* Thunder */ diff --git a/Source/extensions/processcontainers/implementations/AWCImplementation/dbus/Client.cpp b/Source/extensions/processcontainers/implementations/AWCImplementation/dbus/Client.cpp index 9cc540876..a36101d0c 100644 --- a/Source/extensions/processcontainers/implementations/AWCImplementation/dbus/Client.cpp +++ b/Source/extensions/processcontainers/implementations/AWCImplementation/dbus/Client.cpp @@ -4,7 +4,7 @@ #define CHECK(cond) ASSERT((cond)) -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { namespace dbus { @@ -23,9 +23,9 @@ struct DBusCallbacks } /* dbus */ } /* ProcessContainers */ -} /* WPEFramework */ +} /* Thunder */ -using namespace WPEFramework::ProcessContainers::dbus; +using namespace Thunder::ProcessContainers::dbus; namespace { diff --git a/Source/extensions/processcontainers/implementations/AWCImplementation/dbus/Client.h b/Source/extensions/processcontainers/implementations/AWCImplementation/dbus/Client.h index 66cef851f..3062e509a 100644 --- a/Source/extensions/processcontainers/implementations/AWCImplementation/dbus/Client.h +++ b/Source/extensions/processcontainers/implementations/AWCImplementation/dbus/Client.h @@ -10,7 +10,7 @@ #include "api.h" -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { namespace dbus { @@ -123,4 +123,4 @@ struct Client } /* dbus */ } /* ProcessContainers */ -} /* WPEFramework */ +} /* Thunder */ diff --git a/Source/extensions/processcontainers/implementations/CRunImplementation/CRunImplementation.cpp b/Source/extensions/processcontainers/implementations/CRunImplementation/CRunImplementation.cpp index 567998331..c726c86b4 100644 --- a/Source/extensions/processcontainers/implementations/CRunImplementation/CRunImplementation.cpp +++ b/Source/extensions/processcontainers/implementations/CRunImplementation/CRunImplementation.cpp @@ -20,7 +20,7 @@ #include "JSON.h" #include -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { // Container administrator // ---------------------------------- @@ -306,4 +306,4 @@ namespace ProcessContainers { } // namespace ProcessContainers -} // namespace WPEFramework +} // namespace Thunder diff --git a/Source/extensions/processcontainers/implementations/CRunImplementation/CRunImplementation.h b/Source/extensions/processcontainers/implementations/CRunImplementation/CRunImplementation.h index 612aafe4b..23e651223 100644 --- a/Source/extensions/processcontainers/implementations/CRunImplementation/CRunImplementation.h +++ b/Source/extensions/processcontainers/implementations/CRunImplementation/CRunImplementation.h @@ -31,7 +31,7 @@ extern "C" { #include } -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { class CRunContainer : public BaseRefCount { diff --git a/Source/extensions/processcontainers/implementations/DobbyImplementation/DobbyImplementation.cpp b/Source/extensions/processcontainers/implementations/DobbyImplementation/DobbyImplementation.cpp index a29ae61ff..fafbda1f0 100644 --- a/Source/extensions/processcontainers/implementations/DobbyImplementation/DobbyImplementation.cpp +++ b/Source/extensions/processcontainers/implementations/DobbyImplementation/DobbyImplementation.cpp @@ -24,7 +24,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { // Container administrator @@ -227,9 +227,9 @@ namespace ProcessContainers { } else { // Dobby returns the container info as JSON, so parse it JsonObject containerInfoJson; - WPEFramework::Core::OptionalType error; - if (!WPEFramework::Core::JSON::IElement::FromString(containerInfoString, containerInfoJson, error)) { - TRACE(Trace::Warning, (_T("Failed to parse Dobby container info JSON due to: %s"), WPEFramework::Core::JSON::ErrorDisplayMessage(error).c_str())); + Thunder::Core::OptionalType error; + if (!Thunder::Core::JSON::IElement::FromString(containerInfoString, containerInfoJson, error)) { + TRACE(Trace::Warning, (_T("Failed to parse Dobby container info JSON due to: %s"), Thunder::Core::JSON::ErrorDisplayMessage(error).c_str())); } else { JsonArray pids = containerInfoJson["pids"].Array(); @@ -237,7 +237,7 @@ namespace ProcessContainers { // the container // If we're running a plugin in container, the plugin should run - // under WPEProcess. Return the WPEProcess PID if available to + // under ThunderPlugin. Return the ThunderPlugin PID if available to // ensure consistency with non-containerised oop plugins if (pids.Length() > 0) { if (pids.Length() == 1) { @@ -248,7 +248,7 @@ namespace ProcessContainers { JsonArray::Iterator index(processes.Elements()); uint32_t dobbyInitPid = 0; - uint32_t wpeProcessPid = 0; + uint32_t thunderPluginPid = 0; while (index.Next()) { if (Core::JSON::Variant::type::OBJECT == index.Current().Content()) { @@ -263,20 +263,20 @@ namespace ProcessContainers { } string executable = process["executable"].String(); - if (executable.find("WPEProcess") != std::string::npos) { - wpeProcessPid = pid; + if (executable.find("ThunderPlugin") != std::string::npos) { + thunderPluginPid = pid; break; } } } - if (wpeProcessPid == 0 && dobbyInitPid > 0) { - // We didn't find WPEProcess, just return DobbyInit + if (thunderPluginPid == 0 && dobbyInitPid > 0) { + // We didn't find ThunderPlugin, just return DobbyInit returnedPid = dobbyInitPid; _pid = returnedPid; - } else if (wpeProcessPid > 0) { - // Found WPEProcess, return its PID - returnedPid = wpeProcessPid; + } else if (thunderPluginPid > 0) { + // Found ThunderPlugin, return its PID + returnedPid = thunderPluginPid; _pid = returnedPid; } else { // Unable to determine the PID for some reason @@ -412,4 +412,4 @@ namespace ProcessContainers { } // namespace ProcessContainers -} // namespace WPEFramework +} // namespace Thunder diff --git a/Source/extensions/processcontainers/implementations/DobbyImplementation/DobbyImplementation.h b/Source/extensions/processcontainers/implementations/DobbyImplementation/DobbyImplementation.h index 9b9657772..f2cc3d315 100644 --- a/Source/extensions/processcontainers/implementations/DobbyImplementation/DobbyImplementation.h +++ b/Source/extensions/processcontainers/implementations/DobbyImplementation/DobbyImplementation.h @@ -31,7 +31,7 @@ #include -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { const string CONFIG_NAME = "/config.json"; diff --git a/Source/extensions/processcontainers/implementations/LXCImplementation/LXCImplementation.cpp b/Source/extensions/processcontainers/implementations/LXCImplementation/LXCImplementation.cpp index 4691f857c..74b6fde45 100644 --- a/Source/extensions/processcontainers/implementations/LXCImplementation/LXCImplementation.cpp +++ b/Source/extensions/processcontainers/implementations/LXCImplementation/LXCImplementation.cpp @@ -20,7 +20,7 @@ #include "LXCImplementation.h" #include "processcontainers/common/CGroupContainerInfo.h" -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { LXCNetworkInterfaceIterator::LXCNetworkInterfaceIterator(LxcContainerType* lxcContainer) : _current(UINT32_MAX) @@ -412,7 +412,7 @@ namespace ProcessContainers { uint32_t lxcresult = lxc_container_put(_lxcContainer); uint32_t retVal = BaseRefCount::Release(); - ASSERT((retval != WPEFramework::Core::ERROR_DESTRUCTION_SUCCEEDED) || (lxcresult == 1)); // if 1 is returned, lxc also released the container + ASSERT((retval != Thunder::Core::ERROR_DESTRUCTION_SUCCEEDED) || (lxcresult == 1)); // if 1 is returned, lxc also released the container return retval; } @@ -538,4 +538,4 @@ namespace ProcessContainers { constexpr uint32_t LXCContainerAdministrator::maxReadSize; } -} //namespace WPEFramework +} //namespace Thunder diff --git a/Source/extensions/processcontainers/implementations/LXCImplementation/LXCImplementation.h b/Source/extensions/processcontainers/implementations/LXCImplementation/LXCImplementation.h index 215fe9f95..b30f84cad 100644 --- a/Source/extensions/processcontainers/implementations/LXCImplementation/LXCImplementation.h +++ b/Source/extensions/processcontainers/implementations/LXCImplementation/LXCImplementation.h @@ -29,7 +29,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { using LxcContainerType = struct lxc_container; diff --git a/Source/extensions/processcontainers/implementations/RunCImplementation/RunCImplementation.cpp b/Source/extensions/processcontainers/implementations/RunCImplementation/RunCImplementation.cpp index 4b1bd752c..6cb9782c6 100644 --- a/Source/extensions/processcontainers/implementations/RunCImplementation/RunCImplementation.cpp +++ b/Source/extensions/processcontainers/implementations/RunCImplementation/RunCImplementation.cpp @@ -21,7 +21,7 @@ #include "JSON.h" #include -namespace WPEFramework { +namespace Thunder { uint32_t callRunC(Core::Process::Options& options, string* output, uint32_t timeout = Core::infinite) { @@ -328,4 +328,4 @@ namespace ProcessContainers { } // namespace ProcessContainers -} // namespace WPEFramework +} // namespace Thunder diff --git a/Source/extensions/processcontainers/implementations/RunCImplementation/RunCImplementation.h b/Source/extensions/processcontainers/implementations/RunCImplementation/RunCImplementation.h index af4e5301c..6ae6a492b 100644 --- a/Source/extensions/processcontainers/implementations/RunCImplementation/RunCImplementation.h +++ b/Source/extensions/processcontainers/implementations/RunCImplementation/RunCImplementation.h @@ -24,7 +24,7 @@ #include "processcontainers/common/BaseRefCount.h" #include "processcontainers/common/CGroupContainerInfo.h" -namespace WPEFramework { +namespace Thunder { namespace ProcessContainers { class RunCContainer : public BaseRefCount { diff --git a/Source/extensions/warningreporting/IWarningReportingMedia.h b/Source/extensions/warningreporting/IWarningReportingMedia.h index 82343567f..42af50889 100644 --- a/Source/extensions/warningreporting/IWarningReportingMedia.h +++ b/Source/extensions/warningreporting/IWarningReportingMedia.h @@ -21,7 +21,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace WarningReporting { struct EXTERNAL IWarningReportingMedia { virtual ~IWarningReportingMedia() = default; diff --git a/Source/extensions/warningreporting/WarningReportingUnit.cpp b/Source/extensions/warningreporting/WarningReportingUnit.cpp index 28cfda458..1b9b4163e 100644 --- a/Source/extensions/warningreporting/WarningReportingUnit.cpp +++ b/Source/extensions/warningreporting/WarningReportingUnit.cpp @@ -19,7 +19,7 @@ #include "WarningReportingUnit.h" -namespace WPEFramework { +namespace Thunder { namespace WarningReporting { WarningReportingUnit::WarningReportingUnit() @@ -141,15 +141,15 @@ namespace WarningReporting { void WarningReportingUnit::ReportWarningEvent(const char identifier[], const IWarningEvent& information) { - WPEFramework::Core::Messaging::Metadata metadata(WPEFramework::Core::Messaging::Metadata::type::REPORTING, information.Category(), WPEFramework::Core::Messaging::MODULE_REPORTING); - WPEFramework::Core::Messaging::MessageInfo messageInfo(metadata, WPEFramework::Core::Time::Now().Ticks()); - WPEFramework::Core::Messaging::IStore::WarningReporting report(messageInfo, identifier); + Thunder::Core::Messaging::Metadata metadata(Thunder::Core::Messaging::Metadata::type::REPORTING, information.Category(), Thunder::Core::Messaging::MODULE_REPORTING); + Thunder::Core::Messaging::MessageInfo messageInfo(metadata, Thunder::Core::Time::Now().Ticks()); + Thunder::Core::Messaging::IStore::WarningReporting report(messageInfo, identifier); string text; information.ToString(text); - WPEFramework::Messaging::TextMessage data(text); + Thunder::Messaging::TextMessage data(text); - WPEFramework::Messaging::MessageUnit::Instance().Push(report, &data); + Thunder::Messaging::MessageUnit::Instance().Push(report, &data); } } } diff --git a/Source/extensions/warningreporting/WarningReportingUnit.h b/Source/extensions/warningreporting/WarningReportingUnit.h index 3452b73d2..0ac5c0c1a 100644 --- a/Source/extensions/warningreporting/WarningReportingUnit.h +++ b/Source/extensions/warningreporting/WarningReportingUnit.h @@ -28,7 +28,7 @@ // ---- Helper types and constants ---- // ---- Helper functions ---- -namespace WPEFramework { +namespace Thunder { namespace WarningReporting { diff --git a/Source/messaging/BaseCategory.h b/Source/messaging/BaseCategory.h index 6e41e2ca8..aa30af358 100644 --- a/Source/messaging/BaseCategory.h +++ b/Source/messaging/BaseCategory.h @@ -21,7 +21,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace Messaging { diff --git a/Source/messaging/ConsoleStreamRedirect.cpp b/Source/messaging/ConsoleStreamRedirect.cpp index e6d76fb50..f20201e7c 100644 --- a/Source/messaging/ConsoleStreamRedirect.cpp +++ b/Source/messaging/ConsoleStreamRedirect.cpp @@ -20,7 +20,7 @@ #include "Module.h" #include "ConsoleStreamRedirect.h" -namespace WPEFramework { +namespace Thunder { namespace Messaging { ConsoleStandardOut::ConsoleStandardOut() diff --git a/Source/messaging/ConsoleStreamRedirect.h b/Source/messaging/ConsoleStreamRedirect.h index 5f078934c..4b0f8dba1 100644 --- a/Source/messaging/ConsoleStreamRedirect.h +++ b/Source/messaging/ConsoleStreamRedirect.h @@ -4,7 +4,7 @@ #include "Control.h" #include "OperationalCategories.h" -namespace WPEFramework { +namespace Thunder { namespace Messaging { class EXTERNAL StandardOut { public: diff --git a/Source/messaging/Control.h b/Source/messaging/Control.h index 704ce3c8b..9b40d469d 100644 --- a/Source/messaging/Control.h +++ b/Source/messaging/Control.h @@ -23,7 +23,7 @@ #include "TextMessage.h" #include "MessageUnit.h" -namespace WPEFramework { +namespace Thunder { namespace Messaging { diff --git a/Source/messaging/DirectOutput.cpp b/Source/messaging/DirectOutput.cpp index 0cf89f514..bd57d1d2a 100644 --- a/Source/messaging/DirectOutput.cpp +++ b/Source/messaging/DirectOutput.cpp @@ -19,7 +19,7 @@ #include "DirectOutput.h" -namespace WPEFramework { +namespace Thunder { namespace Messaging { diff --git a/Source/messaging/DirectOutput.h b/Source/messaging/DirectOutput.h index 188cb31d0..6de02fa40 100644 --- a/Source/messaging/DirectOutput.h +++ b/Source/messaging/DirectOutput.h @@ -21,7 +21,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace Messaging { diff --git a/Source/messaging/Logging.cpp b/Source/messaging/Logging.cpp index 602c3f35f..17854789b 100644 --- a/Source/messaging/Logging.cpp +++ b/Source/messaging/Logging.cpp @@ -21,7 +21,7 @@ #include "LoggingCategories.h" #include -namespace WPEFramework { +namespace Thunder { namespace Logging { diff --git a/Source/messaging/Logging.h b/Source/messaging/Logging.h index 091a5bad9..4f6cd1e96 100644 --- a/Source/messaging/Logging.h +++ b/Source/messaging/Logging.h @@ -25,7 +25,7 @@ #include "BaseCategory.h" #include "MessageUnit.h" -namespace WPEFramework { +namespace Thunder { namespace Logging { @@ -73,31 +73,31 @@ namespace Logging { #ifdef __WINDOWS__ #define DEFINE_LOGGING_CATEGORY(CATEGORY) \ - DEFINE_MESSAGING_CATEGORY(WPEFramework::Logging::BaseLoggingType, CATEGORY) + DEFINE_MESSAGING_CATEGORY(Thunder::Logging::BaseLoggingType, CATEGORY) #else #define DEFINE_LOGGING_CATEGORY(CATEGORY) \ - DEFINE_MESSAGING_CATEGORY(WPEFramework::Logging::BaseLoggingType, CATEGORY) \ + DEFINE_MESSAGING_CATEGORY(Thunder::Logging::BaseLoggingType, CATEGORY) \ template<> \ - EXTERNAL typename WPEFramework::Logging::BaseLoggingType::Control WPEFramework::Logging::BaseLoggingType::_control; + EXTERNAL typename Thunder::Logging::BaseLoggingType::Control Thunder::Logging::BaseLoggingType::_control; #endif -#define SYSLOG_ANNOUNCE(CATEGORY) template<> WPEFramework::Logging::BaseLoggingType::Control WPEFramework::Logging::BaseLoggingType::_control(true) +#define SYSLOG_ANNOUNCE(CATEGORY) template<> Thunder::Logging::BaseLoggingType::Control Thunder::Logging::BaseLoggingType::_control(true) #define SYSLOG(CATEGORY, PARAMETERS) \ do { \ - static_assert(std::is_base_of, CATEGORY>::value, "SYSLOG() only for Logging controls"); \ + static_assert(std::is_base_of, CATEGORY>::value, "SYSLOG() only for Logging controls"); \ if (CATEGORY::IsEnabled() == true) { \ CATEGORY __data__ PARAMETERS; \ - WPEFramework::Core::Messaging::MessageInfo __info__( \ + Thunder::Core::Messaging::MessageInfo __info__( \ CATEGORY::Metadata(), \ - WPEFramework::Core::Time::Now().Ticks() \ + Thunder::Core::Time::Now().Ticks() \ ); \ - WPEFramework::Core::Messaging::IStore::Logging __log__(__info__); \ - WPEFramework::Messaging::TextMessage __message__(__data__.Data()); \ - WPEFramework::Messaging::MessageUnit::Instance().Push(__log__, &__message__); \ + Thunder::Core::Messaging::IStore::Logging __log__(__info__); \ + Thunder::Messaging::TextMessage __message__(__data__.Data()); \ + Thunder::Messaging::MessageUnit::Instance().Push(__log__, &__message__); \ } \ } while(false) diff --git a/Source/messaging/LoggingCategories.h b/Source/messaging/LoggingCategories.h index bf586f7a4..0b0ee458d 100644 --- a/Source/messaging/LoggingCategories.h +++ b/Source/messaging/LoggingCategories.h @@ -22,7 +22,7 @@ #include "Module.h" #include "BaseCategory.h" -namespace WPEFramework { +namespace Thunder { namespace Logging { diff --git a/Source/messaging/MessageClient.cpp b/Source/messaging/MessageClient.cpp index 100300b50..3c4e4b398 100644 --- a/Source/messaging/MessageClient.cpp +++ b/Source/messaging/MessageClient.cpp @@ -19,7 +19,7 @@ #include "MessageClient.h" -namespace WPEFramework { +namespace Thunder { namespace Messaging { diff --git a/Source/messaging/MessageClient.h b/Source/messaging/MessageClient.h index 471e09930..a6e74c755 100644 --- a/Source/messaging/MessageClient.h +++ b/Source/messaging/MessageClient.h @@ -22,7 +22,7 @@ #include "Module.h" #include "MessageUnit.h" -namespace WPEFramework { +namespace Thunder { namespace Messaging { diff --git a/Source/messaging/MessageDispatcher.h b/Source/messaging/MessageDispatcher.h index e6c492220..904b444cb 100644 --- a/Source/messaging/MessageDispatcher.h +++ b/Source/messaging/MessageDispatcher.h @@ -21,7 +21,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace Messaging { diff --git a/Source/messaging/MessageUnit.cpp b/Source/messaging/MessageUnit.cpp index 1e8cd76f4..429412f69 100644 --- a/Source/messaging/MessageUnit.cpp +++ b/Source/messaging/MessageUnit.cpp @@ -20,7 +20,7 @@ #include "MessageUnit.h" #include "ConsoleStreamRedirect.h" -namespace WPEFramework { +namespace Thunder { namespace Messaging { @@ -191,7 +191,7 @@ namespace WPEFramework { } /** - * @brief Open MessageUnit. This method is used on the WPEFramework side. + * @brief Open MessageUnit. This method is used on the Thunder side. * This method: * - sets env variables, so the OOP components will get information (eg. where to place its files) * - create buffer where all InProcess components will write diff --git a/Source/messaging/MessageUnit.h b/Source/messaging/MessageUnit.h index d39bcb75a..b5a2cbd69 100644 --- a/Source/messaging/MessageUnit.h +++ b/Source/messaging/MessageUnit.h @@ -24,7 +24,7 @@ #include "TraceFactory.h" #include "DirectOutput.h" -namespace WPEFramework { +namespace Thunder { namespace Messaging { diff --git a/Source/messaging/OperationalCategories.cpp b/Source/messaging/OperationalCategories.cpp index e825c706a..ed2d0990a 100644 --- a/Source/messaging/OperationalCategories.cpp +++ b/Source/messaging/OperationalCategories.cpp @@ -19,7 +19,7 @@ #include "OperationalCategories.h" -namespace WPEFramework { +namespace Thunder { namespace OperationalStream { diff --git a/Source/messaging/OperationalCategories.h b/Source/messaging/OperationalCategories.h index a2496b697..05c7a3b98 100644 --- a/Source/messaging/OperationalCategories.h +++ b/Source/messaging/OperationalCategories.h @@ -26,23 +26,23 @@ #ifdef __WINDOWS__ #define DEFINE_OPERATIONAL_CATEGORY(CATEGORY) \ - DEFINE_MESSAGING_CATEGORY(WPEFramework::OperationalStream::BaseOperationalType, CATEGORY) + DEFINE_MESSAGING_CATEGORY(Thunder::OperationalStream::BaseOperationalType, CATEGORY) #else #define DEFINE_OPERATIONAL_CATEGORY(CATEGORY) \ - DEFINE_MESSAGING_CATEGORY(WPEFramework::OperationalStream::BaseOperationalType, CATEGORY) \ + DEFINE_MESSAGING_CATEGORY(Thunder::OperationalStream::BaseOperationalType, CATEGORY) \ template<> \ - EXTERNAL typename WPEFramework::OperationalStream::BaseOperationalType::Control \ - WPEFramework::OperationalStream::BaseOperationalType::_control; + EXTERNAL typename Thunder::OperationalStream::BaseOperationalType::Control \ + Thunder::OperationalStream::BaseOperationalType::_control; #endif #define OPERATIONAL_STREAM_ANNOUNCE(CATEGORY) \ - template<> WPEFramework::OperationalStream::BaseOperationalType::Control \ - WPEFramework::OperationalStream::BaseOperationalType::_control(true) + template<> Thunder::OperationalStream::BaseOperationalType::Control \ + Thunder::OperationalStream::BaseOperationalType::_control(true) -namespace WPEFramework { +namespace Thunder { namespace OperationalStream { diff --git a/Source/messaging/TextMessage.h b/Source/messaging/TextMessage.h index bd2c08be0..63d079e3b 100644 --- a/Source/messaging/TextMessage.h +++ b/Source/messaging/TextMessage.h @@ -21,7 +21,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace Messaging { diff --git a/Source/messaging/TraceCategories.cpp b/Source/messaging/TraceCategories.cpp index bb1d2354d..b3b34d8e5 100644 --- a/Source/messaging/TraceCategories.cpp +++ b/Source/messaging/TraceCategories.cpp @@ -23,7 +23,7 @@ #include "TraceFactory.h" #endif // __WINDOWS__ -namespace WPEFramework { +namespace Thunder { namespace Trace { diff --git a/Source/messaging/TraceCategories.h b/Source/messaging/TraceCategories.h index 09e0bba39..5d528fe12 100644 --- a/Source/messaging/TraceCategories.h +++ b/Source/messaging/TraceCategories.h @@ -22,7 +22,7 @@ #include "Module.h" #include "BaseCategory.h" -namespace WPEFramework { +namespace Thunder { namespace Trace { diff --git a/Source/messaging/TraceControl.h b/Source/messaging/TraceControl.h index e44964390..dbba135e5 100644 --- a/Source/messaging/TraceControl.h +++ b/Source/messaging/TraceControl.h @@ -35,7 +35,7 @@ #else // _THUNDER_PRODUCTION #define TRACE_CONTROL(CATEGORY) \ - WPEFramework::Messaging::LocalLifetimeType + Thunder::Messaging::LocalLifetimeType #define TRACE_ENABLED(CATEGORY) \ TRACE_CONTROL(CATEGORY)::IsEnabled() @@ -45,18 +45,18 @@ using __control__ = TRACE_CONTROL(CATEGORY); \ if (__control__::IsEnabled() == true) { \ CATEGORY __data__ PARAMETERS; \ - WPEFramework::Core::Messaging::MessageInfo __info__( \ + Thunder::Core::Messaging::MessageInfo __info__( \ __control__::Metadata(), \ - WPEFramework::Core::Time::Now().Ticks() \ + Thunder::Core::Time::Now().Ticks() \ ); \ - WPEFramework::Core::Messaging::IStore::Tracing __trace__( \ + Thunder::Core::Messaging::IStore::Tracing __trace__( \ __info__, \ __FILE__, \ __LINE__, \ - WPEFramework::Core::ClassNameOnly(typeid(*this).name()).Text() \ + Thunder::Core::ClassNameOnly(typeid(*this).name()).Text() \ ); \ - WPEFramework::Messaging::TextMessage __message__(__data__.Data()); \ - WPEFramework::Messaging::MessageUnit::Instance().Push(__trace__, &__message__); \ + Thunder::Messaging::TextMessage __message__(__data__.Data()); \ + Thunder::Messaging::MessageUnit::Instance().Push(__trace__, &__message__); \ } \ } while(false) @@ -65,33 +65,33 @@ using __control__ = TRACE_CONTROL(CATEGORY); \ if (__control__::IsEnabled() == true) { \ CATEGORY __data__ PARAMETERS; \ - WPEFramework::Core::Messaging::MessageInfo __info__( \ + Thunder::Core::Messaging::MessageInfo __info__( \ __control__::Metadata(), \ - WPEFramework::Core::Time::Now().Ticks() \ + Thunder::Core::Time::Now().Ticks() \ ); \ - WPEFramework::Core::Messaging::IStore::Tracing __trace__( \ + Thunder::Core::Messaging::IStore::Tracing __trace__( \ __info__, \ __FILE__, \ __LINE__, \ __FUNCTION__ \ ); \ - WPEFramework::Messaging::TextMessage __message__(__data__.Data()); \ - WPEFramework::Messaging::MessageUnit::Instance().Push(__trace__, &__message__); \ + Thunder::Messaging::TextMessage __message__(__data__.Data()); \ + Thunder::Messaging::MessageUnit::Instance().Push(__trace__, &__message__); \ } \ } while(false) #define TRACE_DURATION(CODE, ...) \ do { \ - WPEFramework::Core::Time start = WPEFramework::Core::Time::Now(); \ + Thunder::Core::Time start = Thunder::Core::Time::Now(); \ { CODE } \ - TRACE(WPEFramework::Trace::Duration, (start, ##__VA_ARGS__)); \ + TRACE(Thunder::Trace::Duration, (start, ##__VA_ARGS__)); \ } while(false) #define TRACE_DURATION_GLOBAL(CODE, ...) \ do { \ - WPEFramework::Core::Time start = WPEFramework::Core::Time::Now(); \ + Thunder::Core::Time start = Thunder::Core::Time::Now(); \ { CODE } \ - TRACE_GLOBAL(WPEFramework::Trace::Duration, (start, ##__VA_ARGS__)); \ + TRACE_GLOBAL(Thunder::Trace::Duration, (start, ##__VA_ARGS__)); \ } while(false) #endif // _THUNDER_PRODUCTION diff --git a/Source/messaging/TraceFactory.h b/Source/messaging/TraceFactory.h index cbdf14154..0ad014110 100644 --- a/Source/messaging/TraceFactory.h +++ b/Source/messaging/TraceFactory.h @@ -20,7 +20,7 @@ #pragma once #include "TextMessage.h" -namespace WPEFramework { +namespace Thunder { namespace Messaging { diff --git a/Source/plugins/CMakeLists.txt b/Source/plugins/CMakeLists.txt index 867b41ba7..a04db58a8 100644 --- a/Source/plugins/CMakeLists.txt +++ b/Source/plugins/CMakeLists.txt @@ -21,14 +21,14 @@ string(TOLOWER ${NAMESPACE} NAMESPACE_LIB) option(VIRTUALINPUT_TOOLS "Build VirtualInput tools" OFF) -ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IPlugin.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") -ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IShell.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") -ProxyStubGenerator(NAMESPACE "WPEFramework::Exchange" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IController.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") -ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IStateControl.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") -ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/ISubSystem.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") -ProxyStubGenerator(NAMESPACE "WPEFramework::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IDispatcher.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") - -JsonGenerator(CODE NAMESPACE WPEFramework::Exchange::Controller INPUT ${CMAKE_CURRENT_SOURCE_DIR}/IController.h OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/json" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/.." NO_INCLUDES) +ProxyStubGenerator(NAMESPACE "Thunder::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IPlugin.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") +ProxyStubGenerator(NAMESPACE "Thunder::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IShell.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") +ProxyStubGenerator(NAMESPACE "Thunder::Exchange" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IController.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") +ProxyStubGenerator(NAMESPACE "Thunder::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IStateControl.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") +ProxyStubGenerator(NAMESPACE "Thunder::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/ISubSystem.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") +ProxyStubGenerator(NAMESPACE "Thunder::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IDispatcher.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated") + +JsonGenerator(CODE NAMESPACE Thunder::Exchange::Controller INPUT ${CMAKE_CURRENT_SOURCE_DIR}/IController.h OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/json" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/.." NO_INCLUDES) file(GLOB JSON_ENUM_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/json/JsonEnum_*.cpp") file(GLOB JSON_DATA_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/json/JsonData_*.h" "${CMAKE_CURRENT_BINARY_DIR}/json/json_*.h") diff --git a/Source/plugins/Channel.cpp b/Source/plugins/Channel.cpp index 0de06471f..ed37eb03c 100644 --- a/Source/plugins/Channel.cpp +++ b/Source/plugins/Channel.cpp @@ -19,7 +19,7 @@ #include "Channel.h" -namespace WPEFramework { +namespace Thunder { namespace PluginHost { /* static */ RequestPool Channel::_requestAllocator(10); diff --git a/Source/plugins/Channel.h b/Source/plugins/Channel.h index 7ab9cf0db..3aa2c295f 100644 --- a/Source/plugins/Channel.h +++ b/Source/plugins/Channel.h @@ -23,7 +23,7 @@ #include "Module.h" #include "Request.h" -namespace WPEFramework { +namespace Thunder { namespace PluginHost { class EXTERNAL Channel : public Web::WebSocketLinkType { diff --git a/Source/plugins/Configuration.h b/Source/plugins/Configuration.h index 490058c4c..acf153ce4 100644 --- a/Source/plugins/Configuration.h +++ b/Source/plugins/Configuration.h @@ -25,7 +25,7 @@ #include "IShell.h" #include "ISubSystem.h" -namespace WPEFramework { +namespace Thunder { namespace Plugin { /** * IMPORTANT: If updating this class to add/remove/modify configuration options, ensure diff --git a/Source/plugins/IController.h b/Source/plugins/IController.h index b24fa22b6..0075ece19 100644 --- a/Source/plugins/IController.h +++ b/Source/plugins/IController.h @@ -25,7 +25,7 @@ // @stubgen:include // @stubgen:include -namespace WPEFramework { +namespace Thunder { namespace Exchange { diff --git a/Source/plugins/IDispatcher.h b/Source/plugins/IDispatcher.h index db629ec0b..8bb58b51f 100644 --- a/Source/plugins/IDispatcher.h +++ b/Source/plugins/IDispatcher.h @@ -22,7 +22,7 @@ #include -namespace WPEFramework { +namespace Thunder { namespace PluginHost { diff --git a/Source/plugins/IPlugin.h b/Source/plugins/IPlugin.h index bc918b0cb..8177de4f7 100644 --- a/Source/plugins/IPlugin.h +++ b/Source/plugins/IPlugin.h @@ -22,7 +22,7 @@ #include -namespace WPEFramework { +namespace Thunder { namespace Web { @@ -257,7 +257,7 @@ namespace PluginHost { }; } // namespace PluginHost -} // namespace WPEFramework +} // namespace Thunder #include "IShell.h" // needed for the proxy/stub generation diff --git a/Source/plugins/IShell.h b/Source/plugins/IShell.h index 5d64632b6..d8c9e5a18 100644 --- a/Source/plugins/IShell.h +++ b/Source/plugins/IShell.h @@ -25,7 +25,7 @@ #include -namespace WPEFramework { +namespace Thunder { namespace RPC { class Object; diff --git a/Source/plugins/IStateControl.h b/Source/plugins/IStateControl.h index 91c2b6d87..b00f9eacb 100644 --- a/Source/plugins/IStateControl.h +++ b/Source/plugins/IStateControl.h @@ -24,7 +24,7 @@ #include -namespace WPEFramework { +namespace Thunder { namespace PluginHost { // This interface gives direct access to change occuring on the remote object diff --git a/Source/plugins/ISubSystem.h b/Source/plugins/ISubSystem.h index bcb716b30..253d9d4f8 100644 --- a/Source/plugins/ISubSystem.h +++ b/Source/plugins/ISubSystem.h @@ -22,7 +22,7 @@ #include -namespace WPEFramework { +namespace Thunder { namespace PluginHost { struct EXTERNAL IMetadata : virtual public Core::IUnknown { diff --git a/Source/plugins/IVirtualInput.h b/Source/plugins/IVirtualInput.h index f7aeee504..cca82d8ee 100644 --- a/Source/plugins/IVirtualInput.h +++ b/Source/plugins/IVirtualInput.h @@ -21,7 +21,7 @@ #include -namespace WPEFramework { +namespace Thunder { namespace IVirtualInput { @@ -82,4 +82,4 @@ namespace IVirtualInput { } // namespace IVirtualInput -} // namespace WPEFramework +} // namespace Thunder diff --git a/Source/plugins/JSONRPC.cpp b/Source/plugins/JSONRPC.cpp index a079eb002..33ab28c38 100644 --- a/Source/plugins/JSONRPC.cpp +++ b/Source/plugins/JSONRPC.cpp @@ -19,7 +19,7 @@ #include "JSONRPC.h" -namespace WPEFramework { +namespace Thunder { namespace PluginHost { diff --git a/Source/plugins/JSONRPC.h b/Source/plugins/JSONRPC.h index 93969db2a..6e6cb0ab1 100644 --- a/Source/plugins/JSONRPC.h +++ b/Source/plugins/JSONRPC.h @@ -25,7 +25,7 @@ #include "IPlugin.h" #include "IDispatcher.h" -namespace WPEFramework { +namespace Thunder { namespace PluginHost { @@ -1015,5 +1015,5 @@ namespace PluginHost { StatusCallbackMap _observers; }; -} // namespace WPEFramework::PluginHost +} // namespace Thunder::PluginHost } diff --git a/Source/plugins/Metadata.cpp b/Source/plugins/Metadata.cpp index 12ccae96e..f116b861d 100644 --- a/Source/plugins/Metadata.cpp +++ b/Source/plugins/Metadata.cpp @@ -22,7 +22,7 @@ #include "IStateControl.h" #include "ISubSystem.h" -namespace WPEFramework { +namespace Thunder { ENUM_CONVERSION_BEGIN(PluginHost::ISubSystem::IInternet::network_type) diff --git a/Source/plugins/Metadata.h b/Source/plugins/Metadata.h index 889b9c847..569af6050 100644 --- a/Source/plugins/Metadata.h +++ b/Source/plugins/Metadata.h @@ -26,7 +26,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace PluginHost { // Status information diff --git a/Source/plugins/Request.h b/Source/plugins/Request.h index bc423391b..72f9df83f 100644 --- a/Source/plugins/Request.h +++ b/Source/plugins/Request.h @@ -23,7 +23,7 @@ #include "Module.h" #include "Config.h" -namespace WPEFramework { +namespace Thunder { namespace PluginHost { // Forward declaration. We only have a smart pointer to a service. diff --git a/Source/plugins/Service.cpp b/Source/plugins/Service.cpp index 1e0a91434..c2cfa59fb 100644 --- a/Source/plugins/Service.cpp +++ b/Source/plugins/Service.cpp @@ -20,7 +20,7 @@ #include "Service.h" #include "Channel.h" -namespace WPEFramework { +namespace Thunder { namespace PluginHost { diff --git a/Source/plugins/Service.h b/Source/plugins/Service.h index 06cebe18b..fd559447a 100644 --- a/Source/plugins/Service.h +++ b/Source/plugins/Service.h @@ -27,7 +27,7 @@ #include "IPlugin.h" #include "IShell.h" -namespace WPEFramework { +namespace Thunder { namespace PluginHost { class EXTERNAL Service : public IShell { diff --git a/Source/plugins/Shell.cpp b/Source/plugins/Shell.cpp index 7f0220e03..2739b4c95 100644 --- a/Source/plugins/Shell.cpp +++ b/Source/plugins/Shell.cpp @@ -21,7 +21,7 @@ #include "IShell.h" #include "Configuration.h" -namespace WPEFramework { +namespace Thunder { namespace PluginHost { diff --git a/Source/plugins/Shell.h b/Source/plugins/Shell.h index 73b02ee7c..8f32dbcf7 100644 --- a/Source/plugins/Shell.h +++ b/Source/plugins/Shell.h @@ -22,7 +22,7 @@ #include "Module.h" #include "IShell.h" -namespace WPEFramework { +namespace Thunder { ENUM_CONVERSION_HANDLER(PluginHost::IShell::reason) ENUM_CONVERSION_HANDLER(PluginHost::IShell::state) diff --git a/Source/plugins/StateControl.cpp b/Source/plugins/StateControl.cpp index 9d3ece411..3e67115c2 100644 --- a/Source/plugins/StateControl.cpp +++ b/Source/plugins/StateControl.cpp @@ -20,7 +20,7 @@ #include "Module.h" #include "IStateControl.h" -namespace WPEFramework { +namespace Thunder { ENUM_CONVERSION_BEGIN(PluginHost::IStateControl::state) diff --git a/Source/plugins/StateControl.h b/Source/plugins/StateControl.h index da493203a..99854a1bf 100644 --- a/Source/plugins/StateControl.h +++ b/Source/plugins/StateControl.h @@ -22,7 +22,7 @@ #include "Module.h" #include "IStateControl.h" -namespace WPEFramework { +namespace Thunder { ENUM_CONVERSION_HANDLER(PluginHost::IStateControl::command) ENUM_CONVERSION_HANDLER(PluginHost::IStateControl::state) diff --git a/Source/plugins/SubSystem.cpp b/Source/plugins/SubSystem.cpp index a1d6f2536..312a6809c 100644 --- a/Source/plugins/SubSystem.cpp +++ b/Source/plugins/SubSystem.cpp @@ -20,6 +20,6 @@ #include "Module.h" #include "ISubSystem.h" -namespace WPEFramework { +namespace Thunder { -} // namespace WPEFramework +} // namespace Thunder diff --git a/Source/plugins/SubSystem.h b/Source/plugins/SubSystem.h index 808c46a06..abacbecfb 100644 --- a/Source/plugins/SubSystem.h +++ b/Source/plugins/SubSystem.h @@ -22,7 +22,7 @@ #include "Module.h" #include "ISubSystem.h" -namespace WPEFramework { +namespace Thunder { ENUM_CONVERSION_HANDLER(PluginHost::ISubSystem::subsystem) diff --git a/Source/plugins/System.cpp b/Source/plugins/System.cpp index 9df6ce147..fdb4303c3 100644 --- a/Source/plugins/System.cpp +++ b/Source/plugins/System.cpp @@ -19,7 +19,7 @@ #include "System.h" -namespace WPEFramework { +namespace Thunder { namespace PluginHost { diff --git a/Source/plugins/System.h b/Source/plugins/System.h index 4ebc2318b..d556e5b4b 100644 --- a/Source/plugins/System.h +++ b/Source/plugins/System.h @@ -21,7 +21,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace PluginHost { class EXTERNAL IFactories { diff --git a/Source/plugins/Types.h b/Source/plugins/Types.h index bf84fae77..1c37a9f86 100644 --- a/Source/plugins/Types.h +++ b/Source/plugins/Types.h @@ -23,7 +23,7 @@ #include "IPlugin.h" #include "IShell.h" -namespace WPEFramework { +namespace Thunder { namespace PluginHost { template diff --git a/Source/plugins/VirtualInput.cpp b/Source/plugins/VirtualInput.cpp index 7e631ea2b..95bb2bd65 100644 --- a/Source/plugins/VirtualInput.cpp +++ b/Source/plugins/VirtualInput.cpp @@ -19,7 +19,7 @@ #include "VirtualInput.h" -namespace WPEFramework { +namespace Thunder { ENUM_CONVERSION_BEGIN(PluginHost::VirtualInput::KeyMap::modifier) diff --git a/Source/plugins/VirtualInput.h b/Source/plugins/VirtualInput.h index 813a1e73e..eba33d145 100644 --- a/Source/plugins/VirtualInput.h +++ b/Source/plugins/VirtualInput.h @@ -25,7 +25,7 @@ #include "Module.h" #include "IVirtualInput.h" -namespace WPEFramework { +namespace Thunder { namespace PluginHost { class EXTERNAL VirtualInput { @@ -970,6 +970,6 @@ namespace Core { } // namespace Core -} // namespace WPEFramework +} // namespace Thunder #endif // __VIRTUAL_INPUT__ diff --git a/Source/plugins/plugins.vcxproj b/Source/plugins/plugins.vcxproj index fb5dca29d..378a1e795 100755 --- a/Source/plugins/plugins.vcxproj +++ b/Source/plugins/plugins.vcxproj @@ -181,7 +181,7 @@ - python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" --no-includes --keep-empty -c --namespace WPEFramework::Exchange::Controller -o "$(ProjectDir)/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" --no-includes --keep-empty -c --namespace Thunder::Exchange::Controller -o "$(ProjectDir)/json" "%(FullPath)" --force JSON Generated Code @@ -220,7 +220,7 @@ - python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" --no-includes --keep-empty -c --namespace WPEFramework::Exchange::Controller -o "$(ProjectDir)/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" --no-includes --keep-empty -c --namespace Thunder::Exchange::Controller -o "$(ProjectDir)/json" "%(FullPath)" --force JSON Generated Code @@ -259,7 +259,7 @@ - python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" --no-includes --keep-empty -c --namespace WPEFramework::Exchange::Controller -o "$(ProjectDir)/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" --no-includes --keep-empty -c --namespace Thunder::Exchange::Controller -o "$(ProjectDir)/json" "%(FullPath)" --force JSON Generated Code @@ -302,7 +302,7 @@ - python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" --no-includes --keep-empty -c --namespace WPEFramework::Exchange::Controller -o "$(ProjectDir)/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" --no-includes --keep-empty -c --namespace Thunder::Exchange::Controller -o "$(ProjectDir)/json" "%(FullPath)" --force JSON Generated Code diff --git a/Source/plugins/proxystubs.vcxproj b/Source/plugins/proxystubs.vcxproj index ab45b6480..9700f2f23 100644 --- a/Source/plugins/proxystubs.vcxproj +++ b/Source/plugins/proxystubs.vcxproj @@ -129,7 +129,7 @@ $(IntDir)$(TargetName).pdb - python "$(ToolPath)\ProxyStubGenerator\StubGenerator.py" --namespace WPEFramework --outdir "$(SolutionDir)..\artifacts\generated\$(ProjectName)" "$(ProjectDir)IPlugin.h" "$(ProjectDir)IShell.h" "$(ProjectDir)IController.h" "$(ProjectDir)IStateControl.h" "$(ProjectDir)ISubSystem.h" "$(ProjectDir)IDispatcher.h" -I "$(ProjectDir)\.." + python "$(ToolPath)\ProxyStubGenerator\StubGenerator.py" --namespace Thunder --outdir "$(SolutionDir)..\artifacts\generated\$(ProjectName)" "$(ProjectDir)IPlugin.h" "$(ProjectDir)IShell.h" "$(ProjectDir)IController.h" "$(ProjectDir)IStateControl.h" "$(ProjectDir)ISubSystem.h" "$(ProjectDir)IDispatcher.h" -I "$(ProjectDir)\.." @@ -153,7 +153,7 @@ $(IntDir)$(TargetName).pdb - python "$(ToolPath)\ProxyStubGenerator\StubGenerator.py" --namespace WPEFramework --outdir "$(SolutionDir)..\artifacts\generated\$(ProjectName)" "$(ProjectDir)IPlugin.h" "$(ProjectDir)IShell.h" "$(ProjectDir)IController.h" "$(ProjectDir)IStateControl.h" "$(ProjectDir)ISubSystem.h" "$(ProjectDir)IDispatcher.h" -I "$(ProjectDir)\.." + python "$(ToolPath)\ProxyStubGenerator\StubGenerator.py" --namespace Thunder --outdir "$(SolutionDir)..\artifacts\generated\$(ProjectName)" "$(ProjectDir)IPlugin.h" "$(ProjectDir)IShell.h" "$(ProjectDir)IController.h" "$(ProjectDir)IStateControl.h" "$(ProjectDir)ISubSystem.h" "$(ProjectDir)IDispatcher.h" -I "$(ProjectDir)\.." @@ -177,7 +177,7 @@ $(IntDir)$(TargetName).pdb - python "$(ToolPath)\ProxyStubGenerator\StubGenerator.py" --namespace WPEFramework --outdir "$(SolutionDir)..\artifacts\generated\$(ProjectName)" "$(ProjectDir)IPlugin.h" "$(ProjectDir)IShell.h" "$(ProjectDir)IController.h" "$(ProjectDir)IStateControl.h" "$(ProjectDir)ISubSystem.h" "$(ProjectDir)IDispatcher.h" -I "$(ProjectDir)\.." + python "$(ToolPath)\ProxyStubGenerator\StubGenerator.py" --namespace Thunder --outdir "$(SolutionDir)..\artifacts\generated\$(ProjectName)" "$(ProjectDir)IPlugin.h" "$(ProjectDir)IShell.h" "$(ProjectDir)IController.h" "$(ProjectDir)IStateControl.h" "$(ProjectDir)ISubSystem.h" "$(ProjectDir)IDispatcher.h" -I "$(ProjectDir)\.." @@ -205,7 +205,7 @@ $(IntDir)$(TargetName).pdb - python "$(ToolPath)\ProxyStubGenerator\StubGenerator.py" --namespace WPEFramework --outdir "$(SolutionDir)..\artifacts\generated\$(ProjectName)" "$(ProjectDir)IPlugin.h" "$(ProjectDir)IShell.h" "$(ProjectDir)IController.h" "$(ProjectDir)IStateControl.h" "$(ProjectDir)ISubSystem.h" "$(ProjectDir)IDispatcher.h" -I "$(ProjectDir)\.." + python "$(ToolPath)\ProxyStubGenerator\StubGenerator.py" --namespace Thunder --outdir "$(SolutionDir)..\artifacts\generated\$(ProjectName)" "$(ProjectDir)IPlugin.h" "$(ProjectDir)IShell.h" "$(ProjectDir)IController.h" "$(ProjectDir)IStateControl.h" "$(ProjectDir)ISubSystem.h" "$(ProjectDir)IDispatcher.h" -I "$(ProjectDir)\.." diff --git a/Source/websocket/JSONRPCLink.cpp b/Source/websocket/JSONRPCLink.cpp index dd006f707..aa72c9bdf 100644 --- a/Source/websocket/JSONRPCLink.cpp +++ b/Source/websocket/JSONRPCLink.cpp @@ -19,13 +19,13 @@ #include "JSONRPCLink.h" -namespace WPEFramework { +namespace Thunder { -ENUM_CONVERSION_BEGIN(WPEFramework::JSONRPC::JSONPluginState) +ENUM_CONVERSION_BEGIN(Thunder::JSONRPC::JSONPluginState) - { WPEFramework::JSONRPC::DEACTIVATED, _TXT("Deactivated") }, - { WPEFramework::JSONRPC::ACTIVATED, _TXT("Activated") }, + { Thunder::JSONRPC::DEACTIVATED, _TXT("Deactivated") }, + { Thunder::JSONRPC::ACTIVATED, _TXT("Activated") }, -ENUM_CONVERSION_END(WPEFramework::JSONRPC::JSONPluginState) +ENUM_CONVERSION_END(Thunder::JSONRPC::JSONPluginState) } diff --git a/Source/websocket/JSONRPCLink.h b/Source/websocket/JSONRPCLink.h index 723acd5e6..b2cbbe67c 100644 --- a/Source/websocket/JSONRPCLink.h +++ b/Source/websocket/JSONRPCLink.h @@ -22,7 +22,7 @@ #include "Module.h" #include "WebSocketLink.h" -namespace WPEFramework { +namespace Thunder { namespace JSONRPC { @@ -1491,4 +1491,4 @@ namespace WPEFramework { string _callsign; }; } -} // namespace WPEFramework::JSONRPC +} // namespace Thunder::JSONRPC diff --git a/Source/websocket/JSONWebToken.cpp b/Source/websocket/JSONWebToken.cpp index 9bf3efe0b..ab384ade9 100644 --- a/Source/websocket/JSONWebToken.cpp +++ b/Source/websocket/JSONWebToken.cpp @@ -19,7 +19,7 @@ #include "JSONWebToken.h" -namespace WPEFramework { +namespace Thunder { ENUM_CONVERSION_BEGIN(Web::JSONWebToken::mode) @@ -193,4 +193,4 @@ namespace Web } return (result); } -} } // namespace WPEFramework::Web +} } // namespace Thunder::Web diff --git a/Source/websocket/JSONWebToken.h b/Source/websocket/JSONWebToken.h index 09108b39d..3ade28a4e 100644 --- a/Source/websocket/JSONWebToken.h +++ b/Source/websocket/JSONWebToken.h @@ -22,7 +22,7 @@ #include "Module.h" #include "URL.h" -namespace WPEFramework { +namespace Thunder { namespace Web { class EXTERNAL JSONWebToken { @@ -55,4 +55,4 @@ namespace Web { string _key; }; -} } // namespace WPEFramework::Web +} } // namespace Thunder::Web diff --git a/Source/websocket/URL.cpp b/Source/websocket/URL.cpp index 77764db35..3ea211c76 100644 --- a/Source/websocket/URL.cpp +++ b/Source/websocket/URL.cpp @@ -19,7 +19,7 @@ #include "URL.h" -namespace WPEFramework { +namespace Thunder { ENUM_CONVERSION_BEGIN(URL::SchemeType) diff --git a/Source/websocket/URL.h b/Source/websocket/URL.h index f201343b6..54193fed6 100644 --- a/Source/websocket/URL.h +++ b/Source/websocket/URL.h @@ -21,7 +21,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace Core { diff --git a/Source/websocket/WebLink.h b/Source/websocket/WebLink.h index ceda36ed9..354937db6 100644 --- a/Source/websocket/WebLink.h +++ b/Source/websocket/WebLink.h @@ -26,7 +26,7 @@ #include "WebSerializer.h" #include "WebTransform.h" -namespace WPEFramework { +namespace Thunder { namespace Web { template class WebLinkType { diff --git a/Source/websocket/WebRequest.h b/Source/websocket/WebRequest.h index b4a17fd90..d8057216f 100644 --- a/Source/websocket/WebRequest.h +++ b/Source/websocket/WebRequest.h @@ -22,7 +22,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace Web { using ProtocolsArray = Core::TokenizedStringList<',', true>; diff --git a/Source/websocket/WebResponse.h b/Source/websocket/WebResponse.h index aa51ea776..71be15219 100644 --- a/Source/websocket/WebResponse.h +++ b/Source/websocket/WebResponse.h @@ -24,7 +24,7 @@ #include "URL.h" #include "WebRequest.h" -namespace WPEFramework { +namespace Thunder { namespace Web { enum WebStatus { STATUS_CONTINUE = 100, diff --git a/Source/websocket/WebSerializer.cpp b/Source/websocket/WebSerializer.cpp index 82ce1815c..5456f0a4d 100644 --- a/Source/websocket/WebSerializer.cpp +++ b/Source/websocket/WebSerializer.cpp @@ -19,7 +19,7 @@ #include "WebSerializer.h" -namespace WPEFramework { +namespace Thunder { namespace Web { /* static */ const TCHAR* Request::GET = _T("GET"); @@ -90,7 +90,7 @@ static const TCHAR __CHARACTER_SET[] = _T("CHARSET="); #define __TXT(KeyWord) KeyWord, (sizeof(KeyWord) / sizeof(TCHAR)) - 1 -namespace WPEFramework { +namespace Thunder { ENUM_CONVERSION_BEGIN(Web::MIMETypes) diff --git a/Source/websocket/WebSerializer.h b/Source/websocket/WebSerializer.h index 28a123813..a0f121901 100644 --- a/Source/websocket/WebSerializer.h +++ b/Source/websocket/WebSerializer.h @@ -23,7 +23,7 @@ #include "WebRequest.h" #include "WebResponse.h" -namespace WPEFramework { +namespace Thunder { namespace Web { class EXTERNAL TextBody : public string, public IBody { diff --git a/Source/websocket/WebSocketLink.cpp b/Source/websocket/WebSocketLink.cpp index a35b4579a..ac6e2fda6 100644 --- a/Source/websocket/WebSocketLink.cpp +++ b/Source/websocket/WebSocketLink.cpp @@ -19,7 +19,7 @@ #include "WebSocketLink.h" -namespace WPEFramework { +namespace Thunder { namespace Web { namespace WebSocket { static RequestAllocator _requestAllocator; diff --git a/Source/websocket/WebSocketLink.h b/Source/websocket/WebSocketLink.h index 1ac56fd16..728cf73ec 100644 --- a/Source/websocket/WebSocketLink.h +++ b/Source/websocket/WebSocketLink.h @@ -24,7 +24,7 @@ #include "WebRequest.h" #include "WebResponse.h" -namespace WPEFramework { +namespace Thunder { namespace Web { namespace WebSocket { class EXTERNAL Protocol { @@ -1435,4 +1435,4 @@ POP_WARNING() Handler _channel; }; } -} // namespace WPEFramework.Web +} // namespace Thunder.Web diff --git a/Source/websocket/WebTransfer.h b/Source/websocket/WebTransfer.h index 94f81ac1c..68a1dad24 100644 --- a/Source/websocket/WebTransfer.h +++ b/Source/websocket/WebTransfer.h @@ -25,7 +25,7 @@ #include "WebLink.h" #include "WebSerializer.h" -namespace WPEFramework { +namespace Thunder { namespace Web { template class SingleElementFactoryType { diff --git a/Source/websocket/WebTransform.h b/Source/websocket/WebTransform.h index 72578b7df..dd4d67e93 100644 --- a/Source/websocket/WebTransform.h +++ b/Source/websocket/WebTransform.h @@ -22,7 +22,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace Web { class NoTransform { public: diff --git a/Tests/comrpctester/comprc-test-config.json b/Tests/comrpctester/comprc-test-config.json index 9a45b5821..3bc976062 100644 --- a/Tests/comrpctester/comprc-test-config.json +++ b/Tests/comrpctester/comprc-test-config.json @@ -6,11 +6,11 @@ "idletime": 180, "softkillcheckwaittime": 10, "hardkillcheckwaittime": 4, - "persistentpath": "/home/bram/Projects/metrological/Thunder/install/var/wpeframework/WPEFramework", + "persistentpath": "/home/bram/Projects/metrological/Thunder/install/var/thunder/Thunder", "volatilepath": "/tmp", - "datapath": "/home/bram/Projects/metrological/Thunder/install/usr/share/WPEFramework", - "systempath": "/home/bram/Projects/metrological/Thunder/install/usr/lib/wpeframework/plugins", - "proxystubpath": "/home/bram/Projects/metrological/Thunder/install/usr/lib/wpeframework/proxystubs", + "datapath": "/home/bram/Projects/metrological/Thunder/install/usr/share/Thunder", + "systempath": "/home/bram/Projects/metrological/Thunder/install/usr/lib/thunder/plugins", + "proxystubpath": "/home/bram/Projects/metrological/Thunder/install/usr/lib/thunder/proxystubs", "postmortempath": "/opt/minidumps", "redirect": "/Service/Controller/UI", "communicator": "127.0.0.1:62000", diff --git a/Tests/comrpctester/main.cpp b/Tests/comrpctester/main.cpp index bfb31f909..2570147cf 100644 --- a/Tests/comrpctester/main.cpp +++ b/Tests/comrpctester/main.cpp @@ -1,693 +1,693 @@ -#define MODULE_NAME COMHacker - -#include -#include - -#include - -MODULE_NAME_DECLARATION(BUILD_REFERENCE) - -constexpr char installPath[] = "/home/bram/Projects/metrological/Thunder/install/"; - -using namespace WPEFramework; - -class Message : public Core::FrameType { -private: - using BaseClass = Core::FrameType; - -public: - static constexpr uint8_t SIZE_OFFSET = 0; - static constexpr uint8_t MESSAGE_ID_OFFSET = (SIZE_OFFSET + sizeof(uint8_t)); // 1 - static constexpr uint8_t IMPLEMENTATION_OFFSET = (MESSAGE_ID_OFFSET + sizeof(uint8_t)); // 2 - - Message() = delete; - - Message(const uint16_t length, uint8_t data[]) - { - Clear(); - SetBuffer(0, length, data); - } - - Message(const uint8_t type) - : BaseClass() - { - Clear(); - SetNumber(MESSAGE_ID_OFFSET, SetMessageType(operator[](MESSAGE_ID_OFFSET), type)); - } - ~Message() = default; - - uint32_t Finish(int offset = 0) - { - operator[](SIZE_OFFSET) = (Size() - 1) + offset; - return operator[](SIZE_OFFSET); - } - -private: - constexpr uint8_t SetMessageType(const uint8_t field, const uint8_t type) - { - return (field & ~0xFE) | ((type << 1) & 0xFE); - } -}; - -class BinaryConnector : public Core::SocketStream { -public: - BinaryConnector() = delete; - BinaryConnector(BinaryConnector&&) = delete; - BinaryConnector(const BinaryConnector&) = delete; - BinaryConnector& operator=(BinaryConnector&&) = delete; - BinaryConnector& operator=(const BinaryConnector&) = delete; - - BinaryConnector(const Core::NodeId& remoteNode) - : Core::SocketStream(false, remoteNode.AnyInterface(), remoteNode, 1024, 1024) - , _adminLock() - , _loaded(0) - , _signal(false, true) - { - } - ~BinaryConnector() override = default; - -public: - uint32_t WaitForResponse(const uint32_t waitTime) - { - return _signal.Lock(waitTime); - } - - uint16_t Submit(const uint16_t length, const uint8_t buffer[]) - { - msleep(3); - _adminLock.Lock(); - uint16_t result = std::min(static_cast(sizeof(_buffer) - _loaded), length); - ::memmove(&(_buffer[_loaded]), buffer, result); - bool initialDrop = (_loaded == 0); - _loaded += result; - _adminLock.Unlock(); - - if (initialDrop == true) { - Trigger(); - } - - return (result); - } - -private: - // Methods to extract and insert data into the socket buffers - uint16_t SendData(uint8_t* dataFrame, const uint16_t maxSendSize) override - { - uint16_t result = 0; - _adminLock.Lock(); - if (_loaded > 0) { - result = std::min(maxSendSize, _loaded); - ::memcpy(dataFrame, _buffer, result); - if (result == _loaded) { - _loaded = 0; - } else { - ::memmove(_buffer, &(_buffer[result]), (_loaded - result)); - _loaded -= result; - } - // Dump("Send", result, dataFrame); - } - _adminLock.Unlock(); - return (result); - } - uint16_t ReceiveData(uint8_t* dataFrame, const uint16_t receivedSize) override - { - if (receivedSize == 0) { - printf("Received is called without any data!\n"); - } else { - // Dump("Received", receivedSize, dataFrame); - } - - _signal.SetEvent(); - - return (receivedSize); - } - - // Signal a state change, Opened, Closed or Accepted - void StateChange() override - { - _adminLock.Lock(); - - printf("StateChange called. Open = [%s]\n", IsOpen() ? _T("true") : _T("false")); - - _adminLock.Unlock(); - } - -private: - int msleep(long msec) - { - struct timespec ts; - int res; - - if (msec < 0) { - errno = EINVAL; - return -1; - } - - ts.tv_sec = msec / 1000; - ts.tv_nsec = (msec % 1000) * 1000000; - - do { - res = nanosleep(&ts, &ts); - } while (res && errno == EINTR); - - return res; - } - - void Dump(const TCHAR prefix[], const uint16_t length, const uint8_t dataFrame[]) - { - _adminLock.Lock(); - - printf("%s [%d]:\n ", prefix, length); - - printf("\t0\t1\t2\t3\t4\t5\t6\t7"); - - if (length > 1) { - for (uint16_t index = 0; index < (length - 1); index++) { - if ((index % 8 == 0)) - printf("\n 0x%04X\t", index); - printf("%02X\t", dataFrame[index]); - } - } - printf("%02X\n", dataFrame[length - 1]); - - _adminLock.Unlock(); - } - -private: - Core::CriticalSection _adminLock; - uint16_t _loaded; - uint8_t _buffer[1024]; - Core::Event _signal; -}; - -class InvokeMessage : public Message { - static constexpr uint8_t ID = 2; - -public: - static constexpr uint8_t INTERFACEID_OFFSET = (IMPLEMENTATION_OFFSET + sizeof(Core::instance_id)); - static constexpr uint8_t METHODEID_OFFSET = (INTERFACEID_OFFSET + sizeof(uint32_t)); - -public: - InvokeMessage(/* args */) - : Message(ID) - { - } - - ~InvokeMessage(){}; - -private: -}; - -class AnnounceMessage : public Message { - static constexpr uint8_t ID = 1; - -public: - static constexpr uint8_t ID_OFFSET = (IMPLEMENTATION_OFFSET + sizeof(Core::instance_id)); - static constexpr uint8_t INTERFACEID_OFFSET = (ID_OFFSET + sizeof(uint32_t)); - static constexpr uint8_t EXCHANGEID_OFFSET = (INTERFACEID_OFFSET + sizeof(uint32_t)); - static constexpr uint8_t VERSIONID_OFFSET = (EXCHANGEID_OFFSET + sizeof(uint32_t)); - static constexpr uint8_t TYPE_OFFSET = (VERSIONID_OFFSET + sizeof(uint32_t)); - static constexpr uint8_t STRINGS_OFFSET = (TYPE_OFFSET + sizeof(uint8_t)); - -public: - AnnounceMessage(/* args */) - : Message(ID) - { - } - - ~AnnounceMessage(){}; - -private: -}; - -class ThunderWrapper : public Core::Thread { -public: - struct ICallback { - virtual ~ICallback() = default; - virtual void Signal(const int signo) const = 0; - }; - - class KeyMonitor : public Core::IResource { - public: - typedef void (*onKeyPress)(const char key); - - KeyMonitor(int fd, onKeyPress callback) - : _fd(dup(fd)) - , _callback(callback) - { - _origFlags = fcntl(_fd, F_GETFL, 0); - fcntl(_fd, F_SETFL, (_origFlags | O_NONBLOCK | O_CLOEXEC)); - - // get original cooked/canonical mode values - tcgetattr(fd, &_origMode); - // set options for raw mode - struct termios raw = _origMode; - - raw.c_lflag &= ~(ICANON); - - tcsetattr(fd, TCSANOW, &raw); - } - ~KeyMonitor() - { - // restore original mode - tcsetattr(_fd, TCSANOW, &_origMode); - fcntl(_fd, F_SETFL, _origFlags); - close(_fd); - }; - - KeyMonitor(KeyMonitor&&) = delete; - KeyMonitor(const KeyMonitor&) = delete; - KeyMonitor& operator=(KeyMonitor&&) = delete; - KeyMonitor& operator=(const KeyMonitor&) = delete; - - Core::IResource::handle Descriptor() const override - { - return _fd; - } - - uint16_t Events() override - { - // We are interested in receiving data from the process - return (POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI); - } - - void Handle(const uint16_t events) override - { - // Got some data from the process - if ((events & POLLIN) != 0) { - // Read data from the fd - char buffer; - - memset(&buffer, 0, sizeof(buffer)); - - int n = read(Descriptor(), &buffer, sizeof(buffer)); - - // For the example, just print the received data - // printf("[%s]: %c\n", Core::Time::Now().ToRFC1123().c_str(), buffer); - - if ((n > 0) && (_callback != nullptr)) { - _callback(buffer); - } - } - } - - private: - const int _fd; - int _origFlags; - struct termios _origMode; - onKeyPress _callback; - }; - - class ProcessOutputMonitor : public Core::IResource { - public: - ProcessOutputMonitor(uint32_t pid, int fd) - : _pid(pid) - , _fd(fd) - { - } - ~ProcessOutputMonitor() = default; - - ProcessOutputMonitor(ProcessOutputMonitor&&) = delete; - ProcessOutputMonitor(const ProcessOutputMonitor&) = delete; - ProcessOutputMonitor& operator=(ProcessOutputMonitor&&) = delete; - ProcessOutputMonitor& operator=(const ProcessOutputMonitor&) = delete; - - Core::IResource::handle Descriptor() const override - { - return _fd; - } - - uint16_t Events() override - { - // We are interested in receiving data from the process - return (POLLIN); - } - - void Handle(const uint16_t events) override - { - // Got some data from the process - if ((events & POLLIN) != 0) { - // Read data from the fd - ssize_t ret; - std::string output; - char buffer[1024] = {}; - - do { - ret = read(_fd, buffer, sizeof(buffer)); - if (ret < 0 && errno != EWOULDBLOCK) { - printf("Error %d reading from process output\n", errno); - } else if (ret > 0) { - output += buffer; - } - } while (ret > 0); - - // For the example, just print the received data - printf("[PID: %d][%s]: %s", _pid, Core::Time::Now().ToRFC1123().c_str(), output.c_str()); - } - } - - private: - const uint32_t _pid; - const int _fd; - }; - - ThunderWrapper(const string& installPath, const ICallback& callback) - : Core::Thread(Thread::DefaultStackSize(), "ThunderWrapper") - , _thunder(true) - , _options(installPath + string("/usr/bin/WPEFramework")) - , _callback(callback) - { - FixLDLibraryPaths(installPath + string("/usr/lib")); - - _options.Add("-c").Add(installPath + string("/etc/WPEFramework/config.json")); - - struct sigaction sa; - - memset(&sa, 0, sizeof(struct sigaction)); - - sa.sa_handler = &SignalHandler; - - if (sigaction(SIGINT, &sa, NULL) == -1) { - printf("Failed to initialize signal handler...\n"); - abort(); - } - - Thread::Init(); - } - - ~ThunderWrapper() = default; - - void Start() - { - printf("Start Thunder session"); - return Thread::Run(); - } - - void Stop() - { - uint32_t writtenBytes = ::write(_thunder.Input(), "q\n", 2); - - _thunder.WaitProcessCompleted(5000); - _thunder.Kill(true); - - Thread::Stop(); - - printf("Stop Thunder session"); - - Wait(Thread::BLOCKED | Thread::STOPPED, Core::infinite); - } - - virtual uint32_t Worker() override - { - _thunder.Launch(_options, &_pid); - - ProcessOutputMonitor stdoutMonitor(_pid, _thunder.Output()); - ProcessOutputMonitor stderrMonitor(_pid, _thunder.Error()); - - Core::ResourceMonitor::Instance().Register(stdoutMonitor); - Core::ResourceMonitor::Instance().Register(stderrMonitor); - - _thunder.WaitProcessCompleted(Core::infinite); - - Core::ResourceMonitor::Instance().Unregister(stdoutMonitor); - Core::ResourceMonitor::Instance().Unregister(stderrMonitor); - - return 0; - } - - const uint32_t Pid() const - { - return _pid; - } - - static volatile sig_atomic_t s_signal; // = 0; - -private: - static void SignalHandler(int /*signo*/) - { - s_signal = 1; - } - - void FixLDLibraryPaths(const string& basePath) const - { - string newLDLibraryPaths; - string oldLDLibraryPaths; - - Core::SystemInfo::GetEnvironment(_T("LD_LIBRARY_PATH"), oldLDLibraryPaths); - - // Read currently added LD_LIBRARY_PATH to prefix with _systemRootPath - if (oldLDLibraryPaths.empty() != true) { - size_t start = 0; - size_t end = oldLDLibraryPaths.find(':'); - do { - newLDLibraryPaths += basePath; - newLDLibraryPaths += oldLDLibraryPaths.substr(start, - ((end != string::npos) ? (end - start + 1) : end)); - start = end; - if (end != string::npos) { - start++; - end = oldLDLibraryPaths.find(':', start); - } - } while (start != string::npos); - } else { - newLDLibraryPaths = basePath; - } - - Core::SystemInfo::SetEnvironment(_T("LD_LIBRARY_PATH"), newLDLibraryPaths, true); - printf("Populated New LD_LIBRARY_PATH : %s\n", newLDLibraryPaths.c_str()); - } - -private: - Core::Process _thunder; - Core::Process::Options _options; - const ICallback& _callback; - uint32_t _pid; -}; - -volatile sig_atomic_t ThunderWrapper::s_signal = 0; - -class App : public BinaryConnector { - class Callback : public ThunderWrapper::ICallback { - public: - Callback() = delete; - - Callback(const App& app) - : _app(app) - { - } - - virtual ~Callback() = default; - - void Signal(const int signal) const override - { - _app.Signal(signal); - } - - private: - const App& _app; - }; - -public: - App(const Core::NodeId& remoteNode) - : BinaryConnector(remoteNode) - , _callback(*this) - , _wrapper(installPath, _callback) - { - } - - ~App() = default; - - void Signal(const int signal) const - { - printf("Caught signal %d\n", signal); - } - - void StartTUT() - { - Flush(); - _wrapper.Start(); - } - - void StopTUT() - { - Close(10); - _wrapper.Stop(); - Flush(); - } - -private: - Callback _callback; - ThunderWrapper _wrapper; -}; - -int main(int argc, char** argv) -{ - int result = 0; - Core::NodeId destination; - - printf("COMHacker\n"); - - if (argc > 2) { - printf("COMHacker should be started as: COMHacker "); - result = 1; - } else if (argc == 2) { - destination = Core::NodeId(argv[1]); - } else { - destination = Core::NodeId("127.0.0.1:62000"); - } - - std::random_device dev; - std::mt19937 rng(dev()); - - const uint32_t BlockSize = 1234; - - if (result == 0) { - int character; - - BinaryConnector channel(destination); - - // App channel(destination); - // channel.StartTUT(); - - do { - SleepMs(10); - printf(">>"); - character = ::toupper(::getc(stdin)); - - switch (character) { - case 'O': { - if (channel.IsOpen() == false) { - channel.Open(10); - printf("Opening channel.\n"); - } - break; - } - case 'C': { - if (channel.IsOpen() == true) { - printf("Closing channel.\n"); - channel.Close(10); - } - break; - } - case 'I': { - static const uint8_t message[] = { 0x01, 0x02, 0x03, 0x04, 0x05 }; - printf("Ingest data.\n"); - channel.Submit(sizeof(message), message); - break; - } - case 'R': { - - static char quit; - - ThunderWrapper::KeyMonitor monitor(0, [](const char c) { quit = c; }); - - Core::ResourceMonitor::Instance().Register(monitor); - - printf("Invoking random data... stop by pressing [ESC]\n"); - - do { - InvokeMessage junkData; - std::uniform_int_distribution randomLength(27, BlockSize); - std::uniform_int_distribution randomByte(0, 255); - - uint32_t MessageSize = randomLength(rng); - - printf("Ingest junk data %d.\n", MessageSize); - - for (uint32_t i = 2; i < MessageSize; i++) { - junkData.SetNumber(i, randomByte(rng)); - } - - junkData.Finish(); - - channel.Submit(junkData.Size(), junkData.Data()); - channel.WaitForResponse(100); - } while (quit != 27); - - quit = '\0'; - - Core::ResourceMonitor::Instance().Unregister(monitor); - - break; - } - case 'N': { - // causes a Segfault - InvokeMessage request; - - request.SetNumber(InvokeMessage::IMPLEMENTATION_OFFSET, 0x03); // invalid pointer access pointer - request.SetNumber(InvokeMessage::INTERFACEID_OFFSET, 0x00000030); // interfaceId - request.SetNumber(InvokeMessage::METHODEID_OFFSET + sizeof(uint32_t), 0x01); // methodId - - request.Finish(); - - channel.Submit(request.Size(), request.Data()); - - break; - } - case 'P': { - // causes a Segfault - InvokeMessage request; - - request.SetNumber(InvokeMessage::IMPLEMENTATION_OFFSET, Core::instance_id(0x00005555557e73a1)); // invalid pointer access pointer - request.SetNumber(InvokeMessage::INTERFACEID_OFFSET, 0x00000030); // interfaceId - request.SetNumber(InvokeMessage::METHODEID_OFFSET, 0x01); // methodId AddRef - - request.Finish(); - - channel.Submit(request.Size(), request.Data()); - - channel.WaitForResponse(100); - - break; - } - case 'A': { - AnnounceMessage msg; - - msg.SetNumber(AnnounceMessage::IMPLEMENTATION_OFFSET, Core::instance_id(0x1)); // implementation - msg.SetNumber(AnnounceMessage::ID_OFFSET, uint32_t(0x00)); // interfaceId - msg.SetNumber(AnnounceMessage::EXCHANGEID_OFFSET, 1); - msg.SetNumber(AnnounceMessage::VERSIONID_OFFSET, 1); - msg.SetNumber(AnnounceMessage::TYPE_OFFSET, 1); - - const uint16_t classNameLength = msg.SetText(AnnounceMessage::STRINGS_OFFSET, "className"); - msg.SetText((AnnounceMessage::STRINGS_OFFSET + classNameLength), "callsign"); - - for (uint8_t i = RPC::ID_OFFSET_INTERNAL + 1; i < RPC::ID_EXTERNAL_INTERFACE_OFFSET; i++) { - msg.SetNumber(AnnounceMessage::INTERFACEID_OFFSET, i); // methodId - msg.Finish(); - channel.Submit(msg.Size(), msg.Data()); - if (channel.WaitForResponse(100) == Core::ERROR_NONE) { - - } else { - printf("Invalid Interface ID: 0x%04X\n", i); - } - } - - break; - } - default: { - if (isalnum(character)) { - printf("Use the following keys for actions:\n"); - printf("O)pen the channel\n"); - printf("C)lose the channel\n"); - printf("I)ngest the test string on the channel\n"); - printf("R)andom junk data\n"); - - printf("Q)uit the application\n\n"); - printf("The channel is directed towards: [%s]:[%d]\n", destination.HostName().c_str(), destination.PortNumber()); - } - break; - } - } - } while (character != 'Q'); - - printf("Closing channel.\n"); - - if (channel.IsOpen() == true) { - channel.Close(10); - } - // channel.StopTUT(); - } - - return (result); -} +#define MODULE_NAME COMHacker + +#include +#include + +#include + +MODULE_NAME_DECLARATION(BUILD_REFERENCE) + +constexpr char installPath[] = "/home/bram/Projects/metrological/Thunder/install/"; + +using namespace Thunder; + +class Message : public Core::FrameType { +private: + using BaseClass = Core::FrameType; + +public: + static constexpr uint8_t SIZE_OFFSET = 0; + static constexpr uint8_t MESSAGE_ID_OFFSET = (SIZE_OFFSET + sizeof(uint8_t)); // 1 + static constexpr uint8_t IMPLEMENTATION_OFFSET = (MESSAGE_ID_OFFSET + sizeof(uint8_t)); // 2 + + Message() = delete; + + Message(const uint16_t length, uint8_t data[]) + { + Clear(); + SetBuffer(0, length, data); + } + + Message(const uint8_t type) + : BaseClass() + { + Clear(); + SetNumber(MESSAGE_ID_OFFSET, SetMessageType(operator[](MESSAGE_ID_OFFSET), type)); + } + ~Message() = default; + + uint32_t Finish(int offset = 0) + { + operator[](SIZE_OFFSET) = (Size() - 1) + offset; + return operator[](SIZE_OFFSET); + } + +private: + constexpr uint8_t SetMessageType(const uint8_t field, const uint8_t type) + { + return (field & ~0xFE) | ((type << 1) & 0xFE); + } +}; + +class BinaryConnector : public Core::SocketStream { +public: + BinaryConnector() = delete; + BinaryConnector(BinaryConnector&&) = delete; + BinaryConnector(const BinaryConnector&) = delete; + BinaryConnector& operator=(BinaryConnector&&) = delete; + BinaryConnector& operator=(const BinaryConnector&) = delete; + + BinaryConnector(const Core::NodeId& remoteNode) + : Core::SocketStream(false, remoteNode.AnyInterface(), remoteNode, 1024, 1024) + , _adminLock() + , _loaded(0) + , _signal(false, true) + { + } + ~BinaryConnector() override = default; + +public: + uint32_t WaitForResponse(const uint32_t waitTime) + { + return _signal.Lock(waitTime); + } + + uint16_t Submit(const uint16_t length, const uint8_t buffer[]) + { + msleep(3); + _adminLock.Lock(); + uint16_t result = std::min(static_cast(sizeof(_buffer) - _loaded), length); + ::memmove(&(_buffer[_loaded]), buffer, result); + bool initialDrop = (_loaded == 0); + _loaded += result; + _adminLock.Unlock(); + + if (initialDrop == true) { + Trigger(); + } + + return (result); + } + +private: + // Methods to extract and insert data into the socket buffers + uint16_t SendData(uint8_t* dataFrame, const uint16_t maxSendSize) override + { + uint16_t result = 0; + _adminLock.Lock(); + if (_loaded > 0) { + result = std::min(maxSendSize, _loaded); + ::memcpy(dataFrame, _buffer, result); + if (result == _loaded) { + _loaded = 0; + } else { + ::memmove(_buffer, &(_buffer[result]), (_loaded - result)); + _loaded -= result; + } + // Dump("Send", result, dataFrame); + } + _adminLock.Unlock(); + return (result); + } + uint16_t ReceiveData(uint8_t* dataFrame, const uint16_t receivedSize) override + { + if (receivedSize == 0) { + printf("Received is called without any data!\n"); + } else { + // Dump("Received", receivedSize, dataFrame); + } + + _signal.SetEvent(); + + return (receivedSize); + } + + // Signal a state change, Opened, Closed or Accepted + void StateChange() override + { + _adminLock.Lock(); + + printf("StateChange called. Open = [%s]\n", IsOpen() ? _T("true") : _T("false")); + + _adminLock.Unlock(); + } + +private: + int msleep(long msec) + { + struct timespec ts; + int res; + + if (msec < 0) { + errno = EINVAL; + return -1; + } + + ts.tv_sec = msec / 1000; + ts.tv_nsec = (msec % 1000) * 1000000; + + do { + res = nanosleep(&ts, &ts); + } while (res && errno == EINTR); + + return res; + } + + void Dump(const TCHAR prefix[], const uint16_t length, const uint8_t dataFrame[]) + { + _adminLock.Lock(); + + printf("%s [%d]:\n ", prefix, length); + + printf("\t0\t1\t2\t3\t4\t5\t6\t7"); + + if (length > 1) { + for (uint16_t index = 0; index < (length - 1); index++) { + if ((index % 8 == 0)) + printf("\n 0x%04X\t", index); + printf("%02X\t", dataFrame[index]); + } + } + printf("%02X\n", dataFrame[length - 1]); + + _adminLock.Unlock(); + } + +private: + Core::CriticalSection _adminLock; + uint16_t _loaded; + uint8_t _buffer[1024]; + Core::Event _signal; +}; + +class InvokeMessage : public Message { + static constexpr uint8_t ID = 2; + +public: + static constexpr uint8_t INTERFACEID_OFFSET = (IMPLEMENTATION_OFFSET + sizeof(Core::instance_id)); + static constexpr uint8_t METHODEID_OFFSET = (INTERFACEID_OFFSET + sizeof(uint32_t)); + +public: + InvokeMessage(/* args */) + : Message(ID) + { + } + + ~InvokeMessage(){}; + +private: +}; + +class AnnounceMessage : public Message { + static constexpr uint8_t ID = 1; + +public: + static constexpr uint8_t ID_OFFSET = (IMPLEMENTATION_OFFSET + sizeof(Core::instance_id)); + static constexpr uint8_t INTERFACEID_OFFSET = (ID_OFFSET + sizeof(uint32_t)); + static constexpr uint8_t EXCHANGEID_OFFSET = (INTERFACEID_OFFSET + sizeof(uint32_t)); + static constexpr uint8_t VERSIONID_OFFSET = (EXCHANGEID_OFFSET + sizeof(uint32_t)); + static constexpr uint8_t TYPE_OFFSET = (VERSIONID_OFFSET + sizeof(uint32_t)); + static constexpr uint8_t STRINGS_OFFSET = (TYPE_OFFSET + sizeof(uint8_t)); + +public: + AnnounceMessage(/* args */) + : Message(ID) + { + } + + ~AnnounceMessage(){}; + +private: +}; + +class ThunderWrapper : public Core::Thread { +public: + struct ICallback { + virtual ~ICallback() = default; + virtual void Signal(const int signo) const = 0; + }; + + class KeyMonitor : public Core::IResource { + public: + typedef void (*onKeyPress)(const char key); + + KeyMonitor(int fd, onKeyPress callback) + : _fd(dup(fd)) + , _callback(callback) + { + _origFlags = fcntl(_fd, F_GETFL, 0); + fcntl(_fd, F_SETFL, (_origFlags | O_NONBLOCK | O_CLOEXEC)); + + // get original cooked/canonical mode values + tcgetattr(fd, &_origMode); + // set options for raw mode + struct termios raw = _origMode; + + raw.c_lflag &= ~(ICANON); + + tcsetattr(fd, TCSANOW, &raw); + } + ~KeyMonitor() + { + // restore original mode + tcsetattr(_fd, TCSANOW, &_origMode); + fcntl(_fd, F_SETFL, _origFlags); + close(_fd); + }; + + KeyMonitor(KeyMonitor&&) = delete; + KeyMonitor(const KeyMonitor&) = delete; + KeyMonitor& operator=(KeyMonitor&&) = delete; + KeyMonitor& operator=(const KeyMonitor&) = delete; + + Core::IResource::handle Descriptor() const override + { + return _fd; + } + + uint16_t Events() override + { + // We are interested in receiving data from the process + return (POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI); + } + + void Handle(const uint16_t events) override + { + // Got some data from the process + if ((events & POLLIN) != 0) { + // Read data from the fd + char buffer; + + memset(&buffer, 0, sizeof(buffer)); + + int n = read(Descriptor(), &buffer, sizeof(buffer)); + + // For the example, just print the received data + // printf("[%s]: %c\n", Core::Time::Now().ToRFC1123().c_str(), buffer); + + if ((n > 0) && (_callback != nullptr)) { + _callback(buffer); + } + } + } + + private: + const int _fd; + int _origFlags; + struct termios _origMode; + onKeyPress _callback; + }; + + class ProcessOutputMonitor : public Core::IResource { + public: + ProcessOutputMonitor(uint32_t pid, int fd) + : _pid(pid) + , _fd(fd) + { + } + ~ProcessOutputMonitor() = default; + + ProcessOutputMonitor(ProcessOutputMonitor&&) = delete; + ProcessOutputMonitor(const ProcessOutputMonitor&) = delete; + ProcessOutputMonitor& operator=(ProcessOutputMonitor&&) = delete; + ProcessOutputMonitor& operator=(const ProcessOutputMonitor&) = delete; + + Core::IResource::handle Descriptor() const override + { + return _fd; + } + + uint16_t Events() override + { + // We are interested in receiving data from the process + return (POLLIN); + } + + void Handle(const uint16_t events) override + { + // Got some data from the process + if ((events & POLLIN) != 0) { + // Read data from the fd + ssize_t ret; + std::string output; + char buffer[1024] = {}; + + do { + ret = read(_fd, buffer, sizeof(buffer)); + if (ret < 0 && errno != EWOULDBLOCK) { + printf("Error %d reading from process output\n", errno); + } else if (ret > 0) { + output += buffer; + } + } while (ret > 0); + + // For the example, just print the received data + printf("[PID: %d][%s]: %s", _pid, Core::Time::Now().ToRFC1123().c_str(), output.c_str()); + } + } + + private: + const uint32_t _pid; + const int _fd; + }; + + ThunderWrapper(const string& installPath, const ICallback& callback) + : Core::Thread(Thread::DefaultStackSize(), "ThunderWrapper") + , _thunder(true) + , _options(installPath + string("/usr/bin/Thunder")) + , _callback(callback) + { + FixLDLibraryPaths(installPath + string("/usr/lib")); + + _options.Add("-c").Add(installPath + string("/etc/Thunder/config.json")); + + struct sigaction sa; + + memset(&sa, 0, sizeof(struct sigaction)); + + sa.sa_handler = &SignalHandler; + + if (sigaction(SIGINT, &sa, NULL) == -1) { + printf("Failed to initialize signal handler...\n"); + abort(); + } + + Thread::Init(); + } + + ~ThunderWrapper() = default; + + void Start() + { + printf("Start Thunder session"); + return Thread::Run(); + } + + void Stop() + { + uint32_t writtenBytes = ::write(_thunder.Input(), "q\n", 2); + + _thunder.WaitProcessCompleted(5000); + _thunder.Kill(true); + + Thread::Stop(); + + printf("Stop Thunder session"); + + Wait(Thread::BLOCKED | Thread::STOPPED, Core::infinite); + } + + virtual uint32_t Worker() override + { + _thunder.Launch(_options, &_pid); + + ProcessOutputMonitor stdoutMonitor(_pid, _thunder.Output()); + ProcessOutputMonitor stderrMonitor(_pid, _thunder.Error()); + + Core::ResourceMonitor::Instance().Register(stdoutMonitor); + Core::ResourceMonitor::Instance().Register(stderrMonitor); + + _thunder.WaitProcessCompleted(Core::infinite); + + Core::ResourceMonitor::Instance().Unregister(stdoutMonitor); + Core::ResourceMonitor::Instance().Unregister(stderrMonitor); + + return 0; + } + + const uint32_t Pid() const + { + return _pid; + } + + static volatile sig_atomic_t s_signal; // = 0; + +private: + static void SignalHandler(int /*signo*/) + { + s_signal = 1; + } + + void FixLDLibraryPaths(const string& basePath) const + { + string newLDLibraryPaths; + string oldLDLibraryPaths; + + Core::SystemInfo::GetEnvironment(_T("LD_LIBRARY_PATH"), oldLDLibraryPaths); + + // Read currently added LD_LIBRARY_PATH to prefix with _systemRootPath + if (oldLDLibraryPaths.empty() != true) { + size_t start = 0; + size_t end = oldLDLibraryPaths.find(':'); + do { + newLDLibraryPaths += basePath; + newLDLibraryPaths += oldLDLibraryPaths.substr(start, + ((end != string::npos) ? (end - start + 1) : end)); + start = end; + if (end != string::npos) { + start++; + end = oldLDLibraryPaths.find(':', start); + } + } while (start != string::npos); + } else { + newLDLibraryPaths = basePath; + } + + Core::SystemInfo::SetEnvironment(_T("LD_LIBRARY_PATH"), newLDLibraryPaths, true); + printf("Populated New LD_LIBRARY_PATH : %s\n", newLDLibraryPaths.c_str()); + } + +private: + Core::Process _thunder; + Core::Process::Options _options; + const ICallback& _callback; + uint32_t _pid; +}; + +volatile sig_atomic_t ThunderWrapper::s_signal = 0; + +class App : public BinaryConnector { + class Callback : public ThunderWrapper::ICallback { + public: + Callback() = delete; + + Callback(const App& app) + : _app(app) + { + } + + virtual ~Callback() = default; + + void Signal(const int signal) const override + { + _app.Signal(signal); + } + + private: + const App& _app; + }; + +public: + App(const Core::NodeId& remoteNode) + : BinaryConnector(remoteNode) + , _callback(*this) + , _wrapper(installPath, _callback) + { + } + + ~App() = default; + + void Signal(const int signal) const + { + printf("Caught signal %d\n", signal); + } + + void StartTUT() + { + Flush(); + _wrapper.Start(); + } + + void StopTUT() + { + Close(10); + _wrapper.Stop(); + Flush(); + } + +private: + Callback _callback; + ThunderWrapper _wrapper; +}; + +int main(int argc, char** argv) +{ + int result = 0; + Core::NodeId destination; + + printf("COMHacker\n"); + + if (argc > 2) { + printf("COMHacker should be started as: COMHacker "); + result = 1; + } else if (argc == 2) { + destination = Core::NodeId(argv[1]); + } else { + destination = Core::NodeId("127.0.0.1:62000"); + } + + std::random_device dev; + std::mt19937 rng(dev()); + + const uint32_t BlockSize = 1234; + + if (result == 0) { + int character; + + BinaryConnector channel(destination); + + // App channel(destination); + // channel.StartTUT(); + + do { + SleepMs(10); + printf(">>"); + character = ::toupper(::getc(stdin)); + + switch (character) { + case 'O': { + if (channel.IsOpen() == false) { + channel.Open(10); + printf("Opening channel.\n"); + } + break; + } + case 'C': { + if (channel.IsOpen() == true) { + printf("Closing channel.\n"); + channel.Close(10); + } + break; + } + case 'I': { + static const uint8_t message[] = { 0x01, 0x02, 0x03, 0x04, 0x05 }; + printf("Ingest data.\n"); + channel.Submit(sizeof(message), message); + break; + } + case 'R': { + + static char quit; + + ThunderWrapper::KeyMonitor monitor(0, [](const char c) { quit = c; }); + + Core::ResourceMonitor::Instance().Register(monitor); + + printf("Invoking random data... stop by pressing [ESC]\n"); + + do { + InvokeMessage junkData; + std::uniform_int_distribution randomLength(27, BlockSize); + std::uniform_int_distribution randomByte(0, 255); + + uint32_t MessageSize = randomLength(rng); + + printf("Ingest junk data %d.\n", MessageSize); + + for (uint32_t i = 2; i < MessageSize; i++) { + junkData.SetNumber(i, randomByte(rng)); + } + + junkData.Finish(); + + channel.Submit(junkData.Size(), junkData.Data()); + channel.WaitForResponse(100); + } while (quit != 27); + + quit = '\0'; + + Core::ResourceMonitor::Instance().Unregister(monitor); + + break; + } + case 'N': { + // causes a Segfault + InvokeMessage request; + + request.SetNumber(InvokeMessage::IMPLEMENTATION_OFFSET, 0x03); // invalid pointer access pointer + request.SetNumber(InvokeMessage::INTERFACEID_OFFSET, 0x00000030); // interfaceId + request.SetNumber(InvokeMessage::METHODEID_OFFSET + sizeof(uint32_t), 0x01); // methodId + + request.Finish(); + + channel.Submit(request.Size(), request.Data()); + + break; + } + case 'P': { + // causes a Segfault + InvokeMessage request; + + request.SetNumber(InvokeMessage::IMPLEMENTATION_OFFSET, Core::instance_id(0x00005555557e73a1)); // invalid pointer access pointer + request.SetNumber(InvokeMessage::INTERFACEID_OFFSET, 0x00000030); // interfaceId + request.SetNumber(InvokeMessage::METHODEID_OFFSET, 0x01); // methodId AddRef + + request.Finish(); + + channel.Submit(request.Size(), request.Data()); + + channel.WaitForResponse(100); + + break; + } + case 'A': { + AnnounceMessage msg; + + msg.SetNumber(AnnounceMessage::IMPLEMENTATION_OFFSET, Core::instance_id(0x1)); // implementation + msg.SetNumber(AnnounceMessage::ID_OFFSET, uint32_t(0x00)); // interfaceId + msg.SetNumber(AnnounceMessage::EXCHANGEID_OFFSET, 1); + msg.SetNumber(AnnounceMessage::VERSIONID_OFFSET, 1); + msg.SetNumber(AnnounceMessage::TYPE_OFFSET, 1); + + const uint16_t classNameLength = msg.SetText(AnnounceMessage::STRINGS_OFFSET, "className"); + msg.SetText((AnnounceMessage::STRINGS_OFFSET + classNameLength), "callsign"); + + for (uint8_t i = RPC::ID_OFFSET_INTERNAL + 1; i < RPC::ID_EXTERNAL_INTERFACE_OFFSET; i++) { + msg.SetNumber(AnnounceMessage::INTERFACEID_OFFSET, i); // methodId + msg.Finish(); + channel.Submit(msg.Size(), msg.Data()); + if (channel.WaitForResponse(100) == Core::ERROR_NONE) { + + } else { + printf("Invalid Interface ID: 0x%04X\n", i); + } + } + + break; + } + default: { + if (isalnum(character)) { + printf("Use the following keys for actions:\n"); + printf("O)pen the channel\n"); + printf("C)lose the channel\n"); + printf("I)ngest the test string on the channel\n"); + printf("R)andom junk data\n"); + + printf("Q)uit the application\n\n"); + printf("The channel is directed towards: [%s]:[%d]\n", destination.HostName().c_str(), destination.PortNumber()); + } + break; + } + } + } while (character != 'Q'); + + printf("Closing channel.\n"); + + if (channel.IsOpen() == true) { + channel.Close(10); + } + // channel.StopTUT(); + } + + return (result); +} \ No newline at end of file diff --git a/Tests/httpsclient/main.cpp b/Tests/httpsclient/main.cpp index 75a03d13a..22b433a05 100644 --- a/Tests/httpsclient/main.cpp +++ b/Tests/httpsclient/main.cpp @@ -4,46 +4,46 @@ #include #include -using namespace WPEFramework; +using namespace Thunder; -class WebClient : public Web::WebLinkType&> { +class WebClient : public Web::WebLinkType&> { private: - typedef Web::WebLinkType&> BaseClass; + typedef Web::WebLinkType&> BaseClass; // All requests needed by any instance of this socket class, is coming from this static factory. // This means that all Requests, received are shared among all WebServer sockets, hopefully limiting // the number of requests that need to be created. - static WPEFramework::Core::ProxyPoolType _responseFactory; + static Thunder::Core::ProxyPoolType _responseFactory; public: WebClient() = delete; WebClient(const WebClient& copy) = delete; WebClient& operator=(const WebClient&) = delete; - WebClient(const WPEFramework::Core::NodeId& remoteNode) + WebClient(const Thunder::Core::NodeId& remoteNode) : BaseClass(5, _responseFactory, Core::SocketPort::STREAM, remoteNode.AnyInterface(), remoteNode, 2048, 2048) , _textBodyFactory(2) { } virtual ~WebClient() { - BaseClass::Close(WPEFramework::Core::infinite); + BaseClass::Close(Thunder::Core::infinite); } public: // Notification of a Partial Request received, time to attach a body.. - virtual void LinkBody(Core::ProxyType& element) + virtual void LinkBody(Core::ProxyType& element) { // Time to attach a String Body element->Body(_textBodyFactory.Element()); } - virtual void Received(Core::ProxyType& element) + virtual void Received(Core::ProxyType& element) { string received; element->ToString(received); printf(_T("Received: %s\n"), received.c_str()); } - virtual void Send(const Core::ProxyType& response) + virtual void Send(const Core::ProxyType& response) { string send; response->ToString(send); @@ -61,7 +61,7 @@ class WebClient : public Web::WebLinkType request = Core::ProxyType::Create(); + Core::ProxyType request = Core::ProxyType::Create(); printf("Creating Request!!!!.\n"); request->Verb = Web::Request::HTTP_GET; @@ -75,7 +75,7 @@ class WebClient : public Web::WebLinkType request = Core::ProxyType::Create(); + Core::ProxyType request = Core::ProxyType::Create(); printf("Creating Auth Request!!!!.\n"); request->Verb = Web::Request::HTTP_GET; @@ -107,7 +107,7 @@ class WebClient : public Web::WebLinkType _textBodyFactory; }; -/* static */ WPEFramework::Core::ProxyPoolType WebClient::_responseFactory(5); +/* static */ Thunder::Core::ProxyPoolType WebClient::_responseFactory(5); #ifdef __WIN32__ int _tmain(int argc, _TCHAR**) @@ -127,7 +127,7 @@ int main(int argc, const char* argv[]) int keyPress; WebClient webConnector(Core::NodeId("httpbin.org", 443)); - Core::ProxyType webRequest(Core::ProxyType::Create()); + Core::ProxyType webRequest(Core::ProxyType::Create()); printf("Ready to start processing events, options to start \n 0 -> connect \n 1 -> disconnect \n 2 -> Submit Request \n 3 -> Submit with Authorization Header \n"); do { @@ -167,7 +167,7 @@ int main(int argc, const char* argv[]) } // Clear the factory we created.. - WPEFramework::Core::Singleton::Dispose(); + Thunder::Core::Singleton::Dispose(); printf("\nClosing down!!!\n"); diff --git a/Tests/jsongenerator/IJsonGeneratorCorpus.h b/Tests/jsongenerator/IJsonGeneratorCorpus.h index 663b8771a..f9a8e7b47 100644 --- a/Tests/jsongenerator/IJsonGeneratorCorpus.h +++ b/Tests/jsongenerator/IJsonGeneratorCorpus.h @@ -26,7 +26,7 @@ // @insert -namespace WPEFramework { +namespace Thunder { namespace Exchange { diff --git a/Tests/loader/main.cpp b/Tests/loader/main.cpp index 12db79b3b..ccb816223 100644 --- a/Tests/loader/main.cpp +++ b/Tests/loader/main.cpp @@ -25,12 +25,12 @@ static std::list _loadLocation; static const char* _defaultSet[] = { - "/usr/lib/libWPEFrameworkCore.so" - "/usr/lib/libWPEFrameworkTracing.so", - "/usr/lib/libWPEFrameworkCryptalgo.so", - "/usr/lib/libWPEFrameworkProtocols.so", - "/usr/lib/libWPEFrameworkPlugins.so", - "/usr/lib/wpeframework/plugins", + "/usr/lib/libThunderCore.so" + "/usr/lib/libThunderTracing.so", + "/usr/lib/libThunderCryptalgo.so", + "/usr/lib/libThunderProtocols.so", + "/usr/lib/libThunderPlugins.so", + "/usr/lib/thunder/plugins", nullptr }; bool ParseOptions (int argc, char** argv) @@ -74,9 +74,9 @@ bool ParseOptions (int argc, char** argv) if (showHelp == true) { - printf("Verification and Analyze tool for WPEFramework Software.\n"); + printf("Verification and Analyze tool for Thunder Software.\n"); printf("verify -d [prefix_path] -l [directories or files]\n"); - printf(" -d: Use the default WPEFramework Software libraries deployed.\n"); + printf(" -d: Use the default Thunder Software libraries deployed.\n"); printf(" -l: Location of a file, or a directory that holds *.so files. These files\n"); printf(" will be loaded and their versione (build tags) will be printed.\n\n"); } @@ -87,13 +87,13 @@ bool ParseOptions (int argc, char** argv) typedef const char* (*ModuleName)(); typedef const char* (*ModuleBuildRef)(); -void ReadFile (const WPEFramework::Core::File& file) { +void ReadFile (const Thunder::Core::File& file) { - WPEFramework::Core::Library library(file.Name().c_str()); + Thunder::Core::Library library(file.Name().c_str()); if (library.IsLoaded() == true) { - // extern "C" { namespace WPEFramework { namespace Core { namespace System { + // extern "C" { namespace Thunder { namespace Core { namespace System { // const char* ModuleName(); // const char* ModuleBuildRef(); // }}}} @@ -123,11 +123,11 @@ void ReadFile (const WPEFramework::Core::File& file) { void ReadDirectory (const string& name) { - WPEFramework::Core::Directory pluginDirectory (name.c_str()); + Thunder::Core::Directory pluginDirectory (name.c_str()); while (pluginDirectory.Next() == true) { - WPEFramework::Core::File file (pluginDirectory.Current()); + Thunder::Core::File file (pluginDirectory.Current()); if (file.Exists()) { if (file.IsDirectory()) { @@ -151,7 +151,7 @@ int main(int argc, char *argv[]) { std::list::const_iterator index(_loadLocation.begin()); while (index != _loadLocation.end()) { - WPEFramework::Core::File file (*index, true); + Thunder::Core::File file (*index, true); if (file.Exists() == true) { if (file.IsDirectory() == true) { ReadDirectory(index->c_str()); @@ -164,7 +164,7 @@ int main(int argc, char *argv[]) { } } - WPEFramework::Core::Singleton::Dispose(); + Thunder::Core::Singleton::Dispose(); return 0; } diff --git a/Tests/message-buffer/main.cpp b/Tests/message-buffer/main.cpp index 2e9dae89b..25bc661d2 100644 --- a/Tests/message-buffer/main.cpp +++ b/Tests/message-buffer/main.cpp @@ -1,6 +1,6 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace Test { static Core::NodeId GetConnectionNode() @@ -17,7 +17,7 @@ static class PluginHost { public: PluginHost() - : _engine(WPEFramework::Core::ProxyType>::Create()) + : _engine(Thunder::Core::ProxyType>::Create()) , _comClient(Core::ProxyType::Create(GetConnectionNode(), Core::ProxyType(_engine))) { } @@ -62,7 +62,7 @@ static class PluginHost { private: Core::ProxyType > _engine; Core::ProxyType _comClient; -} _wpeFrameworkClient; +} _thunderClient; } } @@ -86,25 +86,25 @@ int main(int argc, char** argv) switch (element) { case 'I': { - WPEFramework::Test::_wpeFrameworkClient.Initialize(); + Thunder::Test::_thunderClient.Initialize(); fprintf(stdout, "PluginHost initialized..\n"); fflush(stdout); break; } case 'D': { - WPEFramework::Test::_wpeFrameworkClient.Deinitialize(); + Thunder::Test::_thunderClient.Deinitialize(); fprintf(stdout, "PluginHost deinitialized..\n"); fflush(stdout); break; } case 'T': { - WPEFramework::Test::_wpeFrameworkClient.Trace(); + Thunder::Test::_thunderClient.Trace(); fprintf(stdout, "Trace sent..\n"); fflush(stdout); break; } case 'S': { - WPEFramework::Test::_wpeFrameworkClient.Syslog(); + Thunder::Test::_thunderClient.Syslog(); fprintf(stdout, "Syslog sent..\n"); fflush(stdout); break; diff --git a/Tests/redirect/main.cpp b/Tests/redirect/main.cpp index 3568e8ff6..69d700e8e 100644 --- a/Tests/redirect/main.cpp +++ b/Tests/redirect/main.cpp @@ -6,9 +6,9 @@ #include -using namespace WPEFramework; +using namespace Thunder; -namespace WPEFramework { +namespace Thunder { namespace Test { template class TextStreamRedirectType { diff --git a/Tests/unit/IPTestAdministrator.cpp b/Tests/unit/IPTestAdministrator.cpp index 92c7d5408..a2c83c50b 100644 --- a/Tests/unit/IPTestAdministrator.cpp +++ b/Tests/unit/IPTestAdministrator.cpp @@ -76,7 +76,7 @@ void IPTestAdministrator::ForkChildProcess(OtherSideMain otherSideMain) otherSideMain(*this); // TODO: should we clean up stuff here or not? - //WPEFramework::Core::Singleton::Dispose(); + //Thunder::Core::Singleton::Dispose(); // Make sure no gtest cleanup code is called (summary etc). #ifdef WITH_CODE_COVERAGE diff --git a/Tests/unit/core/CMakeLists.txt b/Tests/unit/core/CMakeLists.txt index 1b56d59ff..0e9949f90 100644 --- a/Tests/unit/core/CMakeLists.txt +++ b/Tests/unit/core/CMakeLists.txt @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(TEST_RUNNER_NAME "WPEFramework_test_core") +set(TEST_RUNNER_NAME "Thunder_test_core") @@ -85,12 +85,12 @@ add_executable(${TEST_RUNNER_NAME} #[[ if(MESSAGING) target_sources(${TEST_RUNNER_NAME} PRIVATE test_message_unit.cpp) target_link_libraries(${TEST_RUNNER_NAME} - WPEFrameworkMessaging + ThunderMessaging ) else() target_sources(${TEST_RUNNER_NAME} PRIVATE test_tracing.cpp) target_link_libraries(${TEST_RUNNER_NAME} - WPEFrameworkTracing + ThunderTracing ) endif() ]] diff --git a/Tests/unit/core/test_cyclicbuffer.cpp b/Tests/unit/core/test_cyclicbuffer.cpp index ec20718db..f0caa777e 100644 --- a/Tests/unit/core/test_cyclicbuffer.cpp +++ b/Tests/unit/core/test_cyclicbuffer.cpp @@ -25,7 +25,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Core { namespace Tests { @@ -1779,4 +1779,4 @@ namespace Tests { } } // Tests } // Core -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_databuffer.cpp b/Tests/unit/core/test_databuffer.cpp index 9ce2b629d..01542ecbf 100644 --- a/Tests/unit/core/test_databuffer.cpp +++ b/Tests/unit/core/test_databuffer.cpp @@ -22,7 +22,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Core { namespace Tests { @@ -30,7 +30,7 @@ TEST(Core_DataBuffer, simple) { constexpr uint32_t blocksize = 10; - WPEFramework::Core::ScopedStorage storage; + Thunder::Core::ScopedStorage storage; EXPECT_EQ(storage.Size(), blocksize); @@ -39,4 +39,4 @@ TEST(Core_DataBuffer, simple) } // Tests } // Core -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_dataelement.cpp b/Tests/unit/core/test_dataelement.cpp index c90d12084..0c950cd82 100644 --- a/Tests/unit/core/test_dataelement.cpp +++ b/Tests/unit/core/test_dataelement.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; TEST(test_data, simple_data) { diff --git a/Tests/unit/core/test_dataelementfile.cpp b/Tests/unit/core/test_dataelementfile.cpp index 2df4f077d..f4ec43e63 100644 --- a/Tests/unit/core/test_dataelementfile.cpp +++ b/Tests/unit/core/test_dataelementfile.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; class DataFile: public Core::DataElementFile { diff --git a/Tests/unit/core/test_doorbell.cpp b/Tests/unit/core/test_doorbell.cpp index 3bfa76cea..56990a424 100644 --- a/Tests/unit/core/test_doorbell.cpp +++ b/Tests/unit/core/test_doorbell.cpp @@ -21,7 +21,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { TEST(Core_DoorBell, simpleSet) @@ -97,4 +97,4 @@ namespace Tests { } } // Tests -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_enumerate.cpp b/Tests/unit/core/test_enumerate.cpp index fc0364faf..aacec7d66 100644 --- a/Tests/unit/core/test_enumerate.cpp +++ b/Tests/unit/core/test_enumerate.cpp @@ -22,7 +22,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { enum class TestEnum { @@ -148,4 +148,4 @@ ENUM_CONVERSION_BEGIN(Tests::TestEnum) { Tests::TestEnum::TWO, _TXT("TWO") }, { Tests::TestEnum::THREE, _TXT("THREE") }, ENUM_CONVERSION_END(Tests::TestEnum) -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_event.cpp b/Tests/unit/core/test_event.cpp index 4639f90ee..06fe9e25f 100644 --- a/Tests/unit/core/test_event.cpp +++ b/Tests/unit/core/test_event.cpp @@ -23,8 +23,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; class ThreadClass : public Core::Thread { public: diff --git a/Tests/unit/core/test_filesystem.cpp b/Tests/unit/core/test_filesystem.cpp index 4eaf6c8d0..2dea5b4e5 100644 --- a/Tests/unit/core/test_filesystem.cpp +++ b/Tests/unit/core/test_filesystem.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; TEST (test_file, file) { diff --git a/Tests/unit/core/test_frametype.cpp b/Tests/unit/core/test_frametype.cpp index b4a44a8a2..22252e01e 100644 --- a/Tests/unit/core/test_frametype.cpp +++ b/Tests/unit/core/test_frametype.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; TEST(test_frame, simple_set) { diff --git a/Tests/unit/core/test_hash.cpp b/Tests/unit/core/test_hash.cpp index 2706c4c0d..58c588c65 100644 --- a/Tests/unit/core/test_hash.cpp +++ b/Tests/unit/core/test_hash.cpp @@ -24,7 +24,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { std::string GetSystemHash(std::string result) diff --git a/Tests/unit/core/test_hex2strserialization.cpp b/Tests/unit/core/test_hex2strserialization.cpp index 7b3c9e328..03d5dc45a 100644 --- a/Tests/unit/core/test_hex2strserialization.cpp +++ b/Tests/unit/core/test_hex2strserialization.cpp @@ -23,7 +23,7 @@ #include #include "core/core.h" -namespace WPEFramework { +namespace Thunder { namespace Tests { TEST(HEX2StrSerialization, serialiation_working) { diff --git a/Tests/unit/core/test_ipc.cpp b/Tests/unit/core/test_ipc.cpp index 502a923bd..4a8217ce3 100644 --- a/Tests/unit/core/test_ipc.cpp +++ b/Tests/unit/core/test_ipc.cpp @@ -22,7 +22,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { class Response { @@ -841,4 +841,4 @@ namespace Tests { } } } // Tests -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_ipcclient.cpp b/Tests/unit/core/test_ipcclient.cpp index 278b79cf5..016dfdc96 100644 --- a/Tests/unit/core/test_ipcclient.cpp +++ b/Tests/unit/core/test_ipcclient.cpp @@ -22,7 +22,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { TEST(Core_IPC, IPCClientConnection) @@ -76,4 +76,4 @@ namespace Tests { testAdmin.Sync("done testing"); } } // Tests -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_iso639.cpp b/Tests/unit/core/test_iso639.cpp index 5b7ba5d3a..2d38cd393 100644 --- a/Tests/unit/core/test_iso639.cpp +++ b/Tests/unit/core/test_iso639.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; TEST(test_ISO639, simple_ISO639) { diff --git a/Tests/unit/core/test_iterator.cpp b/Tests/unit/core/test_iterator.cpp index e499bb683..be26042cf 100644 --- a/Tests/unit/core/test_iterator.cpp +++ b/Tests/unit/core/test_iterator.cpp @@ -22,7 +22,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { class DataClass { @@ -153,4 +153,4 @@ namespace Tests { ValidateMap(iterator, i); } } // Tests -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_jsonparser.cpp b/Tests/unit/core/test_jsonparser.cpp index 158f5bfda..fe00cc295 100644 --- a/Tests/unit/core/test_jsonparser.cpp +++ b/Tests/unit/core/test_jsonparser.cpp @@ -26,7 +26,7 @@ #include #include "JSON.h" -namespace WPEFramework { +namespace Thunder { enum class JSONTestEnum { ENUM_1, ENUM_2, @@ -1291,13 +1291,13 @@ namespace Tests { TEST(JSONParser, Variant) { - WPEFramework::Core::JSON::Variant variant; - WPEFramework::Core::JSON::Variant variant1(std::numeric_limits::min()); + Thunder::Core::JSON::Variant variant; + Thunder::Core::JSON::Variant variant1(std::numeric_limits::min()); - WPEFramework::Core::JSON::Variant variant2(std::numeric_limits::min()); - WPEFramework::Core::JSON::Variant variant3(std::numeric_limits::min()); - WPEFramework::Core::JSON::Variant variant4(std::numeric_limits::min()); - WPEFramework::Core::JSON::Variant variant5(true); + Thunder::Core::JSON::Variant variant2(std::numeric_limits::min()); + Thunder::Core::JSON::Variant variant3(std::numeric_limits::min()); + Thunder::Core::JSON::Variant variant4(std::numeric_limits::min()); + Thunder::Core::JSON::Variant variant5(true); //EXPECT_EQ(variant1.Number(), 0); //TODO EXPECT_EQ(variant2.Number(), 0); @@ -1305,31 +1305,31 @@ namespace Tests { EXPECT_EQ(variant4.Number(), 0); const TCHAR text[] = "varient"; - WPEFramework::Core::JSON::Variant variant6(text); + Thunder::Core::JSON::Variant variant6(text); EXPECT_STREQ(variant6.String().c_str(), text); - WPEFramework::Core::JSON::Variant variant6_new = text; + Thunder::Core::JSON::Variant variant6_new = text; EXPECT_STREQ(variant6_new.String().c_str(), text); std::string msg = "varient"; - WPEFramework::Core::JSON::Variant variant7(msg); + Thunder::Core::JSON::Variant variant7(msg); EXPECT_STREQ(variant7.String().c_str(), msg.c_str()); - WPEFramework::Core::JSON::Variant variant8(variant4); + Thunder::Core::JSON::Variant variant8(variant4); - WPEFramework::Core::JSON::VariantContainer container; - WPEFramework::Core::JSON::Variant val1(10); - WPEFramework::Core::JSON::Variant val2(20); - WPEFramework::Core::JSON::Variant val3(30); + Thunder::Core::JSON::VariantContainer container; + Thunder::Core::JSON::Variant val1(10); + Thunder::Core::JSON::Variant val2(20); + Thunder::Core::JSON::Variant val3(30); container.Set("key1", val1); container.Set("key2", val2); container.Set("key3", val3); - WPEFramework::Core::JSON::Variant variant9(container); + Thunder::Core::JSON::Variant variant9(container); msg = "name=key1 type=Object value={\n name=key1 type=Number value=10\n name=key2 type=Number value=20\n name=key3 type=Number value=30\n}\n"; EXPECT_STREQ(variant9.GetDebugString("key1").c_str(), msg.c_str()); variant2.Boolean(true); - WPEFramework::Core::JSON::Variant variant10 = variant4; + Thunder::Core::JSON::Variant variant10 = variant4; variant5.Content(); EXPECT_TRUE(variant5.Boolean()); @@ -1343,25 +1343,25 @@ namespace Tests { variant6.Boolean(true); - WPEFramework::Core::JSON::Variant variant11; + Thunder::Core::JSON::Variant variant11; variant11.Object(container); msg = "name=key1 type=Object value={\n name=key1 type=Number value=10\n name=key2 type=Number value=20\n name=key3 type=Number value=30\n}\n"; EXPECT_STREQ(variant11.GetDebugString("key1").c_str(), msg.c_str()); - WPEFramework::Core::JSON::VariantContainer variantContainer = variant11.Object(); + Thunder::Core::JSON::VariantContainer variantContainer = variant11.Object(); EXPECT_EQ(variantContainer.Get("key1").String(), "10"); } TEST(JSONParser, VariantContainer) { - WPEFramework::Core::JSON::VariantContainer container; + Thunder::Core::JSON::VariantContainer container; - WPEFramework::Core::JSON::Variant val1(10); - WPEFramework::Core::JSON::Variant val2(20); - WPEFramework::Core::JSON::Variant val3(30); - WPEFramework::Core::JSON::Variant val4(40); - WPEFramework::Core::JSON::Variant val5(50); - WPEFramework::Core::JSON::Variant val6(60); + Thunder::Core::JSON::Variant val1(10); + Thunder::Core::JSON::Variant val2(20); + Thunder::Core::JSON::Variant val3(30); + Thunder::Core::JSON::Variant val4(40); + Thunder::Core::JSON::Variant val5(50); + Thunder::Core::JSON::Variant val6(60); container.Set("key1", val1); container.Set("key2", val2); @@ -1374,29 +1374,29 @@ namespace Tests { EXPECT_EQ((container.Get("key1")).String(), "10"); EXPECT_EQ((container["key5"]).String(), "50"); - WPEFramework::Core::JSON::Variant variant1 = container["key5"]; - const WPEFramework::Core::JSON::Variant variant2 = container["key5"]; + Thunder::Core::JSON::Variant variant1 = container["key5"]; + const Thunder::Core::JSON::Variant variant2 = container["key5"]; EXPECT_EQ(variant1.String(), "50"); EXPECT_EQ(variant2.String(), "50"); std::string serialize = "{\"key1\":\"hello\"}"; - WPEFramework::Core::JSON::VariantContainer container1(serialize); + Thunder::Core::JSON::VariantContainer container1(serialize); std::string text; container1.ToString(text); EXPECT_STREQ(text.c_str(),serialize.c_str()); serialize = "\"key1\":\"hello\""; //Trigger a call to ErrorDisplayMessage() with purposefully created error condition. - WPEFramework::Core::JSON::VariantContainer errorContainer(serialize); + Thunder::Core::JSON::VariantContainer errorContainer(serialize); errorContainer.ToString(text); const TCHAR serialized[] = "{\"key2\":\"checking\"}"; - WPEFramework::Core::JSON::VariantContainer container2(serialized); + Thunder::Core::JSON::VariantContainer container2(serialized); container2.ToString(text); EXPECT_STREQ(text.c_str(), serialized); - WPEFramework::Core::JSON::VariantContainer container_new(container2); - WPEFramework::Core::JSON::VariantContainer container_copy = container_new; + Thunder::Core::JSON::VariantContainer container_new(container2); + Thunder::Core::JSON::VariantContainer container_copy = container_new; std::string debugString = " name=key1 type=Number value=10\n name=key2 type=Number value=20\n name=key3 type=Number value=30\n name=key4 type=Number value=40\n name=key5 type=Number value=50\n name=key6 type=Number value=60\n"; EXPECT_STREQ(container.GetDebugString(3).c_str(), debugString.c_str()); @@ -1404,20 +1404,20 @@ namespace Tests { TEST(JSONParser, VariantDebugStringNumber) { - WPEFramework::Core::JSON::Variant variant(10); + Thunder::Core::JSON::Variant variant(10); std::string debugString = " [0] name=hello type=Number value=10\n"; EXPECT_STREQ(variant.GetDebugString("hello",3,0).c_str(), debugString.c_str()); - WPEFramework::Core::JSON::Variant variant1 = std::numeric_limits::min(); + Thunder::Core::JSON::Variant variant1 = std::numeric_limits::min(); EXPECT_EQ(variant1.Number(), 0); - WPEFramework::Core::JSON::Variant variant2 = 10; + Thunder::Core::JSON::Variant variant2 = 10; EXPECT_EQ(variant2.Number(), 10); } TEST(JSONParser, VariantDebugStringEmpty) { - WPEFramework::Core::JSON::Variant variant; + Thunder::Core::JSON::Variant variant; std::string debugString = " [0] name=hello type=Empty value=null\n"; EXPECT_STREQ(variant.GetDebugString("hello", 1, 0).c_str(), debugString.c_str()); @@ -1425,81 +1425,81 @@ namespace Tests { TEST(JSONParser, VariantDebugStringBoolean) { - WPEFramework::Core::JSON::Variant variant(true); + Thunder::Core::JSON::Variant variant(true); std::string debugString = " [0] name=hello type=Boolean value=true\n"; EXPECT_STREQ(variant.GetDebugString("hello", 1, 0).c_str(), debugString.c_str()); - WPEFramework::Core::JSON::Variant variant1 = true; + Thunder::Core::JSON::Variant variant1 = true; EXPECT_STREQ(variant1.GetDebugString("hello", 1, 0).c_str(), debugString.c_str()); } TEST(JSONParser, VariantDebugStringString) { - WPEFramework::Core::JSON::Variant variant("Variant"); + Thunder::Core::JSON::Variant variant("Variant"); std::string debugString = " [0] name=hello type=String value=Variant\n"; EXPECT_STREQ(variant.GetDebugString("hello", 1, 0).c_str(), debugString.c_str()); - WPEFramework::Core::JSON::Variant variant1 = "Variant"; + Thunder::Core::JSON::Variant variant1 = "Variant"; EXPECT_STREQ(variant1.GetDebugString("hello", 1, 0).c_str(), debugString.c_str()); } TEST(JSONParser, VariantDebugStringArray) { - WPEFramework::Core::JSON::ArrayType array; - array.Add(WPEFramework::Core::JSON::Variant(10)); - WPEFramework::Core::JSON::Variant variant(array); + Thunder::Core::JSON::ArrayType array; + array.Add(Thunder::Core::JSON::Variant(10)); + Thunder::Core::JSON::Variant variant(array); std::string debugString = " [0] name=hello type=String value=[10]\n"; EXPECT_STREQ(variant.GetDebugString("hello", 1, 0).c_str(), debugString.c_str()); - WPEFramework::Core::JSON::Variant variant1 = WPEFramework::Core::JSON::Variant(array); + Thunder::Core::JSON::Variant variant1 = Thunder::Core::JSON::Variant(array); EXPECT_STREQ(variant1.GetDebugString("hello", 1, 0).c_str(), debugString.c_str()); - WPEFramework::Core::JSON::Variant variant2; + Thunder::Core::JSON::Variant variant2; variant2.Array(array); - WPEFramework::Core::JSON::ArrayType result; + Thunder::Core::JSON::ArrayType result; result = variant2.Array(); - WPEFramework::Core::JSON::Variant variant3(result); + Thunder::Core::JSON::Variant variant3(result); EXPECT_STREQ(variant3.GetDebugString("hello", 1, 0).c_str(), debugString.c_str());; } TEST(JSONParser, VariantDebugStringObject) { - WPEFramework::Core::JSON::VariantContainer container; - WPEFramework::Core::JSON::Variant val1(10); - WPEFramework::Core::JSON::Variant val2(20); - WPEFramework::Core::JSON::Variant val3(30); + Thunder::Core::JSON::VariantContainer container; + Thunder::Core::JSON::Variant val1(10); + Thunder::Core::JSON::Variant val2(20); + Thunder::Core::JSON::Variant val3(30); container.Set("key1", val1); container.Set("key2", val2); container.Set("key3", val3); - WPEFramework::Core::JSON::Variant variant(container); + Thunder::Core::JSON::Variant variant(container); std::string debugString = " [0] name=hello type=Object value={\n name=key1 type=Number value=10\n name=key2 type=Number value=20\n name=key3 type=Number value=30\n }\n"; EXPECT_STREQ(variant.GetDebugString("hello", 1, 0).c_str(), debugString.c_str()); - WPEFramework::Core::JSON::Variant variant1 = container; + Thunder::Core::JSON::Variant variant1 = container; EXPECT_STREQ(variant1.GetDebugString("hello", 1, 0).c_str(), debugString.c_str()); } TEST(JSONParser, VariantContainerWithElements) { - std::list> elements; + std::list> elements; - WPEFramework::Core::JSON::Variant val1(10); - WPEFramework::Core::JSON::Variant val2(20); - WPEFramework::Core::JSON::Variant val3(30); + Thunder::Core::JSON::Variant val1(10); + Thunder::Core::JSON::Variant val2(20); + Thunder::Core::JSON::Variant val3(30); - elements.push_back(std::pair("Key1", val1)); - elements.push_back(std::pair("Key2", val2)); - elements.push_back(std::pair("Key3", val3)); + elements.push_back(std::pair("Key1", val1)); + elements.push_back(std::pair("Key2", val2)); + elements.push_back(std::pair("Key3", val3)); - WPEFramework::Core::JSON::VariantContainer container(elements); + Thunder::Core::JSON::VariantContainer container(elements); - WPEFramework::Core::JSON::VariantContainer::Iterator it = container.Variants(); + Thunder::Core::JSON::VariantContainer::Iterator it = container.Variants(); EXPECT_TRUE(it.Next()); EXPECT_TRUE(container.HasLabel("Key1")); EXPECT_TRUE(it.IsValid()); @@ -1507,20 +1507,20 @@ namespace Tests { TEST(JSONParser, VariantContainerIterator) { - std::list> elements; + std::list> elements; - WPEFramework::Core::JSON::Variant val1(10); - WPEFramework::Core::JSON::Variant val2(20); - WPEFramework::Core::JSON::Variant val3(30); + Thunder::Core::JSON::Variant val1(10); + Thunder::Core::JSON::Variant val2(20); + Thunder::Core::JSON::Variant val3(30); - elements.push_back(std::pair("Key1", val1)); - elements.push_back(std::pair("Key2", val2)); - elements.push_back(std::pair("Key3", val3)); + elements.push_back(std::pair("Key1", val1)); + elements.push_back(std::pair("Key2", val2)); + elements.push_back(std::pair("Key3", val3)); - WPEFramework::Core::JSON::VariantContainer::Iterator iterator; - WPEFramework::Core::JSON::VariantContainer::Iterator it(elements); - WPEFramework::Core::JSON::VariantContainer::Iterator itCopy(iterator); - WPEFramework::Core::JSON::VariantContainer::Iterator iteratorCopy = itCopy; + Thunder::Core::JSON::VariantContainer::Iterator iterator; + Thunder::Core::JSON::VariantContainer::Iterator it(elements); + Thunder::Core::JSON::VariantContainer::Iterator itCopy(iterator); + Thunder::Core::JSON::VariantContainer::Iterator iteratorCopy = itCopy; EXPECT_TRUE(it.Next()); EXPECT_TRUE(it.IsValid()); @@ -1590,7 +1590,7 @@ namespace Tests { } } - class SmallTest : public WPEFramework::Core::JSON::Container { + class SmallTest : public Thunder::Core::JSON::Container { public: SmallTest(const SmallTest&) = delete; SmallTest& operator=(const SmallTest&) = delete; @@ -1623,7 +1623,7 @@ namespace Tests { Core::JSON::EnumType E; }; - class SmallTest2 : public WPEFramework::Core::JSON::Container { + class SmallTest2 : public Thunder::Core::JSON::Container { public: SmallTest2(const SmallTest2&) = delete; SmallTest2& operator=(const SmallTest2&) = delete; @@ -1680,7 +1680,7 @@ namespace Tests { Core::JSON::String Ssid; // Identifier of a network }; - class CommandParameters : public WPEFramework::Core::JSON::Container { + class CommandParameters : public Thunder::Core::JSON::Container { public: CommandParameters(const CommandParameters&) = delete; CommandParameters& operator=(const CommandParameters&) = delete; @@ -1704,15 +1704,15 @@ namespace Tests { ~CommandParameters() override = default; public: - WPEFramework::Core::JSON::OctSInt16 G; - WPEFramework::Core::JSON::DecSInt16 H; - WPEFramework::Core::JSON::EnumType I; - WPEFramework::Core::JSON::ArrayType J; - WPEFramework::Core::JSON::Float K; - WPEFramework::Core::JSON::Double L; + Thunder::Core::JSON::OctSInt16 G; + Thunder::Core::JSON::DecSInt16 H; + Thunder::Core::JSON::EnumType I; + Thunder::Core::JSON::ArrayType J; + Thunder::Core::JSON::Float K; + Thunder::Core::JSON::Double L; }; - class CommandRequest : public WPEFramework::Core::JSON::Container { + class CommandRequest : public Thunder::Core::JSON::Container { public: CommandRequest(const CommandRequest&) = delete; CommandRequest& operator=(const CommandRequest&) = delete; @@ -1745,19 +1745,19 @@ namespace Tests { void Clear() { - WPEFramework::Core::JSON::Container::Clear(); + Thunder::Core::JSON::Container::Clear(); } public: - WPEFramework::Core::JSON::HexSInt32 A; - WPEFramework::Core::JSON::String B; - WPEFramework::Core::JSON::HexUInt32 C; - WPEFramework::Core::JSON::Boolean D; - WPEFramework::Core::JSON::OctUInt16 E; + Thunder::Core::JSON::HexSInt32 A; + Thunder::Core::JSON::String B; + Thunder::Core::JSON::HexUInt32 C; + Thunder::Core::JSON::Boolean D; + Thunder::Core::JSON::OctUInt16 E; CommandParameters F; - WPEFramework::Core::JSON::ArrayType M; - WPEFramework::Core::JSON::Float N; - WPEFramework::Core::JSON::Double O; + Thunder::Core::JSON::ArrayType M; + Thunder::Core::JSON::Float N; + Thunder::Core::JSON::Double O; }; TEST(JSONParser, smallParser) @@ -1844,7 +1844,7 @@ namespace Tests { string input = R"({"a":"-0x5A","b":"TestIdentifier","c":"0x5A","d":true,"e":"014","f":{"g":"-014","h":"-44","i":"enum_4","j":["6","14","22"],"k":"1.1","l":"2.11"},"m":["Test"],"n":"3.2","o":"-65.22"})"; string inputRequired = R"({"a":"-0x5A","b":"TestIdentifier","c":"0x5A","d":true,"e":"014","f":{"g":"-014","h":-44,"i":"enum_4","j":[6,14,22],"k":1.1,"l":2.11},"m":["Test"],"n":3.2,"o":-65.22})"; string output; - WPEFramework::Core::ProxyType command = WPEFramework::Core::ProxyType::Create(); + Thunder::Core::ProxyType command = Thunder::Core::ProxyType::Create(); command->A = -90; command->B = _T("TestIdentifier"); command->C = 90; @@ -1853,24 +1853,24 @@ namespace Tests { command->F.G = -12; command->F.H = -44; command->F.I = JSONTestEnum::ENUM_4; - command->F.J.Add(WPEFramework::Core::JSON::DecUInt16(6, true)); - command->F.J.Add(WPEFramework::Core::JSON::DecUInt16(14, true)); - command->F.J.Add(WPEFramework::Core::JSON::DecUInt16(22, true)); + command->F.J.Add(Thunder::Core::JSON::DecUInt16(6, true)); + command->F.J.Add(Thunder::Core::JSON::DecUInt16(14, true)); + command->F.J.Add(Thunder::Core::JSON::DecUInt16(22, true)); command->F.K = static_cast(1.1); command->F.L = 2.11; command->N = static_cast(3.2); command->O = -65.22; - WPEFramework::Core::JSON::String str; + Thunder::Core::JSON::String str; str = string("Test"); command->M.Add(str); - WPEFramework::Core::JSON::Tester<1, CommandRequest> parser; + Thunder::Core::JSON::Tester<1, CommandRequest> parser; //ToString parser.ToString(command, output); EXPECT_STREQ(inputRequired.c_str(), output.c_str()); //FromString - WPEFramework::Core::ProxyType received = WPEFramework::Core::ProxyType::Create(); + Thunder::Core::ProxyType received = Thunder::Core::ProxyType::Create(); parser.FromString(input, received); output.clear(); parser.ToString(received, output); @@ -1882,7 +1882,7 @@ namespace Tests { EXPECT_STREQ(inputRequired.c_str(), output.c_str()); //ArrayType Iterator - WPEFramework::Core::JSON::ArrayType::Iterator settings(command->F.J.Elements()); + Thunder::Core::JSON::ArrayType::Iterator settings(command->F.J.Elements()); for(int i = 0; settings.Next(); i++) EXPECT_EQ(settings.Current().Value(), command->F.J[i]); //null test @@ -2101,13 +2101,13 @@ namespace Tests { escapeSequence = 10; input = escapeSequence; printf("\n\n Case 17 \n"); - WPEFramework::Core::ProxyType commandInput = WPEFramework::Core::ProxyType::Create(); - WPEFramework::Core::JSON::Tester<1, CommandRequest> parserInput; + Thunder::Core::ProxyType commandInput = Thunder::Core::ProxyType::Create(); + Thunder::Core::JSON::Tester<1, CommandRequest> parserInput; commandInput->B = input; output.clear(); parserInput.ToString(commandInput, output); - WPEFramework::Core::ProxyType commandOutput = WPEFramework::Core::ProxyType::Create(); - WPEFramework::Core::JSON::Tester<1, CommandRequest> parserOutput; + Thunder::Core::ProxyType commandOutput = Thunder::Core::ProxyType::Create(); + Thunder::Core::JSON::Tester<1, CommandRequest> parserOutput; parserOutput.FromString(output, commandOutput); EXPECT_STREQ(commandInput->B.Value().c_str(), commandOutput->B.Value().c_str()); @@ -2216,7 +2216,7 @@ namespace Tests { string input = R"({"a":"-0x5A","b":"TestIdentifier","c":"0x5A","d":true,"e":"014","f":{"g":"-014","h":"-44","i":"enum_4","j":["6","14","22"],"k":"1.1","l":"2.11"},"m":["Test"],"n":"3.2","o":"-65.22"})"; string inputRequired = R"({"a":"-0x5A","b":"TestIdentifier","c":"0x5A","d":true,"e":"014","f":{"g":"-014","h":-44,"i":"enum_4","j":[6,14,22],"k":1.1,"l":2.11},"m":["Test"],"n":3.2,"o":-65.22})"; string output; - WPEFramework::Core::ProxyType command = WPEFramework::Core::ProxyType::Create(); + Thunder::Core::ProxyType command = Thunder::Core::ProxyType::Create(); command->A = -90; command->B = _T("TestIdentifier"); command->C = 90; @@ -2225,23 +2225,23 @@ namespace Tests { command->F.G = -12; command->F.H = -44; command->F.I = JSONTestEnum::ENUM_4; - command->F.J.Add(WPEFramework::Core::JSON::DecUInt16(6, true)); - command->F.J.Add(WPEFramework::Core::JSON::DecUInt16(14, true)); - command->F.J.Add(WPEFramework::Core::JSON::DecUInt16(22, true)); + command->F.J.Add(Thunder::Core::JSON::DecUInt16(6, true)); + command->F.J.Add(Thunder::Core::JSON::DecUInt16(14, true)); + command->F.J.Add(Thunder::Core::JSON::DecUInt16(22, true)); command->F.K = static_cast(1.1); command->F.L = 2.11; command->N = static_cast(3.2); command->O = -65.22; - WPEFramework::Core::JSON::String str; + Thunder::Core::JSON::String str; str = string("Test"); command->M.Add(str); - WPEFramework::Core::JSON::Tester<512, CommandRequest> parser; + Thunder::Core::JSON::Tester<512, CommandRequest> parser; //ToString parser.ToString(command, output); EXPECT_STREQ(inputRequired.c_str(), output.c_str()); //FromString - WPEFramework::Core::ProxyType received = WPEFramework::Core::ProxyType::Create(); + Thunder::Core::ProxyType received = Thunder::Core::ProxyType::Create(); parser.FromString(input, received); output.clear(); parser.ToString(received, output); @@ -2253,7 +2253,7 @@ namespace Tests { EXPECT_STREQ(inputRequired.c_str(), output.c_str()); //ArrayType Iterator - WPEFramework::Core::JSON::ArrayType::Iterator settings(command->F.J.Elements()); + Thunder::Core::JSON::ArrayType::Iterator settings(command->F.J.Elements()); for (int i = 0; settings.Next(); i++) EXPECT_EQ(settings.Current().Value(), command->F.J[i]); //null test @@ -2473,13 +2473,13 @@ namespace Tests { escapeSequence = 10; input = escapeSequence; printf("\n\n Case 17 \n"); - WPEFramework::Core::ProxyType commandInput = WPEFramework::Core::ProxyType::Create(); - WPEFramework::Core::JSON::Tester<512, CommandRequest> parserInput; + Thunder::Core::ProxyType commandInput = Thunder::Core::ProxyType::Create(); + Thunder::Core::JSON::Tester<512, CommandRequest> parserInput; commandInput->B = input; output.clear(); parserInput.ToString(commandInput, output); - WPEFramework::Core::ProxyType commandOutput = WPEFramework::Core::ProxyType::Create(); - WPEFramework::Core::JSON::Tester<512, CommandRequest> parserOutput; + Thunder::Core::ProxyType commandOutput = Thunder::Core::ProxyType::Create(); + Thunder::Core::JSON::Tester<512, CommandRequest> parserOutput; parserOutput.FromString(output, commandOutput); EXPECT_STREQ(commandInput->B.Value().c_str(), commandOutput->B.Value().c_str()); diff --git a/Tests/unit/core/test_keyvalue.cpp b/Tests/unit/core/test_keyvalue.cpp index 2aeccae02..12089ab7f 100644 --- a/Tests/unit/core/test_keyvalue.cpp +++ b/Tests/unit/core/test_keyvalue.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; TEST(test_keyvaluetype, simple_keyvaluetype) { diff --git a/Tests/unit/core/test_library.cpp b/Tests/unit/core/test_library.cpp index dd53707e7..f8d81d2e2 100644 --- a/Tests/unit/core/test_library.cpp +++ b/Tests/unit/core/test_library.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; TEST(Core_Library, simpleSet) { @@ -35,7 +35,7 @@ TEST(Core_Library, simpleSet) //const string file = _T("/usr/lib/libwpe-0.2.so"); //For box. #endif const TCHAR* function = _T("Test::HelloWorld()"); - const string file1 = _T("libWPEFramework.so"); + const string file1 = _T("libThunder.so"); Library LibObj1(file.c_str()); LibObj1.LoadFunction(function); Library LibObjTest(file1.c_str()); diff --git a/Tests/unit/core/test_library_helloworld.cpp b/Tests/unit/core/test_library_helloworld.cpp index d8ed72ae8..ef0554811 100644 --- a/Tests/unit/core/test_library_helloworld.cpp +++ b/Tests/unit/core/test_library_helloworld.cpp @@ -1,6 +1,6 @@ #include -namespace WPEFramework{ +namespace Thunder{ namespace Test{ std::string HelloWorld(){ return "Hello World!"; diff --git a/Tests/unit/core/test_lockablecontainer.cpp b/Tests/unit/core/test_lockablecontainer.cpp index 89ae5485a..76a42faa7 100644 --- a/Tests/unit/core/test_lockablecontainer.cpp +++ b/Tests/unit/core/test_lockablecontainer.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; class Container { diff --git a/Tests/unit/core/test_measurementtype.cpp b/Tests/unit/core/test_measurementtype.cpp index ae2eeecc6..bcd96f2f1 100644 --- a/Tests/unit/core/test_measurementtype.cpp +++ b/Tests/unit/core/test_measurementtype.cpp @@ -22,7 +22,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { TEST(Core_MeasurementType, simpleSet) @@ -45,4 +45,4 @@ namespace Tests { EXPECT_EQ(data.Measurements(), 0u); } } // Tests -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_memberavailability.cpp b/Tests/unit/core/test_memberavailability.cpp index a10d635c5..df8306414 100644 --- a/Tests/unit/core/test_memberavailability.cpp +++ b/Tests/unit/core/test_memberavailability.cpp @@ -23,7 +23,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { struct TestWithMember { diff --git a/Tests/unit/core/test_messageException.cpp b/Tests/unit/core/test_messageException.cpp index 3ff4674ce..df07f1439 100644 --- a/Tests/unit/core/test_messageException.cpp +++ b/Tests/unit/core/test_messageException.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; TEST(test_messageException, simple_messageException) { diff --git a/Tests/unit/core/test_message_dispatcher.cpp b/Tests/unit/core/test_message_dispatcher.cpp index 50eb40dd1..e3419552d 100644 --- a/Tests/unit/core/test_message_dispatcher.cpp +++ b/Tests/unit/core/test_message_dispatcher.cpp @@ -25,7 +25,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { class Core_MessageDispatcher : public testing::Test { @@ -396,4 +396,4 @@ namespace Tests { } } // Tests -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_message_unit.cpp b/Tests/unit/core/test_message_unit.cpp index abdcf0d87..7610a8cc4 100644 --- a/Tests/unit/core/test_message_unit.cpp +++ b/Tests/unit/core/test_message_unit.cpp @@ -22,7 +22,7 @@ #include #include -using namespace WPEFramework; +using namespace Thunder; class Control : public Core::Messaging::IControl { public: diff --git a/Tests/unit/core/test_networkinfo.cpp b/Tests/unit/core/test_networkinfo.cpp index caa8416c1..96892dfb4 100644 --- a/Tests/unit/core/test_networkinfo.cpp +++ b/Tests/unit/core/test_networkinfo.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; TEST(test_ipv4addressiterator, simple_ipv4addressiterator) { diff --git a/Tests/unit/core/test_nodeid.cpp b/Tests/unit/core/test_nodeid.cpp index 5a4445689..026264e4f 100644 --- a/Tests/unit/core/test_nodeid.cpp +++ b/Tests/unit/core/test_nodeid.cpp @@ -22,7 +22,7 @@ #include #include -using namespace WPEFramework; +using namespace Thunder; TEST(Core_NodeId, simpleSet) { diff --git a/Tests/unit/core/test_numbertype.cpp b/Tests/unit/core/test_numbertype.cpp index 08e4f9644..05d3f4682 100644 --- a/Tests/unit/core/test_numbertype.cpp +++ b/Tests/unit/core/test_numbertype.cpp @@ -22,7 +22,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { template @@ -248,4 +248,4 @@ namespace Tests { EXPECT_EQ(fractional3.Remainder(),4294967295); } } // Tests -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_optional.cpp b/Tests/unit/core/test_optional.cpp index 0fdef55b8..ba0961cc0 100644 --- a/Tests/unit/core/test_optional.cpp +++ b/Tests/unit/core/test_optional.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; TEST(test_optional, simple_test) { diff --git a/Tests/unit/core/test_parser.cpp b/Tests/unit/core/test_parser.cpp index f0d061625..e0d367269 100644 --- a/Tests/unit/core/test_parser.cpp +++ b/Tests/unit/core/test_parser.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; class Deserializer { private: diff --git a/Tests/unit/core/test_portability.cpp b/Tests/unit/core/test_portability.cpp index 3eaec54a5..a4c706522 100644 --- a/Tests/unit/core/test_portability.cpp +++ b/Tests/unit/core/test_portability.cpp @@ -23,8 +23,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; class ThreadClass : public Core::Thread { public: diff --git a/Tests/unit/core/test_processinfo.cpp b/Tests/unit/core/test_processinfo.cpp index b376d8b67..a3b10e97d 100644 --- a/Tests/unit/core/test_processinfo.cpp +++ b/Tests/unit/core/test_processinfo.cpp @@ -22,7 +22,7 @@ #include #include -using namespace WPEFramework; +using namespace Thunder; TEST(Core_ProcessInfo, simpleSet) { diff --git a/Tests/unit/core/test_queue.cpp b/Tests/unit/core/test_queue.cpp index eccb11d94..80a765e3a 100644 --- a/Tests/unit/core/test_queue.cpp +++ b/Tests/unit/core/test_queue.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; TEST(test_queue, simple_queue) { diff --git a/Tests/unit/core/test_rangetype.cpp b/Tests/unit/core/test_rangetype.cpp index 06c0c57e8..0da321e63 100644 --- a/Tests/unit/core/test_rangetype.cpp +++ b/Tests/unit/core/test_rangetype.cpp @@ -22,7 +22,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { template @@ -63,4 +63,4 @@ namespace Tests { EXPECT_EQ(withoutBoundary.Range(), 0u); } } // Tests -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_readwritelock.cpp b/Tests/unit/core/test_readwritelock.cpp index 2c70e64de..80725dd85 100644 --- a/Tests/unit/core/test_readwritelock.cpp +++ b/Tests/unit/core/test_readwritelock.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; TEST(test_ReadWritelock, simpleSet) { diff --git a/Tests/unit/core/test_rectangle.cpp b/Tests/unit/core/test_rectangle.cpp index 36622d7a1..27faeef08 100644 --- a/Tests/unit/core/test_rectangle.cpp +++ b/Tests/unit/core/test_rectangle.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; TEST(test_rectangle, simple_rectangle) { diff --git a/Tests/unit/core/test_rpc.cpp b/Tests/unit/core/test_rpc.cpp index bd53462d3..de3ce2a1f 100644 --- a/Tests/unit/core/test_rpc.cpp +++ b/Tests/unit/core/test_rpc.cpp @@ -25,7 +25,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Exchange { struct IAdder : virtual public Core::IUnknown { enum { ID = 0x80000001 }; @@ -303,4 +303,4 @@ namespace Tests { Core::Singleton::Dispose(); } } // Tests -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_semaphore.cpp b/Tests/unit/core/test_semaphore.cpp index 4bfa1dde2..556fba1bc 100644 --- a/Tests/unit/core/test_semaphore.cpp +++ b/Tests/unit/core/test_semaphore.cpp @@ -23,8 +23,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; static int g_shared = 2; // Change it back to 1 after fixing and enabling simple_criticalsection test diff --git a/Tests/unit/core/test_sharedbuffer.cpp b/Tests/unit/core/test_sharedbuffer.cpp index db7a6ea70..df4650ca9 100644 --- a/Tests/unit/core/test_sharedbuffer.cpp +++ b/Tests/unit/core/test_sharedbuffer.cpp @@ -22,7 +22,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { void CleanUpBuffer(string bufferName) @@ -186,4 +186,4 @@ namespace Tests { Core::Singleton::Dispose(); } } // Tests -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_singleton.cpp b/Tests/unit/core/test_singleton.cpp index 2d60d0502..b9d42e74e 100644 --- a/Tests/unit/core/test_singleton.cpp +++ b/Tests/unit/core/test_singleton.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; class SingletonTypeOne { public: diff --git a/Tests/unit/core/test_socketstreamjson.cpp b/Tests/unit/core/test_socketstreamjson.cpp index d450296c4..23afc4ab3 100644 --- a/Tests/unit/core/test_socketstreamjson.cpp +++ b/Tests/unit/core/test_socketstreamjson.cpp @@ -25,7 +25,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { enum class CommandType { @@ -269,4 +269,4 @@ ENUM_CONVERSION_BEGIN(Tests::CommandType) { Tests::CommandType::PLAYERCONTROL, _TXT("PlayerControl") }, ENUM_CONVERSION_END(Tests::CommandType) -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_socketstreamtext.cpp b/Tests/unit/core/test_socketstreamtext.cpp index aba106a4c..7272f421a 100644 --- a/Tests/unit/core/test_socketstreamtext.cpp +++ b/Tests/unit/core/test_socketstreamtext.cpp @@ -25,7 +25,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { class TextConnector : public Core::StreamTextType { @@ -37,7 +37,7 @@ namespace Tests { TextConnector(const TextConnector& copy) = delete; TextConnector& operator=(const TextConnector&) = delete; - TextConnector(const WPEFramework::Core::NodeId& remoteNode) + TextConnector(const Thunder::Core::NodeId& remoteNode) : BaseClass(false, remoteNode.AnyInterface(), remoteNode, 1024, 1024) , _serverSocket(false) , _dataPending(false, false) @@ -100,7 +100,7 @@ namespace Tests { private: bool _serverSocket; string _dataReceived; - mutable WPEFramework::Core::Event _dataPending; + mutable Thunder::Core::Event _dataPending; static bool _done; public: @@ -150,4 +150,4 @@ namespace Tests { Core::Singleton::Dispose(); } } // Tests -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_statetrigger.cpp b/Tests/unit/core/test_statetrigger.cpp index 53507c062..6c92bf06d 100644 --- a/Tests/unit/core/test_statetrigger.cpp +++ b/Tests/unit/core/test_statetrigger.cpp @@ -21,8 +21,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; enum class TestState { TEST_INIT = 0x00, @@ -33,7 +33,7 @@ enum class TestState { TEST(test_statetrigger, simple_statetrigger) { - WPEFramework::Core::StateTrigger state(TestState::TEST_READY); + Thunder::Core::StateTrigger state(TestState::TEST_READY); EXPECT_EQ(state.GetState(),TestState::TEST_READY) << "State not equal to TEST_READY."; state.SetState(TestState::TEST_MESSAGE); diff --git a/Tests/unit/core/test_stopwatch.cpp b/Tests/unit/core/test_stopwatch.cpp index f7292721c..48a6b9479 100644 --- a/Tests/unit/core/test_stopwatch.cpp +++ b/Tests/unit/core/test_stopwatch.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; TEST(test_stopWatch, Elapsed_WithoutDelay) { diff --git a/Tests/unit/core/test_synchronize.cpp b/Tests/unit/core/test_synchronize.cpp index 93ec8e027..2cb5f57d6 100644 --- a/Tests/unit/core/test_synchronize.cpp +++ b/Tests/unit/core/test_synchronize.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; class SynchronizeClass { public: diff --git a/Tests/unit/core/test_synchronous.cpp b/Tests/unit/core/test_synchronous.cpp index f1a9060d8..70083770f 100644 --- a/Tests/unit/core/test_synchronous.cpp +++ b/Tests/unit/core/test_synchronous.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; namespace { const string localhost = "127.0.0.1"; diff --git a/Tests/unit/core/test_systeminfo.cpp b/Tests/unit/core/test_systeminfo.cpp index fe2e253a2..56e517e96 100644 --- a/Tests/unit/core/test_systeminfo.cpp +++ b/Tests/unit/core/test_systeminfo.cpp @@ -28,7 +28,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { enum class Purpose { @@ -560,18 +560,18 @@ TEST(Core_SystemInfo, Ticks_withDelay) } // Tests ENUM_CONVERSION_BEGIN(Tests::Purpose) - { WPEFramework::Tests::Purpose::MEM, _TXT("mem") }, - { WPEFramework::Tests::Purpose::SWAP, _TXT("swap") }, - { WPEFramework::Tests::Purpose::HOST, _TXT("host") }, - { WPEFramework::Tests::Purpose::CHIPSET, _TXT("chipset") }, - { WPEFramework::Tests::Purpose::CPULOAD, _TXT("cpuload") }, + { Thunder::Tests::Purpose::MEM, _TXT("mem") }, + { Thunder::Tests::Purpose::SWAP, _TXT("swap") }, + { Thunder::Tests::Purpose::HOST, _TXT("host") }, + { Thunder::Tests::Purpose::CHIPSET, _TXT("chipset") }, + { Thunder::Tests::Purpose::CPULOAD, _TXT("cpuload") }, ENUM_CONVERSION_END(Tests::Purpose) ENUM_CONVERSION_BEGIN(Tests::Function) - { WPEFramework::Tests::Function::TOTAL, _TXT("total") }, - { WPEFramework::Tests::Function::FREE, _TXT("free") }, - { WPEFramework::Tests::Function::AVAILABLE, _TXT("available") }, - { WPEFramework::Tests::Function::CACHED, _TXT("cached") }, + { Thunder::Tests::Function::TOTAL, _TXT("total") }, + { Thunder::Tests::Function::FREE, _TXT("free") }, + { Thunder::Tests::Function::AVAILABLE, _TXT("available") }, + { Thunder::Tests::Function::CACHED, _TXT("cached") }, ENUM_CONVERSION_END(Tests::Function) -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_textfragment.cpp b/Tests/unit/core/test_textfragment.cpp index 7dcd2d171..fde006b6c 100644 --- a/Tests/unit/core/test_textfragment.cpp +++ b/Tests/unit/core/test_textfragment.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; TEST(test_textfragment, simple_textfragement) { diff --git a/Tests/unit/core/test_textreader.cpp b/Tests/unit/core/test_textreader.cpp index fe658a81c..864c000ee 100644 --- a/Tests/unit/core/test_textreader.cpp +++ b/Tests/unit/core/test_textreader.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; TEST(test_TextReader, simple_TextReader) { diff --git a/Tests/unit/core/test_thread.cpp b/Tests/unit/core/test_thread.cpp index 97b08b217..defbf2502 100644 --- a/Tests/unit/core/test_thread.cpp +++ b/Tests/unit/core/test_thread.cpp @@ -24,7 +24,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { class ThreadClass : public Core::Thread { @@ -123,4 +123,4 @@ namespace Tests { object.Wait(Core::Thread::BLOCKED | Core::Thread::STOPPED | Core::Thread::STOPPING, Core::infinite); } } // Tests -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_threadpool.cpp b/Tests/unit/core/test_threadpool.cpp index bfc41b990..42443a27b 100644 --- a/Tests/unit/core/test_threadpool.cpp +++ b/Tests/unit/core/test_threadpool.cpp @@ -23,8 +23,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; static constexpr uint32_t MaxJobWaitTime = 1000; // In milliseconds static constexpr uint8_t MaxAdditionalWorker = 5; @@ -433,7 +433,7 @@ TEST(Core_ThreadPool, CheckMinion_ProcessJob) minion.Shutdown(); EXPECT_EQ(static_cast&>(*job).GetStatus(), TestJob::COMPLETED); - WPEFramework::Core::ThreadPool::Metadata info; + Thunder::Core::ThreadPool::Metadata info; minion.Info(info); EXPECT_EQ(info.Runs, 1u); @@ -458,7 +458,7 @@ TEST(Core_ThreadPool, CheckMinion_ProcessJob_CheckActiveStateInBetweenDispatch) EXPECT_EQ(static_cast&>(*job).GetStatus(), TestJob::COMPLETED); - WPEFramework::Core::ThreadPool::Metadata info; + Thunder::Core::ThreadPool::Metadata info; minion.Info(info); EXPECT_EQ(info.Runs, 1u); @@ -479,7 +479,7 @@ TEST(Core_ThreadPool, CheckMinion_CancelJob_BeforeProcessing) EXPECT_EQ(minion.IsActive(), false); EXPECT_EQ(static_cast&>(*job).GetStatus(), TestJob::CANCELED); - WPEFramework::Core::ThreadPool::Metadata info; + Thunder::Core::ThreadPool::Metadata info; minion.Info(info); EXPECT_EQ(info.Runs, 0u); @@ -508,7 +508,7 @@ TEST(Core_ThreadPool, CheckMinion_CancelJob_WhileProcessing) EXPECT_EQ(minion.IsActive(), false); EXPECT_EQ(static_cast&>(*job).GetStatus(), TestJob::COMPLETED); - WPEFramework::Core::ThreadPool::Metadata info; + Thunder::Core::ThreadPool::Metadata info; minion.Info(info); EXPECT_EQ(info.Runs, 1u); @@ -531,7 +531,7 @@ TEST(Core_ThreadPool, CheckMinion_CancelJob_WhileProcessing_ByAddingWaitOnTheDis minion.NotifyReady(job); EXPECT_EQ(static_cast&>(*job).GetStatus(), TestJob::COMPLETED); - WPEFramework::Core::ThreadPool::Metadata info; + Thunder::Core::ThreadPool::Metadata info; minion.Info(info); EXPECT_EQ(info.Runs, 1u); @@ -573,7 +573,7 @@ TEST(Core_ThreadPool, CheckMinion_ProcessMultipleJobs) EXPECT_EQ(static_cast&>(*job).GetStatus(), TestJob::COMPLETED); } - WPEFramework::Core::ThreadPool::Metadata info; + Thunder::Core::ThreadPool::Metadata info; minion.Info(info); EXPECT_EQ(info.Runs, 6u); @@ -627,7 +627,7 @@ TEST(Core_ThreadPool, CheckMinion_ProcessMultipleJobs_CancelInBetween) minion.Shutdown(); - WPEFramework::Core::ThreadPool::Metadata info; + Thunder::Core::ThreadPool::Metadata info; minion.Info(info); EXPECT_EQ(info.Runs, queueSize); @@ -736,7 +736,7 @@ void CheckThreadPool_ProcessMultipleJobs(const uint8_t threadCount, const uint8_ uint8_t totalRuns = 0; - WPEFramework::Core::ThreadPool::Metadata info[threadCount]; + Thunder::Core::ThreadPool::Metadata info[threadCount]; std::vector jobsStrings; threadPool.Snapshot(threadCount, info, jobsStrings); @@ -819,7 +819,7 @@ TEST(Core_ThreadPool, CheckThreadPool_ProcessMultipleJobs_CancelInBetween) uint8_t totalRuns = 0; - WPEFramework::Core::ThreadPool::Metadata info[threadCount]; + Thunder::Core::ThreadPool::Metadata info[threadCount]; std::vector jobsStrings; threadPool.Snapshot(threadCount, info, jobsStrings); @@ -876,7 +876,7 @@ void CheckThreadPool_ProcessMultipleJobs_CancelInBetween_WithMultiplePool(const uint8_t totalRuns = 0; - WPEFramework::Core::ThreadPool::Metadata info[threadCount]; + Thunder::Core::ThreadPool::Metadata info[threadCount]; std::vector jobsStrings; threadPool.Snapshot(threadCount, info, jobsStrings); @@ -1028,7 +1028,7 @@ void CheckThreadPool_JobType_Submit_Using_Idle(const uint8_t threadCount, const uint8_t totalRuns = 0; - WPEFramework::Core::ThreadPool::Metadata info[threadCount]; + Thunder::Core::ThreadPool::Metadata info[threadCount]; std::vector jobsStrings; threadPool.Snapshot(threadCount, info, jobsStrings); @@ -1144,7 +1144,7 @@ void CheckThreadPool_JobType_Submit_Using_Submit(const uint8_t threadCount, cons uint8_t totalRuns = 0; - WPEFramework::Core::ThreadPool::Metadata info[threadCount]; + Thunder::Core::ThreadPool::Metadata info[threadCount]; std::vector jobsStrings; threadPool.Snapshot(threadCount, info, jobsStrings); @@ -1255,7 +1255,7 @@ void CheckThreadPool_JobType_Submit_Using_Reschedule(const uint8_t threadCount, uint8_t totalRuns = 0; - WPEFramework::Core::ThreadPool::Metadata info[threadCount]; + Thunder::Core::ThreadPool::Metadata info[threadCount]; std::vector jobsStrings; threadPool.Snapshot(threadCount, info, jobsStrings); @@ -1352,7 +1352,7 @@ TEST(Core_ThreadPool, CheckThreadPool_JobType_Reschedule_AfterSubmit) uint8_t totalRuns = 0; - WPEFramework::Core::ThreadPool::Metadata info[threadCount]; + Thunder::Core::ThreadPool::Metadata info[threadCount]; std::vector jobsStrings; threadPool.Snapshot(threadCount, info, jobsStrings); @@ -1415,7 +1415,7 @@ TEST(Core_ThreadPool, CheckThreadPool_JobType_Reschedule_AfterIdle) uint8_t totalRuns = 0; - WPEFramework::Core::ThreadPool::Metadata info[threadCount]; + Thunder::Core::ThreadPool::Metadata info[threadCount]; std::vector jobsStrings; threadPool.Snapshot(threadCount, info, jobsStrings); diff --git a/Tests/unit/core/test_time.cpp b/Tests/unit/core/test_time.cpp index 0a4d0f5cc..0e193ba55 100644 --- a/Tests/unit/core/test_time.cpp +++ b/Tests/unit/core/test_time.cpp @@ -23,8 +23,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; int32_t GetMachineTimeDifference(const string& zone) { diff --git a/Tests/unit/core/test_timer.cpp b/Tests/unit/core/test_timer.cpp index b15d47ea0..a919d792d 100644 --- a/Tests/unit/core/test_timer.cpp +++ b/Tests/unit/core/test_timer.cpp @@ -24,7 +24,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { class TimeHandler { @@ -179,4 +179,4 @@ namespace Tests { EXPECT_EQ(ret, Core::ERROR_NONE); } } // Tests -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_tracing.cpp b/Tests/unit/core/test_tracing.cpp index ec8b4073c..0d32cb406 100644 --- a/Tests/unit/core/test_tracing.cpp +++ b/Tests/unit/core/test_tracing.cpp @@ -24,8 +24,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; #pragma pack(push) #pragma pack(1) diff --git a/Tests/unit/core/test_tristate.cpp b/Tests/unit/core/test_tristate.cpp index a80f525f3..2d71c0c52 100644 --- a/Tests/unit/core/test_tristate.cpp +++ b/Tests/unit/core/test_tristate.cpp @@ -22,8 +22,8 @@ #include #include -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; TEST(test_TriState, simple_TriState) { diff --git a/Tests/unit/core/test_valuerecorder.cpp b/Tests/unit/core/test_valuerecorder.cpp index fecf64be1..c0adeb507 100644 --- a/Tests/unit/core/test_valuerecorder.cpp +++ b/Tests/unit/core/test_valuerecorder.cpp @@ -22,8 +22,8 @@ #include "gtest/gtest.h" #include "core/core.h" -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; const unsigned int BLOCKSIZE = 20; diff --git a/Tests/unit/core/test_weblinkjson.cpp b/Tests/unit/core/test_weblinkjson.cpp index 255c95011..f811a24ab 100644 --- a/Tests/unit/core/test_weblinkjson.cpp +++ b/Tests/unit/core/test_weblinkjson.cpp @@ -23,7 +23,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { namespace { @@ -99,9 +99,9 @@ namespace { } - class JSONWebServer : public Web::WebLinkType&> { + class JSONWebServer : public Web::WebLinkType&> { private: - typedef Web::WebLinkType&> BaseClass; + typedef Web::WebLinkType&> BaseClass; public: JSONWebServer() = delete; @@ -117,12 +117,12 @@ namespace { virtual ~JSONWebServer() { - Close(WPEFramework::Core::infinite); + Close(Thunder::Core::infinite); } public: // Notification of a Partial Request received, time to attach a body.. - virtual void LinkBody(Core::ProxyType& element) + virtual void LinkBody(Core::ProxyType& element) { // Time to attach a Command Body element->Body(_commandBodyFactory.Element()); @@ -157,16 +157,16 @@ namespace { Core::ProxyPoolType _commandBodyFactory; }; - class JSONWebClient : public Web::WebLinkType&> { + class JSONWebClient : public Web::WebLinkType&> { private: - typedef Web::WebLinkType&> BaseClass; + typedef Web::WebLinkType&> BaseClass; public: JSONWebClient() = delete; JSONWebClient(const JSONWebClient& copy) = delete; JSONWebClient& operator=(const JSONWebClient&) = delete; - JSONWebClient(const WPEFramework::Core::NodeId& remoteNode) + JSONWebClient(const Thunder::Core::NodeId& remoteNode) : BaseClass(5, _responseFactory, false, remoteNode.AnyInterface(), remoteNode, 2048, 208) , _dataPending(false, false) , _responseFactory(5) @@ -176,12 +176,12 @@ namespace { virtual ~JSONWebClient() { - Close(WPEFramework::Core::infinite); + Close(Thunder::Core::infinite); } public: // Notification of a Partial Request received, time to attach a body.. - virtual void LinkBody(Core::ProxyType& element) + virtual void LinkBody(Core::ProxyType& element) { // Time to attach a Command Body element->Body(_commandBodyFactory.Element()); @@ -222,7 +222,7 @@ namespace { } private: - mutable WPEFramework::Core::Event _dataPending; + mutable Thunder::Core::Event _dataPending; string _dataReceived; Core::ProxyPoolType _responseFactory; Core::ProxyPoolType _commandBodyFactory; @@ -276,4 +276,4 @@ ENUM_CONVERSION_BEGIN(Tests::CommandType) { Tests::CommandType::PLAYERCONTROL, _TXT("PlayerControl") }, ENUM_CONVERSION_END(Tests::CommandType) -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_weblinktext.cpp b/Tests/unit/core/test_weblinktext.cpp index 2aa8c5c41..49d135c0a 100644 --- a/Tests/unit/core/test_weblinktext.cpp +++ b/Tests/unit/core/test_weblinktext.cpp @@ -23,12 +23,12 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { - class WebServer : public Web::WebLinkType > { + class WebServer : public Web::WebLinkType > { private: - typedef Web::WebLinkType > BaseClass; + typedef Web::WebLinkType > BaseClass; public: WebServer() = delete; @@ -42,18 +42,18 @@ namespace Tests { virtual ~WebServer() { - Close(WPEFramework::Core::infinite); + Close(Thunder::Core::infinite); } public: // Notification of a Partial Request received, time to attach a body.. - virtual void LinkBody(Core::ProxyType& element) + virtual void LinkBody(Core::ProxyType& element) { // Time to attach a String Body element->Body(_textBodyFactory.Element()); } - virtual void Received(Core::ProxyType& request) + virtual void Received(Core::ProxyType& request) { EXPECT_EQ(request->Verb, Web::Request::HTTP_GET); EXPECT_EQ(request->MajorVersion, 1); @@ -67,7 +67,7 @@ namespace Tests { Submit(response); } - virtual void Send(const Core::ProxyType& response) + virtual void Send(const Core::ProxyType& response) { EXPECT_EQ(response->ErrorCode, 200); EXPECT_TRUE(response->HasBody()); @@ -83,16 +83,16 @@ namespace Tests { Core::ProxyPoolType WebServer::_textBodyFactory(5); - class WebClient : public Web::WebLinkType&> { + class WebClient : public Web::WebLinkType&> { private: - typedef Web::WebLinkType&> BaseClass; + typedef Web::WebLinkType&> BaseClass; public: WebClient() = delete; WebClient(const WebClient& copy) = delete; WebClient& operator=(const WebClient&) = delete; - WebClient(const WPEFramework::Core::NodeId& remoteNode) + WebClient(const Thunder::Core::NodeId& remoteNode) : BaseClass(5,_responseFactory, false, remoteNode.AnyInterface(), remoteNode, 2048, 208) , _dataPending(false, false) { @@ -100,18 +100,18 @@ namespace Tests { virtual ~WebClient() { - Close(WPEFramework::Core::infinite); + Close(Thunder::Core::infinite); } public: // Notification of a Partial Request received, time to attach a body.. - virtual void LinkBody(Core::ProxyType& element) + virtual void LinkBody(Core::ProxyType& element) { // Time to attach a String Body element->Body(_textBodyFactory.Element()); } - virtual void Received(Core::ProxyType& response) + virtual void Received(Core::ProxyType& response) { EXPECT_EQ(response->ErrorCode, 200); EXPECT_STREQ(response->Message.c_str(), "OK"); @@ -124,7 +124,7 @@ namespace Tests { _dataPending.Unlock(); } - virtual void Send(const Core::ProxyType& request) + virtual void Send(const Core::ProxyType& request) { EXPECT_EQ(request->Verb, Web::Request::HTTP_GET); EXPECT_TRUE(request->HasBody()); @@ -146,7 +146,7 @@ namespace Tests { } private: - mutable WPEFramework::Core::Event _dataPending; + mutable Thunder::Core::Event _dataPending; string _dataReceived; static Core::ProxyPoolType _responseFactory; static Core::ProxyPoolType _textBodyFactory; @@ -193,4 +193,4 @@ namespace Tests { } } // Tests -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_websocketjson.cpp b/Tests/unit/core/test_websocketjson.cpp index 274d21c89..4f9e19c19 100644 --- a/Tests/unit/core/test_websocketjson.cpp +++ b/Tests/unit/core/test_websocketjson.cpp @@ -25,7 +25,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { class Message : public Core::JSON::Container { @@ -251,4 +251,4 @@ namespace Tests { } } // Tests -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_websockettext.cpp b/Tests/unit/core/test_websockettext.cpp index 57e83d886..6753e9ab5 100644 --- a/Tests/unit/core/test_websockettext.cpp +++ b/Tests/unit/core/test_websockettext.cpp @@ -25,7 +25,7 @@ #include #include -namespace WPEFramework { +namespace Thunder { namespace Tests { class TextSocketServer : public Core::StreamTextType, Core::TerminatorCarriageReturn> { @@ -37,7 +37,7 @@ namespace Tests { TextSocketServer(const TextSocketServer&) = delete; TextSocketServer& operator=(const TextSocketServer&) = delete; - TextSocketServer(const SOCKET& socket, const WPEFramework::Core::NodeId& remoteNode, WPEFramework::Core::SocketServerType*) + TextSocketServer(const SOCKET& socket, const Thunder::Core::NodeId& remoteNode, Thunder::Core::SocketServerType*) : BaseClass(false, true, false, socket, remoteNode, 1024, 1024) { } @@ -129,7 +129,7 @@ namespace Tests { private: string _dataReceived; - mutable WPEFramework::Core::Event _dataPending; + mutable Thunder::Core::Event _dataPending; }; TEST(WebSocket, DISABLED_Text) @@ -171,4 +171,4 @@ namespace Tests { } } // Tests -} // WPEFramework +} // Thunder diff --git a/Tests/unit/core/test_workerpool.cpp b/Tests/unit/core/test_workerpool.cpp index 0f9d0a7c7..5a6a9dd33 100644 --- a/Tests/unit/core/test_workerpool.cpp +++ b/Tests/unit/core/test_workerpool.cpp @@ -23,7 +23,7 @@ #include #include -using namespace WPEFramework; using namespace WPEFramework::Core; +using namespace Thunder; using namespace Thunder::Core; static constexpr uint32_t MaxJobWaitTime = 1000; // In milliseconds static constexpr uint8_t MaxAdditionalWorker = 5; diff --git a/Tests/unit/core/test_xgetopt.cpp b/Tests/unit/core/test_xgetopt.cpp index df0dda5c3..27feec7c8 100644 --- a/Tests/unit/core/test_xgetopt.cpp +++ b/Tests/unit/core/test_xgetopt.cpp @@ -25,8 +25,8 @@ int argumentCount = 3; char* arguments[]= {(char*)"-c", (char*)"-h", (char*)"-b"}; -using namespace WPEFramework; -using namespace WPEFramework::Core; +using namespace Thunder; +using namespace Thunder::Core; class ConsoleOptions : public Core::Options { public: diff --git a/Tests/unit/tests/CMakeLists.txt b/Tests/unit/tests/CMakeLists.txt index 37d4fb74e..2beab4a41 100644 --- a/Tests/unit/tests/CMakeLists.txt +++ b/Tests/unit/tests/CMakeLists.txt @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(TEST_RUNNER_NAME "WPEFramework_test_tests") +set(TEST_RUNNER_NAME "Thunder_test_tests") add_executable(${TEST_RUNNER_NAME} test_iptestmanager.cpp @@ -25,10 +25,10 @@ add_executable(${TEST_RUNNER_NAME} target_link_libraries(${TEST_RUNNER_NAME} ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} - WPEFrameworkCore - WPEFrameworkTracing - WPEFrameworkWebSocket - WPEFrameworkCOM + ThunderCore + ThunderTracing + ThunderWebSocket + ThunderCOM ) install( diff --git a/Tests/workerpool-test/WorkerPoolTest.cpp b/Tests/workerpool-test/WorkerPoolTest.cpp index 9a0c1176d..ae6575458 100644 --- a/Tests/workerpool-test/WorkerPoolTest.cpp +++ b/Tests/workerpool-test/WorkerPoolTest.cpp @@ -20,7 +20,7 @@ #include #include "Module.h" -using namespace WPEFramework; +using namespace Thunder; class WorkerPoolTestAdministrator { diff --git a/docs/assets/simple_execution_modes.drawio.svg b/docs/assets/simple_execution_modes.drawio.svg index 0d911eb6b..1da950e69 100644 --- a/docs/assets/simple_execution_modes.drawio.svg +++ b/docs/assets/simple_execution_modes.drawio.svg @@ -1,4 +1,4 @@ -
Out-Of-Process Plugins
Out-Of-Process Plugins
WPEFramework
WPEFramework
JSON-RPC
JSON-RPC
Client A
Client A
JSON-RPC Server
JSON-RPC Server
WPEProcess
WPEProcess
PluginX
PluginX
COM-RPC Server
COM-RPC Server
WPEProcess
WPEProcess
PluginY
PluginY
In Process Plugins
In Process Plugins
PluginA
PluginA
PluginB
PluginB
PluginC
PluginC
Controller
Controller
Each OOP plugin runs in an
individual WPEProcess instance
Each OOP plugin runs in an...
Text is not SVG - cannot display
\ No newline at end of file +
Out-Of-Process Plugins
Out-Of-Process Plugins
Thunder
Thunder
JSON-RPC
JSON-RPC
Client A
Client A
JSON-RPC Server
JSON-RPC Server
ThunderPlugin
ThunderPlugin
PluginX
PluginX
COM-RPC Server
COM-RPC Server
ThunderPlugin
ThunderPlugin
PluginY
PluginY
In Process Plugins
In Process Plugins
PluginA
PluginA
PluginB
PluginB
PluginC
PluginC
Controller
Controller
Each OOP plugin runs in an
individual ThunderPlugin instance
Each OOP plugin runs in an...
Text is not SVG - cannot display
diff --git a/docs/index.md b/docs/index.md index eedbf8137..7e61f8001 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,4 +1,4 @@ -Thunder (also known as WPEFramework) is an open-source plugin-based device abstraction layer, where business functionality can be implemented as plugins and applications can query and control those plugins. Using Thunder provides a consistent interface-driven development model for both plugins and client applications, with an RPC engine that is suited to both web-based and native apps. +Thunder is an open-source plugin-based device abstraction layer, where business functionality can be implemented as plugins and applications can query and control those plugins. Using Thunder provides a consistent interface-driven development model for both plugins and client applications, with an RPC engine that is suited to both web-based and native apps. Designed from the ground up for embedded platforms and written in C++11, Thunder can be run on even the most low-power of devices (including ARM and MIPS-based platforms). diff --git a/docs/introduction/build_linux.md b/docs/introduction/build_linux.md index 116ae85c9..15ebaa4fd 100644 --- a/docs/introduction/build_linux.md +++ b/docs/introduction/build_linux.md @@ -58,12 +58,12 @@ cmake -G Ninja -S Thunder -B build/Thunder \ -DBINDING="127.0.0.1" \ -DCMAKE_BUILD_TYPE="Debug" \ -DCMAKE_INSTALL_PREFIX="install/usr" \ --DCMAKE_MODULE_PATH="${PWD}/install/usr/include/WPEFramework/Modules" \ --DDATA_PATH="${PWD}/install/usr/share/WPEFramework" \ --DPERSISTENT_PATH="${PWD}/install/var/wpeframework" \ +-DCMAKE_MODULE_PATH="${PWD}/install/usr/include/Thunder/Modules" \ +-DDATA_PATH="${PWD}/install/usr/share/Thunder" \ +-DPERSISTENT_PATH="${PWD}/install/var/thunder" \ -DPORT="55555" \ --DPROXYSTUB_PATH="${PWD}/install/usr/lib/wpeframework/proxystubs" \ --DSYSTEM_PATH="${PWD}/install/usr/lib/wpeframework/plugins" \ +-DPROXYSTUB_PATH="${PWD}/install/usr/lib/thunder/proxystubs" \ +-DSYSTEM_PATH="${PWD}/install/usr/lib/thunder/plugins" \ -DVOLATILE_PATH="tmp" cmake --build build/Thunder --target install @@ -85,7 +85,7 @@ Run the following commands to build and then install ThunderInterfaces: ```shell cmake -G Ninja -S ThunderInterfaces -B build/ThunderInterfaces \ -DCMAKE_INSTALL_PREFIX="install/usr" \ --DCMAKE_MODULE_PATH="${PWD}/install/usr/include/WPEFramework/Modules" +-DCMAKE_MODULE_PATH="${PWD}/install/usr/include/Thunder/Modules" cmake --build build/ThunderInterfaces --target install ``` @@ -108,7 +108,7 @@ In the command below, there is a complete list of plugins that do not require an ```shell cmake -G Ninja -S ThunderNanoServices -B build/ThunderNanoServices \ -DCMAKE_INSTALL_PREFIX="install/usr" \ --DCMAKE_MODULE_PATH="${PWD}/install/usr/include/WPEFramework/Modules" \ +-DCMAKE_MODULE_PATH="${PWD}/install/usr/include/Thunder/Modules" \ -DPLUGIN_COMMANDER=ON \ -DPLUGIN_DHCPSERVER=ON \ -DPLUGIN_DIALSERVER=ON \ @@ -144,7 +144,7 @@ In the command below, there is a complete list of plugins that do not require an ```shell cmake -G Ninja -S ThunderNanoServicesRDK -B build/ThunderNanoServicesRDK \ -DCMAKE_INSTALL_PREFIX="install/usr" \ --DCMAKE_MODULE_PATH="${PWD}/install/usr/include/WPEFramework/Modules" \ +-DCMAKE_MODULE_PATH="${PWD}/install/usr/include/Thunder/Modules" \ -DPLUGIN_DEVICEIDENTIFICATION=ON \ -DPLUGIN_DEVICEINFO=ON \ -DPLUGIN_LOCATIONSYNC=ON \ @@ -174,7 +174,7 @@ In the command below, there is a complete list of client libraries that do not r ```shell cmake -G Ninja -S ThunderClientLibraries -B build/ThunderClientLibraries \ -DCMAKE_INSTALL_PREFIX="install/usr" \ --DCMAKE_MODULE_PATH="${PWD}/install/usr/include/WPEFramework/Modules" \ +-DCMAKE_MODULE_PATH="${PWD}/install/usr/include/Thunder/Modules" \ -DBLUETOOTHAUDIOSINK=ON \ -DDEVICEINFO=ON \ -DDISPLAYINFO=ON \ @@ -206,7 +206,7 @@ Run the following commands to build and then install ThunderUI: ```shell cmake -G Ninja -S ThunderUI -B build/ThunderUI \ -DCMAKE_INSTALL_PREFIX="install/usr" \ --DCMAKE_MODULE_PATH="${PWD}/install/usr/include/WPEFramework/Modules" +-DCMAKE_MODULE_PATH="${PWD}/install/usr/include/Thunder/Modules" cmake --build build/ThunderUI --target install ``` @@ -222,25 +222,25 @@ Since we installed Thunder in a custom installation directory, we need to provid export LD_LIBRARY_PATH=${PWD}/install/usr/lib:${LD_LIBRARY_PATH} export PATH=${PWD}/install/usr/bin:${PATH} -WPEFramework -f -c ${PWD}/install/etc/WPEFramework/config.json +$ Thunder -f -c ${PWD}/install/etc/Thunder/config.json ``` -The following arguments should be specified to the WPEFramework binary: +The following arguments should be specified to the Thunder binary: * `-f`: Flush plugin messages/logs directly to the console - useful for debugging. In production, you should use the `MessageControl` plugin to forward messages to a suitable sink. -* `-c`: Path to WPEFramework config file +* `-c`: Path to Thunder config file All being well, you should see Thunder start up: ``` -[Tue, 06 Jun 2023 10:04:31]:[PluginHost.cpp:584]:[main]:[Startup]: WPEFramework +[Tue, 06 Jun 2023 10:04:31]:[PluginHost.cpp:584]:[main]:[Startup]: Thunder [Tue, 06 Jun 2023 10:04:31]:[PluginHost.cpp:585]:[main]:[Startup]: Starting time: Tue, 06 Jun 2023 09:04:31 GMT [Tue, 06 Jun 2023 10:04:31]:[PluginHost.cpp:586]:[main]:[Startup]: Process Id: 25382 [Tue, 06 Jun 2023 10:04:31]:[PluginHost.cpp:587]:[main]:[Startup]: Tree ref: engineering_build_for_debug_purpose_only [Tue, 06 Jun 2023 10:04:31]:[PluginHost.cpp:588]:[main]:[Startup]: Build ref: engineering_build_for_debug_purpose_only [Tue, 06 Jun 2023 10:04:31]:[PluginHost.cpp:589]:[main]:[Startup]: Version: 4:0:0 ... -[Tue, 06 Jun 2023 10:04:32]:[PluginHost.cpp:609]:[main]:[Startup]: WPEFramework actively listening +[Tue, 06 Jun 2023 10:04:32]:[PluginHost.cpp:609]:[main]:[Startup]: Thunder actively listening ``` If you followed these instructions, Thunder will be listening for web requests on `localhost:55555` diff --git a/docs/introduction/config.md b/docs/introduction/config.md index 414bf8a55..e332db453 100644 --- a/docs/introduction/config.md +++ b/docs/introduction/config.md @@ -1,8 +1,8 @@ -Thunder uses a JSON configuration file to modify the its behaviour. By default it looks for a config file in `/etc/WPEFramework/config.json` on Linux, although a custom path can be specified at launch. +Thunder uses a JSON configuration file to modify the its behaviour. By default it looks for a config file in `/etc/Thunder/config.json` on Linux, although a custom path can be specified at launch. -When building Thunder, it will generate a default config file based on the options provided to CMake at configure-time using the generic config builder here: [https://github.com/rdkcentral/Thunder/blob/master/Source/WPEFramework/GenericConfig.cmake](https://github.com/rdkcentral/Thunder/blob/master/Source/WPEFramework/GenericConfig.cmake) +When building Thunder, it will generate a default config file based on the options provided to CMake at configure-time using the generic config builder here: [https://github.com/rdkcentral/Thunder/blob/master/Source/Thunder/GenericConfig.cmake](https://github.com/rdkcentral/Thunder/blob/master/Source/Thunder/GenericConfig.cmake) -This section documents the available options for WPEFramework. This is different from the plugin-specific configuration which is documented elsewhere. +This section documents the available options for Thunder. This is different from the plugin-specific configuration which is documented elsewhere. !!! note Any options that are children of a parent option are documented as `parent.child`. E.G `parentOption.childOption = true` equates to the following JSON @@ -25,11 +25,11 @@ This section documents the available options for WPEFramework. This is different | interface | The network interface Thunder will bind on. If empty, will pick the first appropriate interface. | string | - | `eth0` | | prefix | URL prefix for the REST/HTTP endpoint | string | Service | | | jsonrpc | URL prefix for the JSON-RPC endpoint | string | jsonrpc | | -| persistentpath | Directory to store persistent data in.

Each plugin will have an associated directory underneath this corresponding to the callsign of the plugin. | string | - | /opt/wpeframework/ | -| datapath | Read-only directory plugins can read data from.

Each plugin will have an associated directory underneath this corresponding to the callsign of the plugin. | string | - | usr/share/wpeframework | -| systempath | Directory plugin libraries are installed and available in | string | - | /usr/lib/wpeframework/ | +| persistentpath | Directory to store persistent data in.

Each plugin will have an associated directory underneath this corresponding to the callsign of the plugin. | string | - | /opt/thunder/ | +| datapath | Read-only directory plugins can read data from.

Each plugin will have an associated directory underneath this corresponding to the callsign of the plugin. | string | - | usr/share/thunder | +| systempath | Directory plugin libraries are installed and available in | string | - | /usr/lib/thunder/ | | volatilepath | Directory to store volatile temporary data.

Each plugin will have an associated directory underneath this corresponding to the callsign of the plugin | string | /tmp | /tmp/ | -| proxystubpath | Directory to search for the generated proxy stub libraries | string | - | /usr/lib/wpeframework/proxystubs | +| proxystubpath | Directory to search for the generated proxy stub libraries | string | - | /usr/lib/thunder/proxystubs | | postmortempath | Directory to store debugging info (worker pool information, debug data) in the event of a plugin or server crash.

If breakpad is found during build, will store breakpad mindumps here | string | /opt/minidumps | /opt/minidumps | | communicator | Socket to listen for COM-RPC messages. Can be a filesystem path on Linux for a Unix domain socket, or a TCP socket.

For unix sockets, the file permissions can be specified by adding a `|` followed by the numeric permissions | string | /tmp/communicator\|0777 | 127.0.0.1:4000 | | redirect | Redirect incoming HTTP requests to the root Thunder URL to this address | string | http://127.0.0.1/Service/Controller/UI | http://127.0.0.1/Service/Controller/UI | @@ -39,24 +39,24 @@ This section documents the available options for WPEFramework. This is different | legacyinitalize | Enables legacy Plugin initialization behaviour where the Deinitialize() method is not called on if Initialize() fails. For backwards compatibility | bool | false | false | | defaultmessagingcategories | See "Messaging configuration" below | object | - | - | | defaultwarningreportingcategories | See "Warning Reporting Configuration" below | array | - | - | -| process.user | The Linux user the WPEFramework process runs as | string | - | myusr | -| process.group | The Linux group the WPEFramework process runs under | string | - | mygrp | -| process.priority | The nice priority of the WPEFramework process | integer | - | 0 | -| process.policy | The linux scheduling priority of the WPEFramework process. Valid values are: `Batch`, `FIFO`, `Idle`, `RoundRobin`, `Other` | string | - | OTHER | +| process.user | The Linux user the Thunder process runs as | string | - | myusr | +| process.group | The Linux group the Thunder process runs under | string | - | mygrp | +| process.priority | The nice priority of the Thunder process | integer | - | 0 | +| process.policy | The linux scheduling priority of the Thunder process. Valid values are: `Batch`, `FIFO`, `Idle`, `RoundRobin`, `Other` | string | - | OTHER | | process.oomadjust | The OOM killer score (see [here](https://lwn.net/Articles/317814/) for more info) | integer | - | 0 | | process.stacksize | The default stack size in bytes for spawned threads. If not set or 0, will use to Linux defaults | integer | - | 4096 | -| process.umask | Set the WPEFramework umask value | integer | - | 077 | +| process.umask | Set the Thunder umask value | integer | - | 077 | | input.locator | If using Thunder input handling. Socket to receive key events over | string | /tmp/keyhandler\|0766 | - | | input.type | If using Thunder input handling. Input device type (either `device` (`/dev/uinput`) or `virtual` (json-rpc api) | string | Virtual | Device | | input.output | If using Thunder input handling. Whether input events should be re-output for forwarding | bool | true | - | -| configs | Directory to search for plugin config files | string | If not set, will default to `/plugins` (e.g. /etc/WPEFramework/plugins) | `/etc/thunder/plugins` | +| configs | Directory to search for plugin config files | string | If not set, will default to `/plugins` (e.g. /etc/Thunder/plugins) | `/etc/thunder/plugins` | | ethernetcard | :warning: **Deprecated**

Using the MAC address of this interface, Thunder will generate a unique identifier | string | - | `eth0` | | plugins | :warning: **Deprecated**

Array of plugin configurations. Not recommended - each plugin should have its own config file. Normally only used for Controller plugin configuration | array | - | - | -| environments | Array of environment variables to set for the WPEFramework process. Each item in the array should be an object with `key`, `value`, and `override` properties.

Values can be built from path substitutions (e.g. `%persistentpath%`) | array | - | `[{"name": "FOO", "value": "BAR", "override": true}]` | +| environments | Array of environment variables to set for the Thunder process. Each item in the array should be an object with `key`, `value`, and `override` properties.

Values can be built from path substitutions (e.g. `%persistentpath%`) | array | - | `[{"name": "FOO", "value": "BAR", "override": true}]` | | exitreasons | Array of plugin exit/deactivation reasons that should result in the postmortem handler being triggered (e.g. to create minidump, dump worker thread status) | array | - | `["Failure","MemoryExceeded","WatchdogExpired"]` | | messagingport | By default, the messaging engine sends log/trace messages over a unix socket. Provide a TCP port here to use that port instead if desired | int | - | 3000 | | processcontainers.logging | Path for container logs if using process container. Behaviour will vary depending on container backend | string | - | - | | linkerpluginpaths | Array of additional directories to search for .so files | array | - | - | -| observe.proxystubpath | Directory to monitor for new proxy stub libraries. If libraries are added during runtime, WPEFramework will load these new proxystubs | string | - | /root/wpeframework/dynamic/proxystubs | -| observe.configpath | Directory to monitor for new plugin configuration files. If config files are added during runtime, WPEFramework will load them | string | - | /root/wpeframework/dynamic/config | +| observe.proxystubpath | Directory to monitor for new proxy stub libraries. If libraries are added during runtime, Thunder will load these new proxystubs | string | - | /root/thunder/dynamic/proxystubs | +| observe.configpath | Directory to monitor for new plugin configuration files. If config files are added during runtime, Thunder will load them | string | - | /root/thunder/dynamic/config | | hibernate.locator | Configuration for the process hibernation feature (alpha) | string | - | - | diff --git a/docs/introduction/intro.md b/docs/introduction/intro.md index 5833695b0..20e766218 100644 --- a/docs/introduction/intro.md +++ b/docs/introduction/intro.md @@ -1,13 +1,13 @@ # What is Thunder? !!! note - The terms "**Thunder**" and "**WPEFramework**" may be used interchangeably throughout this documentation. The project was originally known as WPEFramework (since it was developed by the Web Platform for Embedded, or WPE, team). The name was changed to Thunder when it was incorporated into RDK, but the code still uses the name WPEFramework internally. + The terms "**Thunder**" and "**Thunder**" may be used interchangeably throughout this documentation. The project was originally known as Thunder (since it was developed by the Web Platform for Embedded, or WPE, team). The name was changed to Thunder when it was incorporated into RDK, but the code still uses the name Thunder internally. ## Introduction -Thunder (aka WPEFramework) is developed by [Metrological](https://www.metrological.com/) (a Comcast company), and provides a way for STB operators to implement business-logic in a modular way using plugins, and a consistent way for applications to control and query those plugins. By using a plugin-based architecture, it is possible to build a device with only the specific features that are required for that particular device. +Thunder (aka Thunder) is developed by [Metrological](https://www.metrological.com/) (a Comcast company), and provides a way for STB operators to implement business-logic in a modular way using plugins, and a consistent way for applications to control and query those plugins. By using a plugin-based architecture, it is possible to build a device with only the specific features that are required for that particular device. !!! tip - Do not confuse WPEFramework and [WPEWebKit](https://github.com/WebPlatformForEmbedded/WPEWebKit/). Whilst both are maintained by the Metrological/WPE team, they are not related. [WPEWebKit](https://github.com/WebPlatformForEmbedded/WPEWebKit/) is a fork of the WebKit browser for embedded devices, and shares no code with WPEFramework + Do not confuse Thunder and [WPEWebKit](https://github.com/WebPlatformForEmbedded/WPEWebKit/). Whilst both are maintained by the Metrological/WPE team, they are not related. [WPEWebKit](https://github.com/WebPlatformForEmbedded/WPEWebKit/) is a fork of the WebKit browser for embedded devices, and shares no code with Thunder To communicate with plugins, Thunder provides multiple RPC mechanisms which can be chosen depending on which is more appropriate for the client app and the IPC channel. However, a plugin author will simply develop their plugin against an interface and the exact RPC mechanism can be chosen at runtime. diff --git a/docs/introduction/repos.md b/docs/introduction/repos.md index 2bcc61694..678995736 100644 --- a/docs/introduction/repos.md +++ b/docs/introduction/repos.md @@ -5,7 +5,7 @@ Thunder is made up of a number of different GitHub repositories, although you do | Repository Name | URL | Maintainer | Description | | ------------------------ | ------------------------------------------------------------ | ---------------- | ------------------------------------------------------------ | -| Thunder | [https://github.com/rdkcentral/Thunder/](https://github.com/rdkcentral/Thunder/) | Metrological/RDK | Core Thunder repository. Contains the WPEFramework daemon, core libraries and utilities. | +| Thunder | [https://github.com/rdkcentral/Thunder/](https://github.com/rdkcentral/Thunder/) | Metrological/RDK | Core Thunder repository. Contains the Thunder daemon, core libraries and utilities. | | Thunder Tools | [https://github.com/rdkcentral/ThunderTools](https://github.com/rdkcentral/ThunderTools) | Metrological | Supporting tooling for building Thunder & Thunder plugins. For example, stub and documentation generation. | | Thunder Interfaces | [https://github.com/rdkcentral/ThunderInterfaces/](https://github.com/rdkcentral/ThunderInterfaces/) | Metrological/RDK | Interface definitions for plugins | | Thunder Client Libraries | [https://github.com/rdkcentral/ThunderClientLibraries](https://github.com/rdkcentral/ThunderClientLibraries) | Metrological | C/C++ libraries that can be used for client applications to make it easier to work with some plugins | diff --git a/docs/introduction/usage.md b/docs/introduction/usage.md index b5138953e..1fbc95aad 100644 --- a/docs/introduction/usage.md +++ b/docs/introduction/usage.md @@ -1,6 +1,6 @@ -## Run WPEFramework +## Run Thunder -To launch Thunder, execute the `WPEFramework` process from a command line. +To launch Thunder, execute the `Thunder` process from a command line. If you have installed Thunder in a non-standard directory on Linux, you will need to set a few environment variables. If Thunder is installed in the standard system directories (e.g. `/usr/bin`) then you can just launch it directly @@ -8,13 +8,13 @@ If you have installed Thunder in a non-standard directory on Linux, you will nee $ export LD_LIBRARY_PATH=${PWD}/install/usr/lib:${LD_LIBRARY_PATH} $ export PATH=${PWD}/install/usr/bin:${PATH} -$ WPEFramework -f -c ${PWD}/install/etc/WPEFramework/config.json +$ Thunder -f -c ${PWD}/install/etc/Thunder/config.json ``` ### Available command-line options * `-c`: Path to the config file to use -* `-b`: Daemonise WPEFramework and run in the background +* `-b`: Daemonise Thunder and run in the background * `-f`: Flush all trace/logging/warning reporting messages directly to the console without any abbreviation * `-F`: Flush all trace/logging/warning reporting messages directly to the console with some abbreviation * `-h`: Show usage/help message @@ -127,19 +127,19 @@ If a plugin is configured as auto-start, then it will automatically be activated ## Systemd Service -An example systemd service to run WPEFramework daemon is below. This could be used to run Thunder on system startup automatically. +An example systemd service to run Thunder daemon is below. This could be used to run Thunder on system startup automatically. ```ini [Unit] -Description=wpeframework +Description=thunder Wants=multi-user.target After=multi-user.target [Service] -PIDFile=/var/run/WPEFramework.pid +PIDFile=/var/run/Thunder.pid Environment="WAYLAND_DISPLAY=wayland-0" Environment="XDG_RUNTIME_DIR=/run" -ExecStart=-/usr/bin/WPEFramework -b +ExecStart=-/usr/bin/Thunder -b ExecStop=/bin/kill $MAINPID [Install] diff --git a/docs/plugin/config.md b/docs/plugin/config.md index aa012ec2b..ec1c02c81 100644 --- a/docs/plugin/config.md +++ b/docs/plugin/config.md @@ -1,4 +1,4 @@ -In addition to the global WPEFramework config file (see [here](../introduction/config.md) for more details), each plugin has its own configuration file. +In addition to the global Thunder config file (see [here](../introduction/config.md) for more details), each plugin has its own configuration file. This file contains some generic information about the plugin (name of the library, callsign, execution mode etc), but can easily be extended by developers to include their own options. Using this method for configuring plugins ensures consistency between plugins - there is therefore a single place to configure all plugins. @@ -33,7 +33,7 @@ These are the options applicable to all plugins | configuration.root.locator | When running out-of-process, the name of the library to load in the out-of-process host. Only needed if plugin is split into a core and Implementation library | string | - | libSamplePluginImplementation.so | | configuration.root.user | When running out of process, the linux user to run the process as | string | - | plugin-user | | configuration.root.group | When running out of process, the linux group to run the process as | string | - | plugin-group | -| configuration.root.threads | When running out of process, the max number of threads that the WPEProcess host worker pool will use | int | 1 | 2 | +| configuration.root.threads | When running out of process, the max number of threads that the ThunderPlugin host worker pool will use | int | 1 | 2 | | configuration.root.priority | When running out of process, the priority of the process | int | - | - | | configuration.root.outofprocess | :warning: **Deprecated**: use `configuration.root.mode` instead.

Set to true to run plugin out of process | bool | false | true | | configuration.root.mode | The execution mode the plugin should run as. Includes: **Off** (in-process), **Local** (out-of-process), **Container** (out-of-process, in a container), **Distributed** (out-of-process, running on another device on the network) | string | Local[^2] | Off | @@ -47,7 +47,7 @@ These are the options applicable to all plugins ```json { - "locator":"libWPEFrameworkSamplePlugin.so", + "locator":"libThunderSamplePlugin.so", "classname":"SamplePlugin", "startmode":"Activated", "configuration":{ @@ -70,7 +70,7 @@ For this example, we will create a config file for an example plugin that return ```json { - "locator":"libWPEFrameworkGreeterPlugin.so", + "locator":"libThunderGreeterPlugin.so", "classname":"Greeter", "startmode":"Activated", "configuration":{ @@ -85,7 +85,7 @@ For this example, we will create a config file for an example plugin that return First, create the JSON container object to hold your configuration ```cpp -using namespace WPEFramework; +using namespace Thunder; class GreeterPluginConfiguration : public Core::JSON::Container { public: @@ -231,7 +231,7 @@ Make a JSON-RPC call to `Controller.configuration@` with no paramete #### Modify Config -Controller will allow modifying the in-memory config for the plugin. This will not survive restarts of the WPEFramework daemon +Controller will allow modifying the in-memory config for the plugin. This will not survive restarts of the Thunder daemon !!! warning It is only possible to modify plugin configuration when the plugin is not currently activated. If the plugin is activated and an attempt is made to modify the config, an `ERROR_GENERAL` error will be returned. Deactivate the plugin and try again. diff --git a/docs/plugin/errors.md b/docs/plugin/errors.md index 3f9895763..c135e1046 100644 --- a/docs/plugin/errors.md +++ b/docs/plugin/errors.md @@ -4,29 +4,29 @@ As with all code, it is important that Thunder plugins handle errors gracefully By default, Thunder is compiled with `-fno-exceptions` to disable exception support in the framework. This can be changed by enabling the `EXCEPTIONS_ENABLE` CMake option. As a result, plugins should **never** be designed to throw exceptions. -If an exception does occur, the WPEFramework process will immediately shut down with an error to prevent any further issues and log the following message: +If an exception does occur, the Thunder process will immediately shut down with an error to prevent any further issues and log the following message: ``` -WPEFramework shutting down due to an uncaught exception. +Thunder shutting down due to an uncaught exception. ``` If the `Crash` logging category is enabled, then more information about the faulting callstack will be available (only on debug builds). Thunder will attempt to resolve the callsign of the faulting plugin but this is not always possible. ``` [Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: -== Unhandled exception in: NoTLSCallsign [General] ==- -[Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [000] [0x7ffff7d22cba] /Thunder/install/usr/lib/libWPEFrameworkCore.so.1 DumpCallStack [74] -[Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [001] [0x7ffff7e02b84] /Thunder/install/usr/lib/libWPEFrameworkMessaging.so.1 WPEFramework::Logging::DumpException(std::__cxx11::basic_string, std::allocator > const&) [88] -[Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [002] [0x555555641b35] /Thunder/install/usr/bin/WPEFramework +[Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [000] [0x7ffff7d22cba] /Thunder/install/usr/lib/libThunderCore.so.1 DumpCallStack [74] +[Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [001] [0x7ffff7e02b84] /Thunder/install/usr/lib/libThunderMessaging.so.1 Thunder::Logging::DumpException(std::__cxx11::basic_string, std::allocator > const&) [88] +[Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [002] [0x555555641b35] /Thunder/install/usr/bin/Thunder [Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [003] [0x7ffff7aae24c] /lib/x86_64-linux-gnu/libstdc++.so.6 [Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [004] [0x7ffff7aae2b7] /lib/x86_64-linux-gnu/libstdc++.so.6 [Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [005] [0x7ffff7aae518] /lib/x86_64-linux-gnu/libstdc++.so.6 -[Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [006] [0x7ffff49820ff] /Thunder/install/usr/lib/wpeframework/plugins/libWPEFrameworkTestPlugin.so -[Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [007] [0x555555664a61] /Thunder/install/usr/bin/WPEFramework -[Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [008] [0x55555566b47e] /Thunder/install/usr/bin/WPEFramework -[Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [009] [0x555555643b35] /Thunder/install/usr/bin/WPEFramework +[Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [006] [0x7ffff49820ff] /Thunder/install/usr/lib/thunder/plugins/libThunderTestPlugin.so +[Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [007] [0x555555664a61] /Thunder/install/usr/bin/Thunder +[Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [008] [0x55555566b47e] /Thunder/install/usr/bin/Thunder +[Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [009] [0x555555643b35] /Thunder/install/usr/bin/Thunder [Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [010] [0x7ffff7629d90] /lib/x86_64-linux-gnu/libc.so.6 [Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [011] [0x7ffff7629e40] /lib/x86_64-linux-gnu/libc.so.6 __libc_start_main [128] -[Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [012] [0x555555596055] /Thunder/install/usr/bin/WPEFramework _start [37] +[Wed, 05 Jul 2023 10:43:38]:[SysLog]:[Crash]: [012] [0x555555596055] /Thunder/install/usr/bin/Thunder _start [37] ``` ### Exception Catching diff --git a/docs/plugin/execution-modes.md b/docs/plugin/execution-modes.md index f4c2892f2..55f3a7640 100644 --- a/docs/plugin/execution-modes.md +++ b/docs/plugin/execution-modes.md @@ -1,4 +1,4 @@ -A Thunder plugin can be configured to run in multiple different "execution modes". Each mode defines how the plugin code is executed, however it does not affect how a client will interact with the plugin. Clients will not know (and shouldn't care!) which mode a plugin is running in, and will continue to connect/communicate through the main WPEFramework process. +A Thunder plugin can be configured to run in multiple different "execution modes". Each mode defines how the plugin code is executed, however it does not affect how a client will interact with the plugin. Clients will not know (and shouldn't care!) which mode a plugin is running in, and will continue to connect/communicate through the main Thunder process. Providing a plugin correctly implements a COM-RPC interface, there should be no additional development work in the plugin to support running in different execution modes, so the decision on which mode each plugin runs in can be an architecture decision based on platform, performance and security requirements. @@ -19,7 +19,7 @@ As with other config options, this can be changed via the Controller plugin at r ```json { - "locator":"libWPEFrameworkSamplePlugin.so", + "locator":"libThunderSamplePlugin.so", "classname":"SamplePlugin", "startmode":"Activated", "configuration":{ @@ -37,35 +37,35 @@ This is the simplest execution mode, and the default if a mode is not set. An in **Advantages** * Simple - there is no additional overhead or complexity from running additional processes -* Highest performance - no additional RPC hops are required to communicate with the plugin. All calls to the plugin from the WPEFramework process are just local virtual function calls. +* Highest performance - no additional RPC hops are required to communicate with the plugin. All calls to the plugin from the Thunder process are just local virtual function calls. * If an in-process plugin needs to communicate with another in-process plugin, Thunder will resolve any COM-RPC interface calls to local function calls. This removes the need to serialise/deserialise any data or cross any IPC boundary and results in the fastest performance possible **Disadvantages** -* Stability - if a plugin is unstable or buggy and causes a crash then it will bring down the entire WPEFramework process -* Resource monitoring - since the plugin runs inside the WPEFramework process, it is much harder to accurately monitor the CPU/memory usage from that specific plugin -* Security - the plugin runs with the same permissions and privileges as the main WPEFramework process +* Stability - if a plugin is unstable or buggy and causes a crash then it will bring down the entire Thunder process +* Resource monitoring - since the plugin runs inside the Thunder process, it is much harder to accurately monitor the CPU/memory usage from that specific plugin +* Security - the plugin runs with the same permissions and privileges as the main Thunder process ## Out-Of-Process (OOP) Plugins -If a plugin is configured to run out-of-process, it will run in its own individual hosting process called `WPEProcess` instead of in the main WPEFramework process. Each out-of-process plugin will run in a separate WPEProcess instance. +If a plugin is configured to run out-of-process, it will run in its own individual hosting process called `ThunderPlugin` instead of in the main Thunder process. Each out-of-process plugin will run in a separate ThunderPlugin instance. -When the plugin is activated, Thunder will automatically spawn a WPEProcess instance as a child process. The WPEProcess host will load the plugin library and establish a COM-RPC connection between itself and the main WPEFramework process. This COM-RPC connection is how clients communicating with the main Thunder process are still able to invoke methods on out-of-process plugins. The WPEProcess process will be stopped when the plugin is deactivated. +When the plugin is activated, Thunder will automatically spawn a ThunderPlugin instance as a child process. The ThunderPlugin host will load the plugin library and establish a COM-RPC connection between itself and the main Thunder process. This COM-RPC connection is how clients communicating with the main Thunder process are still able to invoke methods on out-of-process plugins. The ThunderPlugin process will be stopped when the plugin is deactivated. !!! tip For larger, more complex out-of-process plugins, it is often useful to split a plugin into two separate libraries - see [here](../split-implementation) for more details. **Advantages** -* Reliability - if a plugin crashes, it will only bring down the WPEProcess instance and therefore not affect any other plugin. It can then be restarted as necessary +* Reliability - if a plugin crashes, it will only bring down the ThunderPlugin instance and therefore not affect any other plugin. It can then be restarted as necessary * Monitoring - by running a plugin in its own process, it becomes easier to monitor the resource usage (memory, CPU etc) of that plugin -* Security - out of process plugins can be run in a different user/group to the main WPEFramework process (which might be running as root) to reduce the privileges of the plugin and increase security -* Resource control - the size of the thread pool and process priority can be set for the WPEProcess host, allowing more custom tuning for specific plugin requirements +* Security - out of process plugins can be run in a different user/group to the main Thunder process (which might be running as root) to reduce the privileges of the plugin and increase security +* Resource control - the size of the thread pool and process priority can be set for the ThunderPlugin host, allowing more custom tuning for specific plugin requirements **Disadvantages** * Performance - since there is now an additional RPC hop over COM-RPC to invoke methods on the plugin, this can introduce some latency (although COM-RPC is efficient so this is very minimal) - * It may also take slightly longer to activate the plugin due to the overhead of starting the WPEProcess host + * It may also take slightly longer to activate the plugin due to the overhead of starting the ThunderPlugin host * Resource usage - potentially increased resource usage from spawning and running a new process ## Container @@ -75,7 +75,7 @@ When the plugin is activated, Thunder will automatically spawn a WPEProcess inst To enable, build Thunder with the `-DPROCESSCONTAINERS=ON` cmake option and select a backend with `-DPROCESSCONTAINERS_XXX=ON` where `XXX` is the backend you wish to use. -An extension to the out-of-process mode, container mode will run the WPEProcess host instead a containerised environment. Thunder supports various container integrations using the `ProcessContainer` abstraction mechanism in Thunder core: +An extension to the out-of-process mode, container mode will run the ThunderPlugin host instead a containerised environment. Thunder supports various container integrations using the `ProcessContainer` abstraction mechanism in Thunder core: - [LXC ](https://linuxcontainers.org/) - [runc](https://github.com/opencontainers/runc) @@ -89,7 +89,7 @@ A requirement for running a plugin in a container is a suitable container config 1. `//Container` 1. `//Container` -For example, the config for a plugin will callsign SamplePlugin might be stored in `/opt/wpeframework/SamplePlugin/Container` if the persistent path is set to `/opt/wpeframework` in the Thunder configuration. +For example, the config for a plugin will callsign SamplePlugin might be stored in `/opt/thunder/SamplePlugin/Container` if the persistent path is set to `/opt/thunder` in the Thunder configuration. **Advantages** @@ -107,7 +107,7 @@ For example, the config for a plugin will callsign SamplePlugin might be stored !!! danger Distributed mode is considered experimental -Distributed mode takes the out-of-process mode one step further by allowing plugins to run on an entirely different device than the main WPEFramework process. This device could even be running a different CPU with a different architecture. A COM-RPC channel is established over a TCP socket between the two devices to allow communication. +Distributed mode takes the out-of-process mode one step further by allowing plugins to run on an entirely different device than the main Thunder process. This device could even be running a different CPU with a different architecture. A COM-RPC channel is established over a TCP socket between the two devices to allow communication. An example use case for this could be a dual-SoC platform or for communicating with peripheral devices such as cameras. diff --git a/docs/plugin/interfaces/interfaces.md b/docs/plugin/interfaces/interfaces.md index 5a293a7c0..5aa231b47 100644 --- a/docs/plugin/interfaces/interfaces.md +++ b/docs/plugin/interfaces/interfaces.md @@ -100,17 +100,17 @@ Each interface definition will result in up to 4 auto-generated files depending The resulting generated code is then compiled into 2 libraries: -* `/usr/lib/wpeframework/proxystubs/libWPEFrameworkMarshalling.so` +* `/usr/lib/thunder/proxystubs/libThunderMarshalling.so` * This contains all the generated proxy stub code responsible for handling COM-RPC serialisation/deserialisation -* `/usr/lib/wpeframework/libWPEFrameworkDefinitions.so` +* `/usr/lib/thunder/libThunderDefinitions.so` * This contains all generated data types (e.g. json enums and conversions) that can be used by plugins !!! note - There will also be a library called `libWPEFrameworkProxyStubs.so` installed in the `proxystubs` directory as part of the main Thunder build - this contains the generated ProxyStubs for the internal WPEFramework interfaces (such as Controller and Dispatcher). + There will also be a library called `libThunderProxyStubs.so` installed in the `proxystubs` directory as part of the main Thunder build - this contains the generated ProxyStubs for the internal Thunder interfaces (such as Controller and Dispatcher). -The installation path can be changed providing the `proxystubpath` option in the WPEFramework config.json file is updated accordingly so Thunder can find the libraries. When Thunder starts, it will load all available libraries in the `proxystubpath` directory. If an observable proxystubpath is set in the config, then Thunder will monitor that directory and automatically load any new libraries in that directory. This makes it possible to load new interfaces at runtime. +The installation path can be changed providing the `proxystubpath` option in the Thunder config.json file is updated accordingly so Thunder can find the libraries. When Thunder starts, it will load all available libraries in the `proxystubpath` directory. If an observable proxystubpath is set in the config, then Thunder will monitor that directory and automatically load any new libraries in that directory. This makes it possible to load new interfaces at runtime. If you are building the interface as part of a standalone repository instead of ThunderInterfaces, it is possible to manually invoke the code generation tools from that repository's CMake file. The CMake commands drive the following Python scripts: @@ -122,7 +122,7 @@ The below CMakeLists.txt file is an example of how to invoke the code generators ```cmake title="CMakeLists.txt" linenums="1" project(SampleInterface) -find_package(WPEFramework) +find_package(Thunder) find_package(${NAMESPACE}Core REQUIRED) find_package(${NAMESPACE}COM REQUIRED) find_package(CompileSettingsDebug REQUIRED) @@ -257,7 +257,7 @@ Each COM-RPC interface should be defined in a C++ header file with the same name // @stubgen:include // (1) -namespace WPEFramework { +namespace Thunder { namespace Exchange { struct EXTERNAL IWiFi : virtual public Core::IUnknown { enum { @@ -337,7 +337,7 @@ Here, the `@json` tag was passed a version number `1.0.0`, which can be used to // @stubgen:include -namespace WPEFramework { +namespace Thunder { namespace Exchange { // @json 1.0.0 struct EXTERNAL IWiFi : virtual public Core::IUnknown { @@ -363,7 +363,7 @@ The generated `JWiFi.h` file contains two methods - `Register` and `Unregister`, #include "JsonData_WiFi.h" #include - namespace WPEFramework { + namespace Thunder { namespace Exchange { @@ -466,7 +466,7 @@ The generated `JWiFi.h` file contains two methods - `Register` and `Unregister`, } // namespace Exchange - } // namespace WPEFramework + } // namespace Thunder ``` @@ -484,7 +484,7 @@ The auto-generated `JsonData_WiFi.h` file contains code that can convert from th #include #include - namespace WPEFramework { + namespace Thunder { namespace JsonData { diff --git a/docs/plugin/interfaces/tags.md b/docs/plugin/interfaces/tags.md index c8e55ef93..37268353b 100644 --- a/docs/plugin/interfaces/tags.md +++ b/docs/plugin/interfaces/tags.md @@ -73,7 +73,7 @@ IDeviceInfo.h [includes](https://github.com/rdkcentral/ThunderInterfaces/blob/ma To avoid proxy implementation for a function, mark it with this tag. ##### Example -In [IShell](https://github.com/rdkcentral/Thunder/blob/master/Source/plugins/IShell.h#L232) Submit function is marked as stub as it does not want that function to be called beyond WPEFramework process +In [IShell](https://github.com/rdkcentral/Thunder/blob/master/Source/plugins/IShell.h#L232) Submit function is marked as stub as it does not want that function to be called beyond Thunder process
@@ -514,4 +514,4 @@ The syntax for this tag is `@retval : `. It is associate This tag adds description about each return codes specified in the generated markdown document. ##### Example -In [IVolumeControl.h](https://github.com/rdkcentral/ThunderInterfaces/blob/5fa166bd17c6b910696c6113c5520141bcdea07b/interfaces/IVolumeControl.h#L54), it uses this tag to add description about the returned error code. \ No newline at end of file +In [IVolumeControl.h](https://github.com/rdkcentral/ThunderInterfaces/blob/5fa166bd17c6b910696c6113c5520141bcdea07b/interfaces/IVolumeControl.h#L54), it uses this tag to add description about the returned error code. diff --git a/docs/plugin/lifecycle.md b/docs/plugin/lifecycle.md index 7be7ea0fb..ead63ceb3 100644 --- a/docs/plugin/lifecycle.md +++ b/docs/plugin/lifecycle.md @@ -34,7 +34,7 @@ During plugin activation, the library is loaded, constructed and the `Initialize When a plugin is deactivated the reverse happens; the `Deinitialize()` method is called, the plugin moves to the Deactivated state and the library is destructed and unloaded. As a result, once a plugin is deactivated it is safe to replace the library file (perhaps to upgrade to a new version) without needing to restart the framework. !!! note - All plugin libraries will be quickly loaded & unloaded once during WPEFramework startup regardless of plugin start mode to retrieve the version information. + All plugin libraries will be quickly loaded & unloaded once during Thunder startup regardless of plugin start mode to retrieve the version information. Every plugin **must** implement the `Initialize()` and `Deinitialize()` methods from the `IPlugin` interface, which are called during plugin activation and deactivation respectively. After `Initialize()` completes, the plugin must be in a state where it is ready to respond to incoming method calls. @@ -399,7 +399,7 @@ There are multiple options for controlling plugin state over COM-RPC: #include #include -using namespace WPEFramework; +using namespace Thunder; int main(int argc, char const* argv[]) { @@ -441,7 +441,7 @@ int main(int argc, char const* argv[]) #include #include -using namespace WPEFramework; +using namespace Thunder; int main(int argc, char const* argv[]) { @@ -486,7 +486,7 @@ int main(int argc, char const* argv[]) #include #include -using namespace WPEFramework; +using namespace Thunder; int main(int argc, char const* argv[]) { @@ -582,7 +582,7 @@ For the sake of an example, the below code will subscribe to state change notifi #include #include -using namespace WPEFramework; +using namespace Thunder; class StateChangeNotification : public Exchange::IController::ILifeTime::INotification { public: diff --git a/docs/plugin/messaging.md b/docs/plugin/messaging.md index bb86204d7..00e44e9dc 100644 --- a/docs/plugin/messaging.md +++ b/docs/plugin/messaging.md @@ -27,7 +27,7 @@ Logging, tracing and warning reporting are important techniques often used in so ### MessageControl plugin -The `MessageControl` plugin not only consolidates all of the various message types but also offers the flexibility to redirect these messages to different outputs. These outputs include the Console, Syslog, a file, or even a Network Stream through UDP. This can be configured by assigning appropriate values to JSON objects in the configuration file located in `/etc/WPEFramework/plugins/MessageControl.json`. These object's names can be found in the constructor of the `Config` class in `ThunderNanoServicesRDK/MessageControl/MessageControl.h`: +The `MessageControl` plugin not only consolidates all of the various message types but also offers the flexibility to redirect these messages to different outputs. These outputs include the Console, Syslog, a file, or even a Network Stream through UDP. This can be configured by assigning appropriate values to JSON objects in the configuration file located in `/etc/Thunder/plugins/MessageControl.json`. These object's names can be found in the constructor of the `Config` class in `ThunderNanoServicesRDK/MessageControl/MessageControl.h`: ```c++ Config() @@ -88,7 +88,7 @@ void DirectOutput::Output(const Core::Messaging::MessageInfo& messageInfo, const ### Configuration -The main config file (` /etc/WPEFramework/config.json`) can be used to enable/disable the default messaging categories used for logging, tracing and warning reporting. +The main config file (` /etc/Thunder/config.json`) can be used to enable/disable the default messaging categories used for logging, tracing and warning reporting. Messages are split into 3 types: logging, tracing and warning reporting. Each type has a list of categories which can be marked as enabled or disabled. There is also a similar list for tracing when it comes to enabling or disabling certain modules (e.g. plugins). By default, all categories are enabled for logging and warning reporting, but in terms of tracing, if a category or a module is not present in the config, it will be disabled. @@ -225,18 +225,18 @@ In Thunder, there are two main macros that can be used to wrap messages that wil using __control__ = TRACE_CONTROL(CATEGORY); if (__control__::IsEnabled() == true) { CATEGORY __data__ PARAMETERS; - WPEFramework::Core::Messaging::MessageInfo __info__( + Thunder::Core::Messaging::MessageInfo __info__( __control__::Metadata(), - WPEFramework::Core::Time::Now().Ticks() + Thunder::Core::Time::Now().Ticks() ); - WPEFramework::Core::Messaging::IStore::Tracing __trace__( + Thunder::Core::Messaging::IStore::Tracing __trace__( __info__, __FILE__, __LINE__, - WPEFramework::Core::ClassNameOnly(typeid(*this).name()).Text() + Thunder::Core::ClassNameOnly(typeid(*this).name()).Text() ); - WPEFramework::Messaging::TextMessage __message__(__data__.Data()); - WPEFramework::Messaging::MessageUnit::Instance().Push(__trace__, &__message__); + Thunder::Messaging::TextMessage __message__(__data__.Data()); + Thunder::Messaging::MessageUnit::Instance().Push(__trace__, &__message__); } } while(false) ``` @@ -321,16 +321,16 @@ In the piece of code below we can see that the first noticeable difference betwe ```c++ #define SYSLOG(CATEGORY, PARAMETERS) do { - static_assert(std::is_base_of, CATEGORY>::value, "SYSLOG() only for Logging controls"); + static_assert(std::is_base_of, CATEGORY>::value, "SYSLOG() only for Logging controls"); if (CATEGORY::IsEnabled() == true) { CATEGORY __data__ PARAMETERS; - WPEFramework::Core::Messaging::MessageInfo __info__( + Thunder::Core::Messaging::MessageInfo __info__( CATEGORY::Metadata(), - WPEFramework::Core::Time::Now().Ticks() + Thunder::Core::Time::Now().Ticks() ); - WPEFramework::Core::Messaging::IStore::Logging __log__(__info__); - WPEFramework::Messaging::TextMessage __message__(__data__.Data()); - WPEFramework::Messaging::MessageUnit::Instance().Push(__log__, &__message__); + Thunder::Core::Messaging::IStore::Logging __log__(__info__); + Thunder::Messaging::TextMessage __message__(__data__.Data()); + Thunder::Messaging::MessageUnit::Instance().Push(__log__, &__message__); } } while(false) ``` @@ -405,14 +405,14 @@ The `REPORT_DURATION_WARNING` macro, as its name implies, serves the purpose of ```c++ #define REPORT_DURATION_WARNING(CODE, CATEGORY, ...) if (...WarningReportingType<...WarningReportingBoundsCategory>::IsEnabled() == true) { - WPEFramework::Core::Time start = WPEFramework::Core::Time::Now(); + Thunder::Core::Time start = Thunder::Core::Time::Now(); CODE uint32_t duration = static_cast((Core::Time::Now().Ticks() - start.Ticks()) / Core::Time::TicksPerMillisecond); ...WarningReportingType<...WarningReportingBoundsCategory> __message__; - if (__message__.Analyze(WPEFramework::Core::System::MODULE_NAME, ...CallsignAccess<&...MODULE_NAME>::Callsign(), + if (__message__.Analyze(Thunder::Core::System::MODULE_NAME, ...CallsignAccess<&...MODULE_NAME>::Callsign(), duration, ##__VA_ARGS__) == true) { ...WarningReportingUnitProxy::Instance().ReportWarningEvent( - ...CallsignAccess<&WPEFramework::Core::System::MODULE_NAME>::Callsign(),__message__); + ...CallsignAccess<&Thunder::Core::System::MODULE_NAME>::Callsign(),__message__); } } else { CODE @@ -541,7 +541,7 @@ These logging categories are created using the `DEFINE_LOGGING_CATEGORY` macro d ```c++ #define DEFINE_LOGGING_CATEGORY(CATEGORY) - DEFINE_MESSAGING_CATEGORY(WPEFramework::Logging::BaseLoggingType, CATEGORY) + DEFINE_MESSAGING_CATEGORY(Thunder::Logging::BaseLoggingType, CATEGORY) template<> EXTERNAL typename ...BaseLoggingType::Control ...BaseLoggingType::_control; ``` @@ -550,7 +550,7 @@ The `DEFINE_LOGGING_CATEGORY` macro functions by invoking the `DEFINE_MESSAGING_ ##### Warning reporting default categories -Last but not least, the warning reporting categories in Thunder can be found in either `Source/WPEFramework/WarningReportingCategories.h` or `Source/core/WarningReportingCategories.h`. These categories, located within the `WPEFramework::WarningReporting` namespace, include: +Last but not least, the warning reporting categories in Thunder can be found in either `Source/Thunder/WarningReportingCategories.h` or `Source/core/WarningReportingCategories.h`. These categories, located within the `Thunder::WarningReporting` namespace, include: - TooLongWaitingForLock - SinkStillHasReference @@ -572,18 +572,18 @@ Now, let us delve into how the MessageControl plugin manages the messages from l using __control__ = TRACE_CONTROL(CATEGORY); if (__control__::IsEnabled() == true) { CATEGORY __data__ PARAMETERS; - WPEFramework::Core::Messaging::MessageInfo __info__( + Thunder::Core::Messaging::MessageInfo __info__( __control__::Metadata(), - WPEFramework::Core::Time::Now().Ticks() + Thunder::Core::Time::Now().Ticks() ); - WPEFramework::Core::Messaging::IStore::Tracing __trace__( + Thunder::Core::Messaging::IStore::Tracing __trace__( __info__, __FILE__, __LINE__, __FUNCTION__ ); - WPEFramework::Messaging::TextMessage __message__(__data__.Data()); - WPEFramework::Messaging::MessageUnit::Instance().Push(__trace__, &__message__); + Thunder::Messaging::TextMessage __message__(__data__.Data()); + Thunder::Messaging::MessageUnit::Instance().Push(__trace__, &__message__); } } while(false) ``` @@ -602,7 +602,7 @@ The initial section is identical across all macros, including warning reporting, ...WarningReportingType<...WarningReportingBoundsCategory> __message__; if(__message__.Analyze(...MODULE_NAME, ...Callsign(), ACTUALVALUE, ##__VA_ARGS__) == true) { ...WarningReportingUnitProxy::Instance().ReportWarningEvent( - ...CallsignAccess<&WPEFramework::Core::System::MODULE_NAME>::Callsign(), + ...CallsignAccess<&Thunder::Core::System::MODULE_NAME>::Callsign(), __message__); } } @@ -634,16 +634,16 @@ Moving forward, the next step involves sending the message to a proxy called `Wa ```c++ void WarningReportingUnit::ReportWarningEvent(const char identifier[], const IWarningEvent& information) { - WPEFramework::Core::Messaging::Metadata metadata(WPEFramework::Core::Messaging::Metadata::type::REPORTING, - information.Category(), WPEFramework::Core::Messaging::MODULE_REPORTING); - WPEFramework::Core::Messaging::MessageInfo messageInfo(metadata, WPEFramework::Core::Time::Now().Ticks()); - WPEFramework::Core::Messaging::IStore::WarningReporting report(messageInfo, identifier); + Thunder::Core::Messaging::Metadata metadata(Thunder::Core::Messaging::Metadata::type::REPORTING, + information.Category(), Thunder::Core::Messaging::MODULE_REPORTING); + Thunder::Core::Messaging::MessageInfo messageInfo(metadata, Thunder::Core::Time::Now().Ticks()); + Thunder::Core::Messaging::IStore::WarningReporting report(messageInfo, identifier); string text; information.ToString(text); - WPEFramework::Messaging::TextMessage data(text); + Thunder::Messaging::TextMessage data(text); - WPEFramework::Messaging::MessageUnit::Instance().Push(report, &data); + Thunder::Messaging::MessageUnit::Instance().Push(report, &data); } ``` @@ -656,7 +656,7 @@ In tracing and logging macros, the user directly enters the message as a macro p In addition to the part of the macros where the messages are formed, the crucial part to which we want to pay extra attention is this line of code: ```c++ -WPEFramework::Messaging::MessageUnit::Instance().Push(__trace__, &__message__); +Thunder::Messaging::MessageUnit::Instance().Push(__trace__, &__message__); ``` This is how the communication between Thunder and the `MessageControl` plugin takes place. For tracing and logging it is within the macros, but for warning reporting it is in the separate method `ReportWarningEvent()` of the reporting proxy `WarningReportingUnit`. The first step involves the construction of message content. Once prepared, it is push to a buffer or special queue in the second line of code. This buffer serves as a centralized storage for messages, ensuring that they are properly organized and ready for further processing. diff --git a/docs/plugin/subsystems.md b/docs/plugin/subsystems.md index ab30ac555..b8f670921 100644 --- a/docs/plugin/subsystems.md +++ b/docs/plugin/subsystems.md @@ -28,7 +28,7 @@ Thunder supports the following subsystems (enumerated in `Source/plugins/ISubSys All subsystems have a negated equivalent - e.g. `NOT_PLATFORM` and `NOT_SECURITY` that indicates the absence of those subsystems. -When the WPEFramework process starts, Controller will check to see which subsystems are provided by plugins (as defined in the plugin metadata or the Controller configuration). These subsystems are sometimes referred to "external", since their lifetime is managed by a plugin external to the Thunder core. +When the Thunder process starts, Controller will check to see which subsystems are provided by plugins (as defined in the plugin metadata or the Controller configuration). These subsystems are sometimes referred to "external", since their lifetime is managed by a plugin external to the Thunder core. If the subsystem is not provided by a plugin, then Controller will mark the subsystem as active at startup. The opposite happens at shutdown, with Controller marking the subsystems as inactive. @@ -63,11 +63,11 @@ struct EXTERNAL IInternet : virtual public Core::IUnknown { }; ``` -Default implementations of these interfaces are provided in `Source/WPEFramework/SystemInfo.h`, which populate the values with sane defaults, but it is expected plugins that provide that subsystem provide their own implementations as required. +Default implementations of these interfaces are provided in `Source/Thunder/SystemInfo.h`, which populate the values with sane defaults, but it is expected plugins that provide that subsystem provide their own implementations as required. ## Using Subsystems -Plugins can use the `ISubsystem` interface (as implemented by `Source/WPEFramework/SystemInfo.h`) to retrieve information about the state of the subsystems and mark subsystems as active/inactive. This interface can be retrieved from the plugin shell provided to the plugin at initialisation. +Plugins can use the `ISubsystem` interface (as implemented by `Source/Thunder/SystemInfo.h`) to retrieve information about the state of the subsystems and mark subsystems as active/inactive. This interface can be retrieved from the plugin shell provided to the plugin at initialisation. ### Mark Subsystem as Active diff --git a/docs/plugin/versioning.md b/docs/plugin/versioning.md index 3e509fe4c..bd344482a 100644 --- a/docs/plugin/versioning.md +++ b/docs/plugin/versioning.md @@ -65,7 +65,7 @@ At runtime, this version information can be retrieved from the Controller plugin "result": [ { "callsign": "TestPlugin", - "locator": "libWPEFrameworkTestPlugin.so", + "locator": "libThunderTestPlugin.so", "classname": "TestPlugin", "startmode": "Activated", "configuration": {}, @@ -90,7 +90,7 @@ It is possible to version JSON-RPC interfaces independently of the plugin. This If using a JSON-RPC interface that has been autogenerated from a COM-RPC interface (strongly recommended!), then the version number of the interface should be defined as part of the `@json` tag ```c++ linenums="1" hl_lines="3" -namespace WPEFramework { +namespace Thunder { namespace Exchange { /* @json 1.0.0 */ struct EXTERNAL ITestPlugin : virtual public Core::IUnknown { diff --git a/docs/references/references.md b/docs/references/references.md index 38cb4a7f0..38f004492 100644 --- a/docs/references/references.md +++ b/docs/references/references.md @@ -1,3 +1,3 @@ You can find references to some other related information here. Please check below links: -[WPE-API-WPEFramework](https://github.com/WebPlatformForEmbedded/Documentation/blob/master/Thunder/WPE-API-WPEFramework/WPE-API-WPEFramework.pdf) +[WPE-API-Thunder](https://github.com/WebPlatformForEmbedded/Documentation/blob/master/Thunder/WPE-API-Thunder/WPE-API-Thunder.pdf) diff --git a/docs/utils/files/observer.md b/docs/utils/files/observer.md index a9659a874..5b7aa484c 100644 --- a/docs/utils/files/observer.md +++ b/docs/utils/files/observer.md @@ -9,7 +9,7 @@ This class should implement the `Updated()` method from the `ICallback` interfac ```c++ #include -using namespace WPEFramework; +using namespace Thunder; class FileChangeMonitor : Core::FileSystemMonitor::ICallback { public: diff --git a/docs/utils/json.md b/docs/utils/json.md index 1ee718964..28c3996de 100644 --- a/docs/utils/json.md +++ b/docs/utils/json.md @@ -370,9 +370,9 @@ The JSON variant type behaves closer to other C++ json parsers, and does not req Some typedef's are provided to make the variant types easier to work with ```cpp -using JsonObject = WPEFramework::Core::JSON::VariantContainer; -using JsonValue = WPEFramework::Core::JSON::Variant; -using JsonArray = WPEFramework::Core::JSON::ArrayType; +using JsonObject = Thunder::Core::JSON::VariantContainer; +using JsonValue = Thunder::Core::JSON::Variant; +using JsonArray = Thunder::Core::JSON::ArrayType; ``` #### Deserialise @@ -405,7 +405,7 @@ Age is 36 #### Serialise ```cpp -WPEFramework::Core::JSON::VariantContainer jsonObject; +Thunder::Core::JSON::VariantContainer jsonObject; JsonArray sampleArray; sampleArray.Add(JsonValue("apple")); diff --git a/docs/utils/processes.md b/docs/utils/processes.md index 11225c366..78b5be485 100644 --- a/docs/utils/processes.md +++ b/docs/utils/processes.md @@ -38,11 +38,11 @@ The `FindByName` method will search for all currently running processes that mat std::list processes; // Second argument specifies if we should match exactly -Core::ProcessInfo::FindByName("WPEFramework", true, processes); -printf("There are currently %d WPEFramework processes\n", processes.size()); +Core::ProcessInfo::FindByName("Thunder", true, processes); +printf("There are currently %d Thunder processes\n", processes.size()); /* Output: -There are currently 1 WPEFramework processes +There are currently 1 Thunder processes */ ``` @@ -167,7 +167,7 @@ For simplicity, the example will print the data sent to stdout along with the ti #include #include -using namespace WPEFramework; +using namespace Thunder; /** * @brief A simple class that will monitor the stdout/err from a long-running process diff --git a/docs/utils/sockets.md b/docs/utils/sockets.md index a0a87f1f2..00ee020a0 100644 --- a/docs/utils/sockets.md +++ b/docs/utils/sockets.md @@ -17,7 +17,7 @@ The following documentation will cover examples for some common use-cases for so Thunder provides a mechanism known as the "Resource Monitor" for monitoring file descriptors and sockets. The resource monitor is a singleton constructed at process launch, and uses `poll()` on Linux to listen to provided file descriptors. -Resource monitor uses a single thread, and it is strongly recommended that plugins use this to monitor file descriptors and sockets instead of spinning up their own thread(s). For out-of-process plugins, the WPEProcess host will run its own instance of ResourceMonitor, which can be useful for performance-criticial plugins. +Resource monitor uses a single thread, and it is strongly recommended that plugins use this to monitor file descriptors and sockets instead of spinning up their own thread(s). For out-of-process plugins, the ThunderPlugin host will run its own instance of ResourceMonitor, which can be useful for performance-criticial plugins. !!! danger The same instance of ResourceMonitor is also used for receiving incoming JSON-RPC and COM-RPC messages. Since this is a single thread, it is vitally important not to block the thread with any processing or long-lived task. If the thread is blocked, Thunder will not be able to process any incoming messages, impacting overall performance and responsiveness. Instead, make use of the worker pool to do any processing work. @@ -42,17 +42,17 @@ virtual uint16_t Events() = 0; virtual void Handle(const uint16_t events) = 0; ``` -To view the current resources being monitored by the ResourceMonitor, run WPEFramework in a foreground terminal and press the **M** key: +To view the current resources being monitored by the ResourceMonitor, run Thunder in a foreground terminal and press the **M** key: ``` Resource Monitor Entry states: ============================================================ Currently monitoring: 5 resources - 5 socket:[1123804][I--:---]: LinkType::HandlerType, WPEFramework::Core::SocketPort> + 5 socket:[1123804][I--:---]: LinkType::HandlerType, Thunder::Core::SocketPort> 8 socket:[1121398][I--:---]: Handler 9 socket:[1121399][I--:---]: Handler 10 socket:[1121400][I--:---]: Handler - 11 socket:[1129519][I-H:---]: WebSocketLinkType&>::HandlerType + 11 socket:[1129519][I-H:---]: WebSocketLinkType&>::HandlerType ``` Each line contains the following information: diff --git a/mkdocs.yml b/mkdocs.yml index 4b01b373c..30b1ee3ad 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Thunder (WPEFramework) +site_name: Thunder site_url: https://rdkcentral.github.com/Thunder repo_name: rdkcentral/Thunder