Class: Evolis::PremiumSdk::Cmd
- Defined in:
- lib/evolis/premium_sdk/cmd.rb
Constant Summary collapse
- TIMEOUT =
Default timeout for CMD service
'3000'
Constants inherited from SdkBase
Instance Attribute Summary
Attributes inherited from SdkBase
Instance Method Summary collapse
-
#get_status(device) ⇒ String
Retrieves the binary status of a device.
-
#initialize(host, port) ⇒ Cmd
constructor
Initializes the class and sets SDK host and port.
-
#reset_com(device, timeout = TIMEOUT) ⇒ true
Reset communications with a device.
-
#send_command(device, command, timeout = TIMEOUT) ⇒ String
Sends commands in text or binary format.
Methods inherited from SdkBase
#active_session?, #call_rpc, #list_settings, #print_setting, #request, #response, #sanitize_parameters, #valid_base64?, #valid_settings?
Constructor Details
#initialize(host, port) ⇒ Cmd
Initializes the class and sets SDK host and port
13 14 15 |
# File 'lib/evolis/premium_sdk/cmd.rb', line 13 def initialize(host, port) super(host, port, 'CMD') end |
Instance Method Details
#get_status(device) ⇒ String
Retrieves the binary status of a device
35 36 37 38 39 |
# File 'lib/evolis/premium_sdk/cmd.rb', line 35 def get_status(device) call_rpc('GetStatus', { device: device }) end |
#reset_com(device, timeout = TIMEOUT) ⇒ true
Reset communications with a device
46 47 48 49 50 51 |
# File 'lib/evolis/premium_sdk/cmd.rb', line 46 def reset_com(device, timeout = TIMEOUT) call_rpc('ResetCom', { timeout: timeout, device: device }) end |
#send_command(device, command, timeout = TIMEOUT) ⇒ String
Sends commands in text or binary format
23 24 25 26 27 28 29 |
# File 'lib/evolis/premium_sdk/cmd.rb', line 23 def send_command(device, command, timeout = TIMEOUT) call_rpc('SendCommand', { command: command, timeout: timeout, device: device }) end |