X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=pcucontrol%2Fmodels%2Fintelamt%2FRemoteControlSample.cpp;h=f12cab591f4a783deaac391e20733e260e2d7ddc;hb=0265be55b2963c5843a75a01aa0c9d57a54935cd;hp=c488b642644d9e9230ac951460831858cb93639a;hpb=af5e1cdc43c4b779a34015cc71433bdac3cd9806;p=monitor.git diff --git a/pcucontrol/models/intelamt/RemoteControlSample.cpp b/pcucontrol/models/intelamt/RemoteControlSample.cpp index c488b64..f12cab5 100644 --- a/pcucontrol/models/intelamt/RemoteControlSample.cpp +++ b/pcucontrol/models/intelamt/RemoteControlSample.cpp @@ -29,7 +29,7 @@ void DisplaySystemFirmwareCapabilities(uint32 systemFirmwareCapabilities); void DisplayOemDefinedCapabilities(uint32 OemDefinedCapabilities); bool ExecuteGetSystemPowerstate(Soap *server, bool verbose = true); bool ExecuteGetRemoteControlCapabilities(Soap *server, bool verbose = true); -bool ExecuteRemoteControl(Soap *server, bool default_val = false); +bool ExecuteRemoteControl(Soap *server, bool default_val = false, uint8 icommand=Reset); bool MainFlow(Soap *server,int option,bool verbose); bool ValidateOption(char *option, int *parameter); @@ -173,7 +173,13 @@ bool MainFlow(Soap *server, int option, bool verbose) { return status; } - if ((status = ExecuteRemoteControl(server,true)) == false) + /* Ensure that the machine is powered up before trying to + * 'reset' it, since a reset on a down node will fail. */ + if ((status = ExecuteRemoteControl(server,true,PowerUp)) == false) + { + return status; + } + if ((status = ExecuteRemoteControl(server,true,Reset)) == false) { return status; } @@ -344,7 +350,7 @@ bool ExecuteGetRemoteControlCapabilities(Soap* server, bool verbose) * true - on success * false - on failure */ -bool ExecuteRemoteControl(Soap* server,bool def_values) +bool ExecuteRemoteControl(Soap* server,bool def_values, uint8 icommand) { int res; bool status = true; @@ -357,7 +363,7 @@ bool ExecuteRemoteControl(Soap* server,bool def_values) _rci__RemoteControlResponse response; // example values - uint8 *command = new uint8(Reset); + uint8 *command = new uint8(icommand); uint32 *ianaOemNumber = new uint32(IntelIanaNumber); uint8 *specialCommand = NULL; //none uint16 *oemParameter = NULL; //none