class Evolis::PremiumSdk::Cmd

Constants

TIMEOUT

Default timeout for CMD service

Public Class Methods

new(host, port) click to toggle source

Initializes the class and sets SDK host and port

@param host [String] host or IP for SDK @param port [String, Fixnum] port for SDK

Calls superclass method
# File lib/evolis/premium_sdk/cmd.rb, line 13
def initialize(host, port)
  super(host, port, 'CMD')
end

Public Instance Methods

get_status(device) click to toggle source

Retrieves the binary status of a device

@param device [String] printer name @return [String] binary status of the device, see SDK document

# File lib/evolis/premium_sdk/cmd.rb, line 35
def get_status(device)
  call_rpc('GetStatus', {
      device: device
  })
end
reset_com(device, timeout = TIMEOUT) click to toggle source

Reset communications with a device

@param device [String] printer name @param timeout [String] communication timeout @return [true] if reset successful

# 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) click to toggle source

Sends commands in text or binary format

@param device [String] printer name @param command [String] command, in clear text or base64-encoded format @param timeout [String] communication timeout @return [String] response to the sent command

# 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