Skip to content

Commit

Permalink
Changed Autostart to startmode (#1481)
Browse files Browse the repository at this point in the history
* Changed Autostart to startmode

* Startup moved to Startmode to align naming

* Resume changed Resumed
  • Loading branch information
HaseenaSainul authored Jan 2, 2024
1 parent e45912b commit 357eb43
Show file tree
Hide file tree
Showing 15 changed files with 93 additions and 114 deletions.
4 changes: 1 addition & 3 deletions Source/WPEFramework/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1098,15 +1098,13 @@ namespace Plugin {
service.Locator = meta.Locator;
service.ClassName = meta.ClassName;
service.Module = meta.Module;
service.StartMode = meta.Startup;
service.AutoStart = meta.AutoStart;
service.StartMode = meta.StartMode;
service.State = meta.JSONState;
service.Version = meta.ServiceVersion;
service.Communicator = meta.Communicator;
service.PersistentPathPostfix = meta.PersistentPathPostfix;
service.VolatilePathPostfix = meta.VolatilePathPostfix;
service.SystemRootPath = meta.SystemRootPath;
service.AutoStart = meta.AutoStart;
service.Configuration = meta.Configuration;
service.Precondition = meta.Precondition;
service.Termination = meta.Termination;
Expand Down
2 changes: 1 addition & 1 deletion Source/WPEFramework/ExampleConfigAll.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
"callsign":"Browser",
"locator":"libbrowser.so",
"classname":"Browser",
"autostart":false,
"startmode": "deactivated",
"configuration":
{
"fullscreen":true,
Expand Down
2 changes: 1 addition & 1 deletion Source/WPEFramework/ExampleConfigLinux.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"callsign": "Monitor",
"locator": "libmonitor.so",
"classname": "Monitor",
"autostart": true,
"startmode": "activated",
"configuration": {
"observables": [
{
Expand Down
76 changes: 38 additions & 38 deletions Source/WPEFramework/ExampleConfigWindows.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"callsign": "Cobalt",
"locator": "liboutofprocessplugin.so",
"classname": "OutOfProcessPlugin",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"url": "http://netflix.com/tv",
"sleep": "1",
Expand All @@ -82,7 +82,7 @@
"callsign": "TestPlugin",
"locator": "libTestPlugin.so",
"classname": "TestPlugin",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"root": {
"mode": "Local"
Expand All @@ -93,7 +93,7 @@
"callsign": "Doofah",
"locator": "libDoofah.so",
"classname": "Doofah",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"connector": {
"port": "\\\\.\\COM14"
Expand All @@ -105,7 +105,7 @@
"callsign": "calculator",
"locator": "librustbridge.so",
"classname": "RustBridge",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"module": "calculator.dll",
"root": {
Expand All @@ -117,7 +117,7 @@
"callsign": "Provisioning",
"locator": "libProvisioning.so",
"classname": "Provisioning",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"provisionpath": "127.0.0.1:7777"
}
Expand All @@ -126,7 +126,7 @@
"callsign": "BridgeLink",
"locator": "libBridgeLink.so",
"classname": "BridgeLink",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"source": "192.168.11.24:62000",
"retries": 255,
Expand All @@ -137,13 +137,13 @@
"callsign": "Butler",
"locator": "libButler.so",
"classname": "Butler",
"autostart": true
"startmode": "activated"
},
{
"callsign": "ZigbeeControl",
"locator": "libZigbeeControl.so",
"classname": "ZigbeeControl",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"port": "\\\\.\\COM4",
"watchdog": 1442,
Expand All @@ -154,7 +154,7 @@
"callsign": "ZWaveControl",
"locator": "libZWaveControl.so",
"classname": "ZWaveControl",
"autostart": true,
"startmode": "activated",
"configuration": {
"port": "\\\\.\\COM4",
"key": "ba:09:87:65:43:21:de:ad:be:ef:12:34:56:78:90:ab"
Expand All @@ -164,7 +164,7 @@
"callsign": "MQTTBroker",
"locator": "libMQTTBroker.so",
"classname": "MQTTBroker",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"port": "1883",
"binding": "0.0.0.0",
Expand All @@ -175,7 +175,7 @@
"callsign": "WebBridge",
"locator": "libWebBridge.so",
"classname": "WebBridge",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"context": "added"
}
Expand All @@ -184,22 +184,22 @@
"callsign": "QuizzMaster",
"locator": "libQuizzMaster.so",
"classname": "QuizzMaster",
"autostart": false
"startmode": "deactivated"
},
{
"callsign": "StateController",
"locator": "libStateController.so",
"classname": "StateController",
"autostart": false
"startmode": "deactivated"
},
{
"callsign": "SimpleCOMRPCPluginServer",
"locator": "libSimpleCOMRPCPluginServer.so",
"classname": "SimpleCOMRPCPluginServer",
"autostart": false
"startmode": "deactivated"
},
{
"autostart": false,
"startmode": "deactivated",
"callsign": "VirtualControl",
"classname": "VirtualControl",
"locator": "libVirtualControl.so",
Expand Down Expand Up @@ -281,13 +281,13 @@
}
},
{
"autostart": false,
"startmode": "deactivated",
"callsign": "RuleEngine",
"classname": "RuleEngine",
"locator": "libRuleEngine.so"
},
{
"autostart": false,
"startmode": "deactivated",
"callsign": "CloudRelay",
"classname": "CloudRelay",
"locator": "libCloudRelay.so",
Expand Down Expand Up @@ -315,7 +315,7 @@
"callsign": "IOControl",
"locator": "libIOControl.so",
"classname": "IOControl",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"port": "\\\\.\\COM24",
"pins": [
Expand Down Expand Up @@ -362,7 +362,7 @@
"callsign": "OneWireControl",
"locator": "libOneWireControl.so",
"classname": "OneWireControl",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"port": "\\\\.\\COM24",
"devices": [
Expand All @@ -378,7 +378,7 @@
"callsign": "I2CControl",
"locator": "libI2CControl.so",
"classname": "I2CControl",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"port": "\\\\.\\COM24",
"devices": [
Expand All @@ -395,7 +395,7 @@
"callsign": "OutOfProcessPlugin",
"locator": "libOutOfProcessPlugin.so",
"classname": "OutOfProcessPlugin",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"url": "http://netflix.com/tv",
"sleep": "5",
Expand All @@ -410,13 +410,13 @@
"callsign": "JSONRPCPlugin",
"locator": "libJSONRPCPlugin.so",
"classname": "JSONRPCPlugin",
"autostart": false
"startmode": "deactivated"
},
{
"callsign": "OpenCDMi",
"locator": "libOpenCDMi.so",
"classname": "OCDM",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"connector": "127.0.0.1:7912",
"root": {
Expand All @@ -428,7 +428,7 @@
"callsign": "Monitor",
"locator": "libMonitor.so",
"classname": "Monitor",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"observables": [
{
Expand All @@ -454,7 +454,7 @@
"callsign": "WebServer",
"locator": "libWebServer.so",
"classname": "WebServer",
"autostart": false,
"startmode": "deactivated",
"communicator": "127.0.0.1:2349",
"configuration": {
"port": 8080,
Expand All @@ -468,7 +468,7 @@
"callsign": "DeviceInfo",
"locator": "libdeviceinfo.so",
"classname": "DeviceInfo",
"autostart": true,
"startmode": "activated",
"configuration": {
"location": "external",
"identifier": "internal",
Expand All @@ -482,7 +482,7 @@
"callsign": "TimeSync",
"locator": "libtimesync.so",
"classname": "TimeSync",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"interval": 30,
"retries": 20,
Expand All @@ -499,7 +499,7 @@
"callsign": "LocationSync",
"locator": "liblocationsync.so",
"classname": "LocationSync",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"interval": 30,
"retries": 20,
Expand All @@ -510,7 +510,7 @@
"callsign": "BackOffice",
"locator": "libbackoffice.so",
"classname": "BackOffice",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"server": "ws.metrological.com",
"port": 80,
Expand All @@ -525,14 +525,14 @@
"callsign": "Dictionary",
"locator": "libdictionary.so",
"classname": "Dictionary",
"autostart": false,
"startmode": "deactivated",
"communicator": "127.0.0.1:5522"
},
{
"callsign": "DIALServer",
"locator": "libdialserver.so",
"classname": "DIALServer",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"name": "ExploraUltra",
"model": "Generic Platform",
Expand Down Expand Up @@ -565,19 +565,19 @@
"callsign": "MessageControl",
"locator": "libmessagecontrol.so",
"classname": "MessageControl",
"autostart": true
"startmode": "activated"
},
{
"callsign": "TraceControl",
"locator": "libtracecontrol.so",
"classname": "TraceControl",
"autostart": false
"startmode": "deactivated"
},
{
"callsign": "RemoteControl",
"locator": "libremotecontrol.so",
"classname": "RemoteControl",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"mapfile": "ir-remote.json"
}
Expand All @@ -586,15 +586,15 @@
"callsign": "DNSServer",
"locator": "libDNSServer.so",
"classname": "DNSServer",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"bind": "0.0.0.0:53",
"multicast": "224.0.0.251:5353",
"server": [ "192.168.1.250:53", "8.8.8.8:53" ]
}
},
{
"autostart": false,
"startmode": "deactivated",
"callsign": "WebKitBrowser",
"classname": "OutOfProcessPlugin",
"locator": "libOutOfProcessPlugin.so",
Expand All @@ -611,7 +611,7 @@
}
},
{
"autostart": false,
"startmode": "deactivated",
"callsign": "Netflix",
"classname": "OutOfProcessTest",
"locator": "liboutofprocesstest.so",
Expand All @@ -625,7 +625,7 @@
"callsign": "YouTube",
"locator": "liboutofprocesstest.so",
"classname": "OutOfProcessTest",
"autostart": false,
"startmode": "deactivated",
"configuration": {
"outofprocess": false,
"url": "http://youtube.com/tv",
Expand Down
2 changes: 1 addition & 1 deletion Source/WPEFramework/PluginHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ POP_WARNING()
printf("State: %s\n", index.Current().JSONState.Data().c_str());
printf("Locator: %s\n", index.Current().Locator.Value().c_str());
printf("Classname: %s\n", index.Current().ClassName.Value().c_str());
printf("Autostart: %s\n", (index.Current().AutoStart.Value() == true ? _T("true") : _T("false")));
printf("StartMode: %s\n", index.Current().StartMode.Data());
#if THUNDER_RESTFULL_API

printf("Observers: %d\n", index.Current().Observers.Value());
Expand Down
9 changes: 5 additions & 4 deletions Source/WPEFramework/PluginServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ namespace PluginHost {

uint32_t result = Core::ERROR_NONE;

if (Startup() == PluginHost::IShell::startup::DEACTIVATED) {
if (StartMode() == PluginHost::IShell::startmode::DEACTIVATED) {
// We need to shutdown completely
result = Deactivate(why);
}
Expand Down Expand Up @@ -1007,14 +1007,15 @@ namespace PluginHost {
for (auto service : configured_services)
{
if (service->State() != PluginHost::Service::state::UNAVAILABLE) {
if (service->Startup() == PluginHost::IShell::startup::ACTIVATED) {
if (service->StartMode() == PluginHost::IShell::startmode::ACTIVATED) {
SYSLOG(Logging::Startup, (_T("Activating plugin [%s]:[%s]"),
service->ClassName().c_str(), service->Callsign().c_str()));
service->Activate(PluginHost::IShell::STARTUP);
}
else {
SYSLOG(Logging::Startup, (_T("Activation of plugin [%s]:[%s] delayed, autostart is false"),
service->ClassName().c_str(), service->Callsign().c_str()));
SYSLOG(Logging::Startup, (_T("Activation of plugin [%s]:[%s] delayed, start mode is %s"),
service->ClassName().c_str(), service->Callsign().c_str(),
Core::EnumerateType<PluginHost::IShell::startmode>(service->StartMode()).Data()));
}
}
}
Expand Down
Loading

0 comments on commit 357eb43

Please sign in to comment.