-
Notifications
You must be signed in to change notification settings - Fork 423
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
io.openems.edge.core/src/io/openems/edge/core/host/OperatingSystemMac.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package io.openems.edge.core.host; | ||
|
||
import java.net.Inet4Address; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.TreeMap; | ||
import java.util.concurrent.CompletableFuture; | ||
|
||
import io.openems.common.exceptions.NotImplementedException; | ||
import io.openems.common.exceptions.OpenemsError.OpenemsNamedException; | ||
import io.openems.common.jsonrpc.base.JsonrpcResponseSuccess; | ||
import io.openems.edge.common.user.User; | ||
import io.openems.edge.core.host.jsonrpc.ExecuteSystemCommandRequest; | ||
import io.openems.edge.core.host.jsonrpc.ExecuteSystemCommandResponse; | ||
import io.openems.edge.core.host.jsonrpc.ExecuteSystemRestartRequest; | ||
import io.openems.edge.core.host.jsonrpc.SetNetworkConfigRequest; | ||
|
||
public class OperatingSystemMac implements OperatingSystem { | ||
|
||
@Override | ||
public NetworkConfiguration getNetworkConfiguration() throws OpenemsNamedException { | ||
return new NetworkConfiguration(new TreeMap<>()); | ||
} | ||
|
||
@Override | ||
public void handleSetNetworkConfigRequest(User user, NetworkConfiguration oldNetworkConfiguration, | ||
SetNetworkConfigRequest request) throws OpenemsNamedException { | ||
throw new NotImplementedException("SetNetworkConfigRequest is not implemented for Mac"); | ||
|
||
} | ||
|
||
@Override | ||
public String getUsbConfiguration() throws OpenemsNamedException { | ||
// not implemented | ||
return ""; | ||
} | ||
|
||
@Override | ||
public CompletableFuture<ExecuteSystemCommandResponse> handleExecuteSystemCommandRequest( | ||
ExecuteSystemCommandRequest request) throws OpenemsNamedException { | ||
throw new NotImplementedException("ExecuteSystemCommandRequest is not implemented for Mac"); | ||
} | ||
|
||
@Override | ||
public CompletableFuture<? extends JsonrpcResponseSuccess> handleExecuteSystemRestartRequest( | ||
ExecuteSystemRestartRequest request) throws NotImplementedException { | ||
throw new NotImplementedException("ExecuteSystemRestartRequest is not implemented for Mac"); | ||
} | ||
|
||
@Override | ||
public List<Inet4Address> getSystemIPs() throws OpenemsNamedException { | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public CompletableFuture<String> getOperatingSystemVersion() { | ||
return CompletableFuture.completedFuture(System.getProperty("os.name")); | ||
} | ||
|
||
} |