class Memopri::Printer

Public Class Methods

new(host, port=16402) click to toggle source
# File lib/memopri/printer.rb, line 8
def initialize(host, port=16402)
  @hostname = host
  @port = port
  @socket = TCPSocket.open(@hostname, @port)
end

Public Instance Methods

_recv(len) click to toggle source
# File lib/memopri/printer.rb, line 20
def _recv(len)
  return @socket.read(len)
end
_send(cmd) click to toggle source
# File lib/memopri/printer.rb, line 14
def _send(cmd)
  cmd = cmd.pack('C*')
  @socket.write(cmd)
  @socket.flush()
end
print(data) click to toggle source