Sha256: 7f361bf1b4df3d15b2e16cd2102a80683ccfa321e72c8c066e262c9b6616bdb1
Contents?: true
Size: 1.01 KB
Versions: 17
Compression:
Stored size: 1.01 KB
Contents
module Extface class Driver::Posiflex::Aura80 < Extface::Driver::Base::Print NAME = 'Posiflex (Aura 80mm)'.freeze DEVELOPMENT = true #driver is not ready for production (not passing all tests or has major bugs) CHAR_COLUMNS = 49 include Extface::Driver::Posiflex::AuraCommands def handle(buffer) #expecting only 1 status byte, move it to receive_buffer rpush buffer return buffer.length # return number of bytes processed end def autocut(partial = true) push "\r\n\r\n\r\n" push Printer::PAPER_CUT end 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 private def human_status_errors(status_byte) errors.add :base, "Paper out" unless (status_byte.ord & 0x0C).zero? end end end
Version data entries
17 entries across 17 versions & 1 rubygems