diff --git a/ContinueWatching/ContinueWatching.cpp b/ContinueWatching/ContinueWatching.cpp index 3956b01225..a627b0b0d0 100644 --- a/ContinueWatching/ContinueWatching.cpp +++ b/ContinueWatching/ContinueWatching.cpp @@ -728,7 +728,7 @@ namespace WPEFramework { bool retVal = false; RFC_ParamData_t param = {0}; - WDMP_STATUS status = getRFCParameter("ServiceManager", feature.c_str(), ¶m); + WDMP_STATUS status = getRFCParameter(const_cast("ServiceManager"), feature.c_str(), ¶m); if (status == WDMP_SUCCESS) { LOGINFO("%s name = %s, type = %d, value = %s\n", __FUNCTION__, param.name, param.type, param.value); @@ -863,7 +863,7 @@ namespace WPEFramework { string dectokenbase64; std::stringstream listdecydec; - for (int i=0; i * remoteObject = NULL; int choice; uint32_t ret; @@ -319,7 +319,7 @@ int main(int argc, char** argv) Core::SystemInfo::SetEnvironment(_T("THUNDER_ACCESS"), (_T(SERVER_DETAILS))); if (NULL == remoteObject) { - remoteObject = new JSONRPC::Client(_T(SYSSRV_CALLSIGN), _T("")); + remoteObject = new JSONRPC::LinkType(_T(SYSSRV_CALLSIGN), _T("")); if (NULL == remoteObject) { std::cout << "JSONRPC::Client initialization failed" << std::endl; } else { diff --git a/DeviceIdentification/DeviceIdentificationPlugin.json b/DeviceIdentification/DeviceIdentificationPlugin.json deleted file mode 100644 index 1b89fedc56..0000000000 --- a/DeviceIdentification/DeviceIdentificationPlugin.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "$schema": "interface.schema.json", - "jsonrpc": "2.0", - "info": { - "title": "Device Identification API", - "class": "DeviceIdentification", - "description": "DeviceIdentification JSON-RPC interface" - }, - "properties": { - "deviceidentification": { - "summary": "Device paltform specific information", - "readonly": true, - "params": { - "type": "object", - "properties": { - "firmwareversion": { - "description": "Version of the device firmware", - "example": "1.0.0", - "type": "string" - }, - "chipset": { - "description": "Chipset used for this device", - "example": "BCM2711", - "type": "string" - }, - "identifier": { - "description": "Device unique identifier", - "type": "string" - } - }, - "required": [ - "firmwareversion", - "chipset" - ] - } - } - } -} diff --git a/DeviceInfo/DeviceInfoPlugin.json b/DeviceInfo/DeviceInfoPlugin.json deleted file mode 100644 index 0c4f80b4c3..0000000000 --- a/DeviceInfo/DeviceInfoPlugin.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "plugin.schema.json", - "info": { - "title": "Device Info Plugin", - "callsign": "DeviceInfo", - "locator": "libWPEFrameworkDeviceInfo.so", - "status": "production", - "description": "The DeviceInfo plugin allows retrieving of various device-related information.", - "version": "1.0" - }, - "interface": { - "$ref": "{interfacedir}/DeviceInfo.json#" - } -} diff --git a/DisplayInfo/DisplayInfoPlugin.json b/DisplayInfo/DisplayInfoPlugin.json deleted file mode 100644 index 0146839b4e..0000000000 --- a/DisplayInfo/DisplayInfoPlugin.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "plugin.schema.json", - "info": { - "title": "Display Info Plugin", - "callsign": "DisplayInfo", - "locator": "libWPEFrameworkDisplayInfo.so", - "status": "production", - "description": "The DisplayInfo plugin allows retrieving of various display-related information.", - "version": "1.0" - }, - "interface": { - "$ref": "{interfacedir}/DisplayInfo.json#" - } -} diff --git a/DisplayInfo/Nexus/PlatformImplementation.cpp b/DisplayInfo/Nexus/PlatformImplementation.cpp index 1f8a09f591..1f0ce22e62 100644 --- a/DisplayInfo/Nexus/PlatformImplementation.cpp +++ b/DisplayInfo/Nexus/PlatformImplementation.cpp @@ -41,8 +41,12 @@ class DisplayInfoImplementation : public Exchange::IGraphicsProperties, public E , _adminLock() , _activity(*this) { +#ifdef __DEBUG__ NEXUS_Error rc = NxClient_Join(NULL); ASSERT(!rc); +#else + NxClient_Join(NULL); +#endif NxClient_UnregisterAcknowledgeStandby(NxClient_RegisterAcknowledgeStandby()); NEXUS_Platform_GetConfiguration(&_platformConfig); diff --git a/DisplaySettings/CMakeLists.txt b/DisplaySettings/CMakeLists.txt index a177b56357..eed1010b02 100644 --- a/DisplaySettings/CMakeLists.txt +++ b/DisplaySettings/CMakeLists.txt @@ -22,7 +22,8 @@ find_package(${NAMESPACE}Plugins REQUIRED) add_library(${MODULE_NAME} SHARED DisplaySettings.cpp - Module.cpp) + Module.cpp + ../helpers/utils.cpp) set_target_properties(${MODULE_NAME} PROPERTIES CXX_STANDARD 11 diff --git a/DisplaySettings/DisplaySettings.cpp b/DisplaySettings/DisplaySettings.cpp index 7daa84fee3..5694abd656 100644 --- a/DisplaySettings/DisplaySettings.cpp +++ b/DisplaySettings/DisplaySettings.cpp @@ -185,16 +185,19 @@ namespace WPEFramework { void DisplaySettings::InitializeIARM() { LOGINFO(); - IARM_Result_t res; - IARM_CHECK( IARM_Bus_Init("Display_Settings") ); - IARM_CHECK( IARM_Bus_Connect() ); - IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME, IARM_BUS_DSMGR_EVENT_RX_SENSE, DisplResolutionHandler) ); - IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME, IARM_BUS_DSMGR_EVENT_ZOOM_SETTINGS, DisplResolutionHandler) ); - //TODO(MROLLINS) localinput.cpp has PreChange guared with #if !defined(DISABLE_PRE_RES_CHANGE_EVENTS) - //Can we set it all the time from inside here and let localinput put guards around listening for our event? - IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_RES_PRECHANGE,ResolutionPreChange) ); - IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_RES_POSTCHANGE, ResolutionPostChange) ); - IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG, dsHdmiEventHandler) ); + + if (Utils::IARM::init()) + { + IARM_Result_t res; + IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME, IARM_BUS_DSMGR_EVENT_RX_SENSE, DisplResolutionHandler) ); + IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME, IARM_BUS_DSMGR_EVENT_ZOOM_SETTINGS, DisplResolutionHandler) ); + //TODO(MROLLINS) localinput.cpp has PreChange guarded with #if !defined(DISABLE_PRE_RES_CHANGE_EVENTS) + //Can we set it all the time from inside here and let localinput put guards around listening for our event? + IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_RES_PRECHANGE,ResolutionPreChange) ); + IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_RES_POSTCHANGE, ResolutionPostChange) ); + IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG, dsHdmiEventHandler) ); + } + try { //TODO(MROLLINS) this is probably per process so we either need to be running in our own process or be carefull no other plugin is calling it @@ -207,15 +210,21 @@ namespace WPEFramework { } } - //TODO(MROLLINS) - we need to install crash handler to ensure DeinitializeIARM gets called void DisplaySettings::DeinitializeIARM() { LOGINFO(); - IARM_Result_t res; - IARM_CHECK( IARM_Bus_UnRegisterEventHandler(IARM_BUS_DSMGR_NAME, IARM_BUS_DSMGR_EVENT_RX_SENSE) ); - IARM_CHECK( IARM_Bus_UnRegisterEventHandler(IARM_BUS_DSMGR_NAME, IARM_BUS_DSMGR_EVENT_ZOOM_SETTINGS) ); - IARM_CHECK( IARM_Bus_Disconnect() ); - IARM_CHECK( IARM_Bus_Term() ); + + if (Utils::IARM::isConnected()) + { + IARM_Result_t res; + IARM_CHECK( IARM_Bus_UnRegisterEventHandler(IARM_BUS_DSMGR_NAME, IARM_BUS_DSMGR_EVENT_RX_SENSE) ); + IARM_CHECK( IARM_Bus_UnRegisterEventHandler(IARM_BUS_DSMGR_NAME, IARM_BUS_DSMGR_EVENT_ZOOM_SETTINGS) ); + IARM_CHECK( IARM_Bus_UnRegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_RES_PRECHANGE) ); + IARM_CHECK( IARM_Bus_UnRegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_RES_POSTCHANGE) ); + IARM_CHECK( IARM_Bus_UnRegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG) ); + } + + try { //TODO(MROLLINS) this is probably per process so we either need to be running in our own process or be carefull no other plugin is calling it @@ -226,7 +235,6 @@ namespace WPEFramework { { LOGINFO("device::Manager::DeInitialize failed"); } - } void DisplaySettings::ResolutionPreChange(const char *owner, IARM_EventId_t eventId, void *data, size_t len) diff --git a/DisplaySettings/DisplaySettings.json b/DisplaySettings/DisplaySettings.json deleted file mode 100644 index f2090e66d3..0000000000 --- a/DisplaySettings/DisplaySettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "locator":"libWPEFrameworkDisplaySettings.so", - "classname":"DisplaySettings", - "precondition":[ - "Platform" - ], - "autostart":true -} \ No newline at end of file diff --git a/FrontPanel/CMakeLists.txt b/FrontPanel/CMakeLists.txt index fe1f8ccaa6..1ab19c444d 100644 --- a/FrontPanel/CMakeLists.txt +++ b/FrontPanel/CMakeLists.txt @@ -25,7 +25,7 @@ add_library(${MODULE_NAME} SHARED Module.cpp ../helpers/frontpanel.cpp ../helpers/powerstate.cpp -) + ../helpers/utils.cpp) set_target_properties(${MODULE_NAME} PROPERTIES CXX_STANDARD 11 diff --git a/FrontPanel/FrontPanel.cpp b/FrontPanel/FrontPanel.cpp index 57b13ba6ff..670e162833 100644 --- a/FrontPanel/FrontPanel.cpp +++ b/FrontPanel/FrontPanel.cpp @@ -158,7 +158,6 @@ namespace WPEFramework FrontPanel::FrontPanel() : AbstractPlugin() - , m_iarmConnected(false) , m_updateTimer(this) { LOGINFO(); @@ -204,28 +203,12 @@ namespace WPEFramework { LOGINFO(); - int isRegistered; - IARM_Result_t res = IARM_Bus_IsConnected("Front_Panel" , &isRegistered); - if(res != IARM_RESULT_SUCCESS) - { - IARM_CHECK( IARM_Bus_Init("Front_Panel") ); - IARM_CHECK( IARM_Bus_Connect() ); - m_iarmConnected = true; - } + Utils::IARM::init(); } - //TODO(MROLLINS) - we need to install crash handler to ensure DeinitializeIARM gets called void FrontPanel::DeinitializeIARM() { LOGINFO(); - - if (m_iarmConnected) - { - m_iarmConnected = false; - IARM_Result_t res; - IARM_CHECK( IARM_Bus_Disconnect() ); - IARM_CHECK( IARM_Bus_Term() ); - } } void setResponseArray(JsonObject& response, const char* key, const vector& items) diff --git a/FrontPanel/FrontPanel.h b/FrontPanel/FrontPanel.h index 678f8dde6c..994b395809 100644 --- a/FrontPanel/FrontPanel.h +++ b/FrontPanel/FrontPanel.h @@ -135,7 +135,6 @@ namespace WPEFramework { public: static FrontPanel* _instance; private: - bool m_iarmConnected; static int m_savedClockBrightness; static int m_LedDisplayPatternUpdateTimerInterval; diff --git a/FrontPanel/FrontPanel.json b/FrontPanel/FrontPanel.json deleted file mode 100644 index 4e439a4bdf..0000000000 --- a/FrontPanel/FrontPanel.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "locator":"libWPEFrameworkFrontPanel.so", - "classname":"FrontPanel", - "precondition":[ - "Platform" - ], - "autostart":true -} \ No newline at end of file diff --git a/HdcpProfile/CMakeLists.txt b/HdcpProfile/CMakeLists.txt index 930256da3b..c1a661e248 100644 --- a/HdcpProfile/CMakeLists.txt +++ b/HdcpProfile/CMakeLists.txt @@ -22,7 +22,8 @@ find_package(${NAMESPACE}Plugins REQUIRED) add_library(${MODULE_NAME} SHARED HdcpProfile.cpp - Module.cpp) + Module.cpp + ../helpers/utils.cpp) set_target_properties(${MODULE_NAME} PROPERTIES CXX_STANDARD 11 diff --git a/HdcpProfile/HdcpProfile.cpp b/HdcpProfile/HdcpProfile.cpp index 615fb93e58..2210ebd22a 100644 --- a/HdcpProfile/HdcpProfile.cpp +++ b/HdcpProfile/HdcpProfile.cpp @@ -67,32 +67,20 @@ namespace WPEFramework { LOGINFO(); - int isRegistered; - IARM_Result_t res = IARM_Bus_IsConnected("HdcpProfile" , &isRegistered); - if(res != IARM_RESULT_SUCCESS) - { - IARM_CHECK( IARM_Bus_Init("HdcpProfile") ); - IARM_CHECK( IARM_Bus_Connect() ); - m_iarmConnected = true; - } + Utils::IARM::init(); + IARM_Result_t res; IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG, dsHdmiEventHandler) ); } - //TODO(MROLLINS) - we need to install crash handler to ensure DeinitializeIARM gets called void HdcpProfile::DeinitializeIARM() { LOGINFO(); - if (m_iarmConnected) + if (Utils::IARM::isConnected()) { - m_iarmConnected = false; IARM_Result_t res; - IARM_CHECK( IARM_Bus_UnRegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG) ); - - IARM_CHECK( IARM_Bus_Disconnect() ); - IARM_CHECK( IARM_Bus_Term() ); } } diff --git a/HdcpProfile/HdcpProfile.h b/HdcpProfile/HdcpProfile.h index a68d4af885..189ede4ebf 100644 --- a/HdcpProfile/HdcpProfile.h +++ b/HdcpProfile/HdcpProfile.h @@ -70,8 +70,6 @@ namespace WPEFramework { void terminate(); static HdcpProfile* _instance; - private: - bool m_iarmConnected; }; } // namespace Plugin } // namespace WPEFramework diff --git a/HdmiCec/CMakeLists.txt b/HdmiCec/CMakeLists.txt index 94312b4156..271a7b63bf 100644 --- a/HdmiCec/CMakeLists.txt +++ b/HdmiCec/CMakeLists.txt @@ -22,7 +22,8 @@ find_package(${NAMESPACE}Plugins REQUIRED) add_library(${MODULE_NAME} SHARED HdmiCec.cpp - Module.cpp) + Module.cpp + ../helpers/utils.cpp) set_target_properties(${MODULE_NAME} PROPERTIES CXX_STANDARD 11 diff --git a/HdmiCec/HdmiCec.cpp b/HdmiCec/HdmiCec.cpp index c5020a426f..8cecae617a 100644 --- a/HdmiCec/HdmiCec.cpp +++ b/HdmiCec/HdmiCec.cpp @@ -115,38 +115,27 @@ namespace WPEFramework { LOGINFO(); - int isRegistered; - IARM_Result_t res = IARM_Bus_IsConnected("HdmiCec" , &isRegistered); - if(res != IARM_RESULT_SUCCESS) + if (Utils::IARM::init()) { - IARM_CHECK( IARM_Bus_Init("HdmiCec") ); - IARM_CHECK( IARM_Bus_Connect() ); - m_iarmConnected = true; + IARM_Result_t res; + //IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_CECHOST_NAME, IARM_BUS_CECHost_EVENT_DEVICESTATUSCHANGE,cecDeviceStatusEventHandler) ); // It didn't do anything in original service + IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_CECMGR_NAME, IARM_BUS_CECMGR_EVENT_DAEMON_INITIALIZED,cecMgrEventHandler) ); + IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_CECMGR_NAME, IARM_BUS_CECMGR_EVENT_STATUS_UPDATED,cecMgrEventHandler) ); + IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG, dsHdmiEventHandler) ); } - - //IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_CECHOST_NAME, IARM_BUS_CECHost_EVENT_DEVICESTATUSCHANGE,cecDeviceStatusEventHandler) ); // It didn't do anything in original service - IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_CECMGR_NAME, IARM_BUS_CECMGR_EVENT_DAEMON_INITIALIZED,cecMgrEventHandler) ); - IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_CECMGR_NAME, IARM_BUS_CECMGR_EVENT_STATUS_UPDATED,cecMgrEventHandler) ); - IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG, dsHdmiEventHandler) ); } - //TODO(MROLLINS) - we need to install crash handler to ensure DeinitializeIARM gets called void HdmiCec::DeinitializeIARM() { LOGINFO(); - if (m_iarmConnected) + if (Utils::IARM::isConnected()) { - m_iarmConnected = false; IARM_Result_t res; - //IARM_CHECK( IARM_Bus_UnRegisterEventHandler(IARM_BUS_CECHOST_NAME, IARM_BUS_CECHost_EVENT_DEVICESTATUSCHANGE) ); IARM_CHECK( IARM_Bus_UnRegisterEventHandler(IARM_BUS_CECMGR_NAME, IARM_BUS_CECMGR_EVENT_DAEMON_INITIALIZED) ); IARM_CHECK( IARM_Bus_UnRegisterEventHandler(IARM_BUS_CECMGR_NAME, IARM_BUS_CECMGR_EVENT_STATUS_UPDATED) ); IARM_CHECK( IARM_Bus_UnRegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG) ); - - IARM_CHECK( IARM_Bus_Disconnect() ); - IARM_CHECK( IARM_Bus_Term() ); } } diff --git a/HdmiCec/HdmiCec.h b/HdmiCec/HdmiCec.h index 62114a9fab..d0ce240e10 100644 --- a/HdmiCec/HdmiCec.h +++ b/HdmiCec/HdmiCec.h @@ -69,7 +69,6 @@ namespace WPEFramework { public: static HdmiCec* _instance; private: - bool m_iarmConnected; std::string logicalAddressDeviceType; unsigned int logicalAddress; unsigned int physicalAddress; diff --git a/HdmiInput/CMakeLists.txt b/HdmiInput/CMakeLists.txt index 634f1e423f..3f669242fc 100644 --- a/HdmiInput/CMakeLists.txt +++ b/HdmiInput/CMakeLists.txt @@ -22,7 +22,8 @@ find_package(${NAMESPACE}Plugins REQUIRED) add_library(${MODULE_NAME} SHARED HdmiInput.cpp - Module.cpp) + Module.cpp + ../helpers/utils.cpp) set_target_properties(${MODULE_NAME} PROPERTIES CXX_STANDARD 11 diff --git a/HdmiInput/HdmiInput.cpp b/HdmiInput/HdmiInput.cpp index bec75e9c95..bd7c224ba8 100644 --- a/HdmiInput/HdmiInput.cpp +++ b/HdmiInput/HdmiInput.cpp @@ -43,7 +43,6 @@ namespace WPEFramework HdmiInput::HdmiInput() : AbstractPlugin() - , m_iarmConnected(false) { LOGINFO(); HdmiInput::_instance = this; @@ -67,32 +66,21 @@ namespace WPEFramework { LOGINFO(); - int isRegistered; - IARM_Result_t res = IARM_Bus_IsConnected("HdmiInput" , &isRegistered); - if(res != IARM_RESULT_SUCCESS) + if (Utils::IARM::init()) { - IARM_CHECK( IARM_Bus_Init("HdmiInput") ); - IARM_CHECK( IARM_Bus_Connect() ); - m_iarmConnected = true; + IARM_Result_t res; + IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDMI_IN_HOTPLUG, dsHdmiEventHandler) ); } - - IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDMI_IN_HOTPLUG, dsHdmiEventHandler) ); } - //TODO(MROLLINS) - we need to install crash handler to ensure DeinitializeIARM gets called void HdmiInput::DeinitializeIARM() { LOGINFO(); - if (m_iarmConnected) + if (Utils::IARM::isConnected()) { - m_iarmConnected = false; IARM_Result_t res; - IARM_CHECK( IARM_Bus_UnRegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDMI_IN_HOTPLUG) ); - - IARM_CHECK( IARM_Bus_Disconnect() ); - IARM_CHECK( IARM_Bus_Term() ); } } diff --git a/HdmiInput/HdmiInput.h b/HdmiInput/HdmiInput.h index 8dc26e8a7f..b5ea5df10a 100644 --- a/HdmiInput/HdmiInput.h +++ b/HdmiInput/HdmiInput.h @@ -72,9 +72,6 @@ namespace WPEFramework { public: static HdmiInput* _instance; - - private: - bool m_iarmConnected; }; } // namespace Plugin } // namespace WPEFramework diff --git a/LocationSync/LocationSyncPlugin.json b/LocationSync/LocationSyncPlugin.json deleted file mode 100644 index f5b0535d2d..0000000000 --- a/LocationSync/LocationSyncPlugin.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "plugin.schema.json", - "info": { - "title": "Location Sync Plugin", - "callsign": "LocationSync", - "locator": "libWPELocationSync.so", - "status": "production", - "description": "The LocationSync plugin provides geo-location functionality.", - "version": "1.0" - }, - "interface": { - "$ref": "{interfacedir}/LocationSync.json#" - } -} diff --git a/LoggingPreferences/CMakeLists.txt b/LoggingPreferences/CMakeLists.txt index 495e203491..911ce1f168 100644 --- a/LoggingPreferences/CMakeLists.txt +++ b/LoggingPreferences/CMakeLists.txt @@ -22,7 +22,8 @@ find_package(${NAMESPACE}Plugins REQUIRED) add_library(${MODULE_NAME} SHARED LoggingPreferences.cpp - Module.cpp) + Module.cpp + ../helpers/utils.cpp) set_target_properties(${MODULE_NAME} PROPERTIES CXX_STANDARD 11 diff --git a/LoggingPreferences/LoggingPreferences.cpp b/LoggingPreferences/LoggingPreferences.cpp index 7c0746d660..1e525f1acb 100644 --- a/LoggingPreferences/LoggingPreferences.cpp +++ b/LoggingPreferences/LoggingPreferences.cpp @@ -61,17 +61,13 @@ namespace WPEFramework { void LoggingPreferences::InitializeIARM() { LOGINFO(); - IARM_Result_t res; - IARM_CHECK( IARM_Bus_Init("LoggingPreferences") ); - IARM_CHECK( IARM_Bus_Connect() ); + + Utils::IARM::init(); } void LoggingPreferences::DeinitializeIARM() { LOGINFO(); - IARM_Result_t res; - IARM_CHECK( IARM_Bus_Disconnect() ); - IARM_CHECK( IARM_Bus_Term() ); } //Begin methods diff --git a/Messenger/MessengerPlugin.json b/Messenger/MessengerPlugin.json deleted file mode 100644 index 3c316472cf..0000000000 --- a/Messenger/MessengerPlugin.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "plugin.schema.json", - "document": { - "$ref": "docs_common.json" - }, - "info": { - "title": "Messenger Plugin", - "version": "1.0", - "callsign": "Messenger", - "locator": "libWPEFrameworkMessenger.so", - "status": "alpha", - "description": "The Messenger allows exchanging text messages between users gathered in virtual rooms. The rooms are dynamically created and destroyed based on user attendance. Upon joining a room the client receives a unique token (room ID) to be used for sending and receiving the messages." - }, - "interface": { - "$ref": "{interfacedir}/Messenger.json#" - } -} diff --git a/Monitor/MonitorPlugin.json b/Monitor/MonitorPlugin.json deleted file mode 100644 index 82972298f4..0000000000 --- a/Monitor/MonitorPlugin.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "plugin.schema.json", - "info": { - "title": "Monitor Plugin", - "callsign": "Monitor", - "locator": "libWPEFrameworkMonitor.so", - "status": "production", - "description": "The Monitor plugin provides a watchdog-like functionality for framework processes.", - "version": "1.0" - }, - "interface": { - "$ref": "{interfacedir}/Monitor.json#" - } -} diff --git a/OpenCDMi/OpenCDMiPlugin.json b/OpenCDMi/OpenCDMiPlugin.json deleted file mode 100644 index 38daf94c50..0000000000 --- a/OpenCDMi/OpenCDMiPlugin.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "plugin.schema.json", - "info": { - "title": "OpenCDMi Plugin", - "callsign": "OCDM", - "locator": "libWPEFrameworkOCDM.so", - "status": "production", - "version": "1.0" - }, - "interface": { - "$ref": "{interfacedir}/OCDM.json#" - } -} diff --git a/SecurityAgent/SecurityAgentPlugin.json b/SecurityAgent/SecurityAgentPlugin.json deleted file mode 100644 index 03600c3471..0000000000 --- a/SecurityAgent/SecurityAgentPlugin.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "plugin.schema.json", - "info": { - "title": "Security Agent Plugin", - "callsign": "SecurityAgent", - "locator": "libWPEFrameworkSecurityAgent.so", - "status": "production", - "description": "Security Agent of thunder is responsible to allow or block access to the Thunder API.", - "version": "1.0" - }, - "interface": { - "$ref": "{interfacedir}/SecurityAgent.json#" - } -} diff --git a/SecurityAgent/example_acl.json b/SecurityAgent/example_acl.json deleted file mode 100644 index 0991e5ebbd..0000000000 --- a/SecurityAgent/example_acl.json +++ /dev/null @@ -1,220 +0,0 @@ -{ - "assign": [ - { - "url": "*://localhost", - "role": "local" - }, - { - "url": "*://localhost:*", - "role": "local" - }, - { - "url": "*://127.0.0.1", - "role": "local" - }, - { - "url": "*://127.0.0.1:*", - "role": "local" - }, - { - "url": "*://[::1]", - "role": "local" - }, - { - "url": "*://[::1]:*", - "role": "local" - }, - { - "url": "*://[0:0:0:0:0:0:0:1]", - "role": "local" - }, - { - "url": "*://[0:0:0:0:0:0:0:1]:*", - "role": "local" - }, - { - "url": "file://*", - "role": "local" - }, - { - "url": "*://*.comcast.com", - "role": "comcast" - }, - { - "url": "*://*.comcast.com:*", - "role": "comcast" - }, - { - "url": "*://*.comcast.net", - "role": "comcast" - }, - { - "url": "*://*.comcast.net:*", - "role": "comcast" - }, - { - "url": "*.x1.xcal.tv", - "role": "comcast" - }, - { - "url": "*.x1.xcal.tv:*", - "role": "comcast" - }, - { - "url": "*.x1-app.xcr.comcast.net", - "role": "comcast" - }, - { - "url": "*.x1-app.xcr.comcast.net:*", - "role": "comcast" - }, - { - "url": "*://www.pxscene.org", - "role": "pxscene.org" - }, - { - "url": "*://www.pxscene.org:*", - "role": "pxscene.org" - }, - { - "url": "*://pxscene.org", - "role": "pxscene.org" - }, - { - "url": "*://pxscene.org:*", - "role": "pxscene.org" - }, - { - "url": "*://www.sparkui.org", - "role": "sparkui.org" - }, - { - "url": "*://www.sparkui.org:*", - "role": "sparkui.org" - }, - { - "url": "*://sparkui.org", - "role": "sparkui.org" - }, - { - "url": "*://sparkui.org:*", - "role": "sparkui.org" - }, - { - "url": "*://xre2-apps.cvs-a.ula.comcast.net", - "role": "pxscene-samples" - }, - { - "url": "*://xre2-apps.cvs-a.ula.comcast.net:*", - "role": "pxscene-samples" - }, - { - "url": "*://px-apps.sys.comcast.net", - "role": "pxscene-samples" - }, - { - "url": "*://px-apps.sys.comcast.net:*", - "role": "pxscene-samples" - }, - { - "url": "*://*.xreapps.net", - "role": "xreapps.net" - }, - { - "url": "*://tvxcts-c5-c00001-b.ch.tvx.comcast.com", - "role": "cts" - }, - { - "url": "*://metrological.com", - "role": "metrological" - }, - { - "url": "*", - "role": "default" - } - ], - "roles": { - "default" : { - "thunder": { - "block" : [ - "*" - ] - } - }, - "xreapps.net": { - "thunder": { - "allow": [ - "*" - ], - "block" : [ - "DeviceInfo" - ] - } - }, - "local": { - "thunder": { - "allow": [ - "*" - ], - "block" : [ - ] - } - }, - "comcast": { - "thunder": { - "allow": [ - "DeviceInfo" - ], - "block" : [ - ] - } - }, - "metrological": { - "thunder": { - "allow": [ - "*" - ], - "block" : [ - ] - } - }, - "pxscene.org": { - "thunder": { - "allow": [ - "*" - ], - "block" : [ - ] - } - }, - "pxscene-samples": { - "thunder": { - "allow": [ - "*" - ], - "block" : [ - ] - } - }, - "cts": { - "thunder": { - "allow": [ - "*" - ], - "block" : [ - "DeviceInfo" - ] - } - }, - "sparkui.org": { - "thunder": { - "allow": [ - "*" - ], - "block" : [ - "DeviceInfo" - ] - } - } - } -} diff --git a/Spark/Spark.json b/Spark/Spark.json deleted file mode 100644 index d723683878..0000000000 --- a/Spark/Spark.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "locator":"libWPEFrameworkSpark.so", - "classname":"Spark", - "precondition":[ - "Internet", - "Graphics" - ], - "autostart":false, - "configuration":{ - "url":"browser.js", - "root":{ - "threads":2 - } - } -} \ No newline at end of file diff --git a/Spark/SparkPlugin.json b/Spark/SparkPlugin.json deleted file mode 100644 index 7b951bd19d..0000000000 --- a/Spark/SparkPlugin.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "$schema": "plugin.schema.json", - "info": { - "title": "Spark Plugin", - "callsign": "Spark", - "locator": "libWPEFrameworkSpark.so", - "status": "alpha", - "description": "The Spark plugin provides web browsing functionality based on the Spark engine.", - "version": "1.0" - }, - "configuration": { - "type": "object", - "properties": { - "configuration": { - "type": "object", - "required": [], - "properties": { - "url": { - "type": "string", - "description": "The URL that is loaded upon starting the browser" - } - } - } - }, - "required": [ - "callsign", - "classname", - "locator" - ] - }, - "interface": { - "$ref": "{interfacedir}/Spark.json#" - } -} diff --git a/StateObserver/CMakeLists.txt b/StateObserver/CMakeLists.txt index 3b477fd5b6..e8578f214c 100644 --- a/StateObserver/CMakeLists.txt +++ b/StateObserver/CMakeLists.txt @@ -24,7 +24,8 @@ find_package(${NAMESPACE}Plugins REQUIRED) add_library(${MODULE_NAME} SHARED StateObserver.cpp - Module.cpp) + Module.cpp + ../helpers/utils.cpp) #add_subdirectory(test) diff --git a/StateObserver/StateObserver.cpp b/StateObserver/StateObserver.cpp index 70311b12ee..eb33c3e95d 100644 --- a/StateObserver/StateObserver.cpp +++ b/StateObserver/StateObserver.cpp @@ -64,7 +64,6 @@ namespace WPEFramework { StateObserver::StateObserver() : AbstractPlugin() , m_apiVersionNumber((uint32_t)-1) - , m_iarmConnected(false) { LOGINFO(); @@ -103,23 +102,24 @@ namespace WPEFramework { void StateObserver::InitializeIARM() { - LOGINFO("initializing IARM bus...\n"); - IARM_Result_t res; + LOGINFO(); - //Register iarm event handler - IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_SYSMGR_NAME, IARM_BUS_SYSMGR_EVENT_SYSTEMSTATE, onReportStateObserverEvents) ); - m_iarmConnected = true; + if (Utils::IARM::init()) + { + IARM_Result_t res; + IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_SYSMGR_NAME, IARM_BUS_SYSMGR_EVENT_SYSTEMSTATE, onReportStateObserverEvents) ); + } } void StateObserver::DeinitializeIARM() { - LOGINFO("disconnecting from IARM Bus...\n"); - if (m_iarmConnected) - { - IARM_Result_t res; - m_iarmConnected = false; - IARM_CHECK( IARM_Bus_UnRegisterEventHandler(IARM_BUS_SYSMGR_NAME, IARM_BUS_SYSMGR_EVENT_SYSTEMSTATE) ); - } + LOGINFO(); + + if (Utils::IARM::isConnected()) + { + IARM_Result_t res; + IARM_CHECK( IARM_Bus_UnRegisterEventHandler(IARM_BUS_SYSMGR_NAME, IARM_BUS_SYSMGR_EVENT_SYSTEMSTATE) ); + } } /** diff --git a/StateObserver/StateObserver.h b/StateObserver/StateObserver.h index bb13d40571..787a72532f 100644 --- a/StateObserver/StateObserver.h +++ b/StateObserver/StateObserver.h @@ -146,7 +146,6 @@ namespace WPEFramework { static StateObserver* _instance; private: uint32_t m_apiVersionNumber; - bool m_iarmConnected; }; } // namespace Plugin diff --git a/StateObserver/test/STOBSThunderClient.cpp b/StateObserver/test/STOBSThunderClient.cpp index 84cba2aee0..d242b65e19 100644 --- a/StateObserver/test/STOBSThunderClient.cpp +++ b/StateObserver/test/STOBSThunderClient.cpp @@ -43,15 +43,14 @@ void showMenu() int main(int argc, char** argv) { - int choice; - JsonObject result; - JsonObject param; - uint32_t ret; - int size; - int i; - string req; - - + int choice; + JsonObject result; + JsonObject param; + int size; + int i; + string req; + + Core::SystemInfo::SetEnvironment(_T("THUNDER_ACCESS"), (_T("127.0.0.1:9998"))); if(NULL == remoteObject) { remoteObject = new JSONRPC::LinkType(_T("StateObserver.1"), _T("")); @@ -80,7 +79,7 @@ int main(int argc, char** argv) req+="]"; cout<<"request string is"<Invoke(1000, _T("getValues"), param, result); + remoteObject->Invoke(1000, _T("getValues"), param, result); if (result["success"].Boolean()) { string resp=result["properties"].String(); @@ -114,7 +113,7 @@ int main(int argc, char** argv) cout<<"request string is"<Invoke(1000, _T("registerListeners"), param, result); + remoteObject->Invoke(1000, _T("registerListeners"), param, result); if (result["success"].Boolean()) { string resp=result["properties"].String(); @@ -148,7 +147,7 @@ int main(int argc, char** argv) cout<<"request string is"<Invoke(1000, _T("unregisterListeners"), param, result); + remoteObject->Invoke(1000, _T("unregisterListeners"), param, result); if (result["success"].Boolean()) { cout<<"StateObserver unregister listeners call Success\n"; @@ -163,7 +162,7 @@ int main(int argc, char** argv) case 4: { cout<<"getName API\n"; - ret = remoteObject->Invoke(1000, _T("getName"), param, result); + remoteObject->Invoke(1000, _T("getName"), param, result); if (result["success"].Boolean()) { string pluginName=result["Name"].String(); @@ -180,7 +179,7 @@ int main(int argc, char** argv) case 5: { cout<<"getApiVersionNumber API\n"; - ret = remoteObject->Invoke(1000, _T("getApiVersionNumber"), param, result); + remoteObject->Invoke(1000, _T("getApiVersionNumber"), param, result); if (result["success"].Boolean()) { string version=result["version"].String(); @@ -202,7 +201,7 @@ int main(int argc, char** argv) cin>>version; string ver="\"" + std::to_string(version) + "\""; param["version"].FromString(ver); - ret = remoteObject->Invoke(1000, _T("setApiVersionNumber"), param, result); + remoteObject->Invoke(1000, _T("setApiVersionNumber"), param, result); if (result["success"].Boolean()) { cout<<"StateObserver setApiVersionNumber call Success\n"; diff --git a/SystemServices/CMakeLists.txt b/SystemServices/CMakeLists.txt index 046f9118fb..d246cd9b47 100644 --- a/SystemServices/CMakeLists.txt +++ b/SystemServices/CMakeLists.txt @@ -32,8 +32,7 @@ add_library(${MODULE_NAME} SHARED ../helpers/powerstate.cpp ../helpers/thermonitor.cpp ../helpers/SystemServicesHelper.cpp - ../helpers/utils.cpp -) + ../helpers/utils.cpp) set_target_properties(${MODULE_NAME} PROPERTIES CXX_STANDARD 11 diff --git a/SystemServices/SystemServices.cpp b/SystemServices/SystemServices.cpp index c8c69a053a..7087272142 100644 --- a/SystemServices/SystemServices.cpp +++ b/SystemServices/SystemServices.cpp @@ -370,34 +370,32 @@ namespace WPEFramework { void SystemServices::InitializeIARM() { LOGINFO(); - IARM_Result_t res; - IARM_CHECK(IARM_Bus_Init("SystemServices")); - IARM_CHECK(IARM_Bus_Connect()); - IARM_Bus_RegisterCall(IARM_BUS_COMMON_API_SysModeChange, _SysModeChange); - IARM_Bus_RegisterEventHandler(IARM_BUS_SYSMGR_NAME, - IARM_BUS_SYSMGR_EVENT_SYSTEMSTATE, _firmwareUpdateStateChanged); - IARM_Bus_RegisterEventHandler(IARM_BUS_PWRMGR_NAME, - IARM_BUS_PWRMGR_EVENT_MODECHANGED, _powerEventHandler); + + if (Utils::IARM::init()) + { + IARM_Result_t res; + IARM_CHECK( IARM_Bus_RegisterCall(IARM_BUS_COMMON_API_SysModeChange, _SysModeChange)); + IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_SYSMGR_NAME, IARM_BUS_SYSMGR_EVENT_SYSTEMSTATE, _firmwareUpdateStateChanged)); + IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_PWRMGR_NAME, IARM_BUS_PWRMGR_EVENT_MODECHANGED, _powerEventHandler)); #ifdef ENABLE_THERMAL_PROTECTION - IARM_Bus_RegisterEventHandler(IARM_BUS_PWRMGR_NAME, - IARM_BUS_PWRMGR_EVENT_THERMAL_MODECHANGED, _thermMgrEventsHandler); + IARM_CHECK( IARM_Bus_RegisterEventHandler(IARM_BUS_PWRMGR_NAME, IARM_BUS_PWRMGR_EVENT_THERMAL_MODECHANGED, _thermMgrEventsHandler)); #endif //ENABLE_THERMAL_PROTECTION + } } void SystemServices::DeinitializeIARM() { LOGINFO(); - IARM_Result_t res; - IARM_Bus_UnRegisterEventHandler(IARM_BUS_SYSMGR_NAME, - IARM_BUS_SYSMGR_EVENT_SYSTEMSTATE); - IARM_Bus_UnRegisterEventHandler(IARM_BUS_PWRMGR_NAME, - IARM_BUS_PWRMGR_EVENT_MODECHANGED); -#ifdef ENABLE_THERMAL_PROTECTION - IARM_Bus_UnRegisterEventHandler(IARM_BUS_PWRMGR_NAME, - IARM_BUS_PWRMGR_EVENT_THERMAL_MODECHANGED); -#endif //ENABLE_THERMAL_PROTECTION - IARM_CHECK(IARM_Bus_Disconnect()); - IARM_CHECK(IARM_Bus_Term()); + + if (Utils::IARM::isConnected()) + { + IARM_Result_t res; + IARM_CHECK( IARM_Bus_UnRegisterEventHandler(IARM_BUS_SYSMGR_NAME, IARM_BUS_SYSMGR_EVENT_SYSTEMSTATE)); + IARM_CHECK( IARM_Bus_UnRegisterEventHandler(IARM_BUS_PWRMGR_NAME, IARM_BUS_PWRMGR_EVENT_MODECHANGED)); + #ifdef ENABLE_THERMAL_PROTECTION + IARM_CHECK( IARM_Bus_UnRegisterEventHandler(IARM_BUS_PWRMGR_NAME, IARM_BUS_PWRMGR_EVENT_THERMAL_MODECHANGED)); + #endif //ENABLE_THERMAL_PROTECTION + } } #endif /* defined(USE_IARMBUS) || defined(USE_IARM_BUS) */ @@ -959,7 +957,6 @@ namespace WPEFramework { uint32_t SystemServices::getFirmwareUpdateInfo(const JsonObject& parameters, JsonObject& response) { - bool result = false; string callGUID; callGUID = parameters["GUID"].String(); diff --git a/Timer/Timer.cpp b/Timer/Timer.cpp index 7e54636e85..bbbb2577d6 100644 --- a/Timer/Timer.cpp +++ b/Timer/Timer.cpp @@ -86,14 +86,14 @@ namespace WPEFramework Timer::_instance = nullptr; } - bool Timer::checkTimers() + void Timer::checkTimers() { LOGINFO(); double minTimeout = 100000; for (auto it = m_runningItems.cbegin(); it != m_runningItems.cend(); ++it) { - int timerId = *it; + unsigned int timerId = *it; if (timerId < 0 || timerId >= m_timerItems.size()) { LOGERR("Internal error: wrong timerId"); @@ -186,7 +186,7 @@ namespace WPEFramework for (auto it = m_runningItems.cbegin(); it != m_runningItems.cend(); ++it) { - int timerId = *it; + unsigned int timerId = *it; if (timerId < 0 || timerId >= m_timerItems.size()) { LOGERR("Internal error: wrong timerId"); @@ -313,7 +313,7 @@ namespace WPEFramework returnResponse(false); } - int timerId; + unsigned int timerId; getNumberParameter("timerId", timerId); if (timerId >=0 && timerId < m_timerItems.size()) @@ -343,7 +343,7 @@ namespace WPEFramework returnResponse(false); } - int timerId; + unsigned int timerId; getNumberParameter("timerId", timerId); if (timerId >=0 && timerId < m_timerItems.size()) @@ -373,7 +373,7 @@ namespace WPEFramework returnResponse(false); } - int timerId; + unsigned int timerId; getNumberParameter("timerId", timerId); if (timerId >=0 && timerId < m_timerItems.size()) @@ -404,7 +404,7 @@ namespace WPEFramework returnResponse(false); } - int timerId; + unsigned int timerId; getNumberParameter("timerId", timerId); if (timerId >= 0 && timerId < m_timerItems.size()) @@ -427,7 +427,7 @@ namespace WPEFramework LOGINFO(); JsonArray timers; - for (int n = 0; n < m_timerItems.size(); n++) + for (unsigned int n = 0; n < m_timerItems.size(); n++) { JsonObject timer; getTimerStatus(n, timer, true); diff --git a/Timer/Timer.h b/Timer/Timer.h index 424f524f75..0fd8d9b1ed 100644 --- a/Timer/Timer.h +++ b/Timer/Timer.h @@ -90,7 +90,7 @@ namespace WPEFramework { void sendTimerExpiryReminder(int timerId); //End events - bool checkTimers(); + void checkTimers(); void startTimer(int timerId); bool cancelTimer(int timerId); diff --git a/TraceControl/TraceControlPlugin.json b/TraceControl/TraceControlPlugin.json deleted file mode 100644 index 959303f50d..0000000000 --- a/TraceControl/TraceControlPlugin.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "plugin.schema.json", - "info": { - "title": "Trace Control Plugin", - "callsign": "TraceControl", - "locator": "libWPEFrameworkTraceControl.so", - "status": "production", - "description": "The Trace Control plugin provides ability to disable/enable trace output an set its verbosity level.", - "version": "1.0" - }, - "interface": { - "$ref": "{interfacedir}/TraceControl.json#" - } -} diff --git a/Warehouse/Warehouse.json b/Warehouse/Warehouse.json deleted file mode 100644 index d19e573a91..0000000000 --- a/Warehouse/Warehouse.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "locator":"libWPEFrameworkWarehouse.so", - "classname":"Warehouse", - "precondition":[ - "Platform" - ], - "autostart":true -} \ No newline at end of file diff --git a/WebKitBrowser/WebKitBrowserPlugin.json b/WebKitBrowser/WebKitBrowserPlugin.json deleted file mode 100644 index c6e9e25d9f..0000000000 --- a/WebKitBrowser/WebKitBrowserPlugin.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "$schema": "plugin.schema.json", - "info": { - "title": "WebKit Browser Plugin", - "callsign": "WebKitBrowser", - "locator": "libWPEFrameworkWebKitBrowser.so", - "status": "production", - "description": "The WebKitBrowser plugin provides web browsing functionality based on the WebKit engine.", - "version": "1.0" - }, - "configuration": { - "type": "object", - "properties": { - "configuration": { - "type": "object", - "required": [], - "properties": { - "useragent": { - "type": "string", - "description": "The UserAgent used during communication with the web server" - }, - "url": { - "type": "string", - "description": "The URL that is loaded upon starting the browser" - }, - "injectedbundle": { - "type": "string", - "description": "The name of the .so loaded to extend the HTML5 with customized JavaScript handlers" - }, - "cookiestorage": { - "type": "string", - "description": "Post-fixed path to the persistent location on where cookies will be stored" - }, - "localstorage": { - "type": "string", - "description": "Post-fixed path to the persistent location on where local-storage will be stored" - }, - "certificatecheck": { - "type": "boolean", - "description": "If enabled, SSL certificate error will lead to a page error" - }, - "javascript": { - "type": "object", - "properties": { - "useLLInt": { - "type": "boolean", - "description": "Enable Low Level Interpreter" - }, - "useJIT": { - "type": "boolean", - "description": "Enable JIT" - }, - "useDFG": { - "type": "boolean", - "description": "Enable Data-Flow-Graph-JIT compiler" - }, - "useFTL": { - "type": "boolean", - "description": "Enable Faster-Than-Light-JIT compiler" - }, - "useDOM": { - "type": "boolean", - "description": "Enable the DOM-JIT compiler" - }, - "dumpOptions": { - "type": "string", - "description": "Dump options: 0 = None, 1 = Overridden only, 2 = All, 3 = Verbose" - } - }, - "required": [] - }, - "secure": { - "type": "boolean", - "description": "If false, every domain can access any other domain, otherwise fill in fields in whitelist definition table" - }, - "whitelist": { - "type": "object", - "properties": { - "origin": { - "type": "string", - "description": "Origin domain allowed to access domains in domain" - }, - "domain": { - "type": "array", - "items": { - "type": "string", - "description": "Domain allowed to access from origin" - } - }, - "subdomain": { - "type": "string", - "description": "whether it is also OK to access subdomains of domains listed in domain" - } - }, - "required": [] - } - } - } - }, - "required": [ - "callsign", - "classname", - "locator" - ] - }, - "interface": { - "$ref": "{interfacedir}/WebKitBrowser.json#" - } -} diff --git a/WifiManager/WifiManager.cpp b/WifiManager/WifiManager.cpp index 907e68b42e..b29423dfb5 100644 --- a/WifiManager/WifiManager.cpp +++ b/WifiManager/WifiManager.cpp @@ -65,42 +65,28 @@ namespace WPEFramework apiVersionNumber(1), wifiSignalThreshold(*this) { - LOGINFO(); - - for(const auto &mapping: constMethods) { + for(const auto &mapping: constMethods) Register(mapping.first, mapping.second, this); - } - for(const auto &mapping: mutableMethods) { + for(const auto &mapping: mutableMethods) Register(mapping.first, mapping.second, this); - } - - IARM_Result_t res; - IARM_CHECK(IARM_Bus_Init("WifiManager")); - IARM_CHECK(IARM_Bus_Connect()); } WifiManager::~WifiManager() { - LOGINFO(); - - IARM_Result_t res; - IARM_CHECK(IARM_Bus_Disconnect()); - IARM_CHECK(IARM_Bus_Term()); - - for(const auto &mapping: constMethods) { + for(const auto &mapping: constMethods) Unregister(mapping.first); - } - for(const auto &mapping: mutableMethods) { + for(const auto &mapping: mutableMethods) Unregister(mapping.first); - } } const string WifiManager::Initialize(PluginHost::IShell* service) { LOGINFO(); + Utils::IARM::init(); + if (instance != nullptr) { LOGERR("Expecting 'instance' to be initially unset; two instances of the plugin?"); return string("Expecting m_instance to be initially unset"); diff --git a/WifiManager/impl/WifiManagerState.cpp b/WifiManager/impl/WifiManagerState.cpp index fd23d26547..8e06b2fead 100644 --- a/WifiManager/impl/WifiManagerState.cpp +++ b/WifiManager/impl/WifiManagerState.cpp @@ -39,6 +39,7 @@ namespace { case WIFI_CONNECTED: return WifiState::CONNECTED; case WIFI_FAILED: return WifiState::FAILED; } + return WifiState::FAILED; } } @@ -92,7 +93,6 @@ uint32_t WifiManagerState::setEnabled(const JsonObject ¶meters, JsonObject & LOGINFOMETHOD(); returnIfBooleanParamNotFound(parameters, "enable"); - bool success = false; IARM_BUS_NetSrvMgr_Iface_EventData_t param; memset(¶m, 0, sizeof(param));