Class: Driver::Posiflex::Aura80

Inherits:
Extface::Driver::Base::Print
  • Object
show all
Includes:
Extface::Driver::Posiflex::AuraCommands
Defined in:
app/models/extface/driver/posiflex/aura80.rb

Constant Summary collapse

NAME =
'Posiflex (Aura 80mm)'.freeze
DEVELOPMENT =

driver is not ready for production (not passing all tests or has major bugs)

true
CHAR_COLUMNS =
49

Instance Method Summary collapse

Instance Method Details

#autocut(partial = true) ⇒ Object



17
18
19
20
# File 'app/models/extface/driver/posiflex/aura80.rb', line 17

def autocut(partial = true)
  push "\r\n\r\n\r\n"
  push Printer::PAPER_CUT
end

#check_statusObject



22
23
24
25
26
27
28
29
30
31
32
# File 'app/models/extface/driver/posiflex/aura80.rb', line 22

def check_status
  flush
  push Info::GET_PAPER_STATUS
  if status = pull(3) #wait 3 sec for data
    human_status_errors(status)
    return errors.empty?
  else
    errors.add :base, "No data received from device"
    return false
  end
end

#handle(buffer) ⇒ Object



11
12
13
14
15
# File 'app/models/extface/driver/posiflex/aura80.rb', line 11

def handle(buffer)
  #expecting only 1 status byte, move it to receive_buffer
  rpush buffer
  return buffer.length # return number of bytes processed
end