Class: AMT::Service::RemoteControl
- Defined in:
- lib/amt/service/remote_control.rb,
lib/amt/service/remote_control/structures.rb
Overview
AMT service for getting information about the current power state of the system managed by the AMT device and for controlling its power and booting state.
Defined Under Namespace
Classes: BootOptions, IntelSpecialCommandParameter, OemDefinedCapabilities, OemParameters, RemoteControlCapabilities, RemoteControlCommand, SpecialCommand, SpecialCommandsSupported, SystemCapabilitiesSupported, SystemFirmwareCapabilities, SystemPowerState
Instance Attribute Summary
Attributes inherited from Basic
Instance Method Summary collapse
-
#get_remote_control_capabilities ⇒ Object
Return the remote control capabilities supported by the device as instance of the RemoteControlCapabilities class.
-
#get_system_power_state ⇒ Object
Return the current power state of the device as instance of the SystePowerState class.
-
#remote_control(command, iana_number = 343, options = {}) ⇒ Object
Control the boot and power state of the device.
Methods inherited from Basic
Constructor Details
This class inherits a constructor from AMT::Service::Basic
Instance Method Details
#get_remote_control_capabilities ⇒ Object
Return the remote control capabilities supported by the device as instance of the RemoteControlCapabilities class.
Supported by AMT 1.0 and later.
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/amt/service/remote_control.rb', line 19 def get_remote_control_capabilities() soap_call("GetRemoteControlCapabilities", 'Status').process do |node| rcp = RemoteControlCapabilities.new rcp.iana_oem_number = node.xpath('./ns:IanaOemNumber/text()').to_i rcp.oem_defined_capabilities = OemDefinedCapabilities.new(node.xpath('./ns:OemDefinedCapabilities/text()').to_i) rcp.special_commands_supported = SpecialCommandsSupported.new(node.xpath('./ns:SpecialCommandsSupported/text()').to_i) rcp.system_capabilities_supported = SystemCapabilitiesSupported.new(node.xpath('./ns:SystemCapabilitiesSupported/text()').to_i) rcp.system_firmware_capabilities = SystemFirmwareCapabilities.new(node.xpath('./ns:SystemFirmwareCapabilities/text()').to_i) rcp end end |
#get_system_power_state ⇒ Object
Return the current power state of the device as instance of the SystePowerState class.
Supported AMT 1.0 and later.
35 36 37 38 39 |
# File 'lib/amt/service/remote_control.rb', line 35 def get_system_power_state() soap_call("GetSystemPowerState", 'Status').process do |node| SystemPowerState.new(node.xpath('./ns:SystemPowerState/text()').to_i) end end |
#remote_control(command, iana_number = 343, options = {}) ⇒ Object
Control the boot and power state of the device.
command
-
The command that should be executed (instance of RemoteControlCommand).
iana_number
-
The IANA-assigned Enterprise Number specifying the execution context. Default value of
343
is Intel IANA, also possible is 4542 (ASF IANA). options
-
A hash specifying optional control options. See more below.
The options
hash can be used to these provide additional options:
:special_command
-
Define a modification of the boot behaviour (instance of SpecialCommand).
:special_command_parameter
-
Parameter for special command. Has to be an Integer.
:boot_options
-
Array of boot option names or an instance of BootOptions
:oem_parameters
-
Additional OEM parameters (instance of OemParameter).q
Supported AMT 1.0 and later.
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/amt/service/remote_control.rb', line 58 def remote_control(command, iana_number = 343, = {}) soap_call("RemoteControl", 'Status') do |msg| msg.add('ns:Command', RemoteControlCommand.for(command).value) msg.add('ns:IanaOemNumber', iana_number) msg.add('ns:SpecialCommand', SpecialCommand.for([:special_command]).value) if .has_key?(:special_command) msg.add('ns:SpecialCommandParameter', [:special_command_parameter]) if .has_key?(:special_command_parameter) msg.add('ns:BootOptions', BootOptions.new([:boot_options]).value) if .has_key?(:boot_options) msg.add('ns:OemParameter', OemParameter.for([:oem_parameters])) if .has_key?(:oem_parameter) end.process end |