EAFDSS

 view release on metacpan or  search on metacpan

lib/EAFDSS.pm  view on Meta::CPAN

          my($errNo)  = $dh->error();
          my($errMsg) = $dh->errMessage($errNo);
          printf(STDERR "ERROR [0x%02X]: %s\n", $errNo, $errMsg);
          exit($errNo);
  }

=head2 $dh->SetHeaders

Use this method to set the headers on the device. Provide the headers in the following format:

  Style1/Line1/Style2/Line2/Style3/Line3/Style4/Line4/Style5/Line5/Style6/Line6

  my($result) = $dh->SetHeaders($headers);
  if ( defined $result && ($result == 0)) {
          printf("Headers successfully set\n");
          exit(0);
  } else {
          my($errNo)  = $dh->error();
          my($errMsg) = $dh->errMessage($errNo);
          printf(STDERR "ERROR [0x%02X]: %s\n", $errNo, $errMsg);
          exit($errNo);
  }

=head2 $dh->GetHeaders

Use this method to get the printing headers of the device. The returned array contains 6 couples of values. One for the 
type of the printing line, and one for the actual printing message.

  my(@headersArray) = $dh->GetHeaders();
  if (@headersArray) {
          my($i);
          for ($i=0; $i < 12; $i+=2) {
                  if ($headersArray[$i] ne '') {
                          printf("[Line %d] [Type:%d] --> %s\n", 
				$i/2+1, $headersArray[$i], $headersArray[$i+1]);
                  }
          }
          exit(0);
  } else { 
          my($errNo)  = $dh->error();
          my($errMsg) = $dh->errMessage($errNo);
          printf(STDERR "ERROR [0x%02X]: %s\n", $errNo, $errMsg);
          exit($errNo);
  }

=head1 ERROR Codes

   0x00: No errors - success

   0x01: Wrong number of fields
   0x02: Field too long
   0x03: Field too small
   0x04: Field fixed size mismatch
   0x05: Field range or type check failed
   0x06: Bad request code
   0x09: Printing type bad
   0x0A: Cannot execute with day open
   0x0B: RTC programming requires jumper
   0x0C: RTC date or time invalid
   0x0D: No records in fiscal period
   0x0E: Device is busy in another task
   0x0F: No more header records allowed
   0x10: Cannot execute with block open
   0x11: Block not open
   0x12: Bad data stream
   0x13: Bad signature field
   0x14: Z closure time limit
   0x15: Z closure not found
   0x16: Z closure record bad
   0x17: User browsing in progress
   0x18: Signature daily limit reached
   0x19: Printer paper end detected
   0x1A: Printer is offline
   0x1B: Fiscal unit is offline
   0x1C: Fatal hardware error
   0x1D: Fiscal unit is full
   0x1E: No data passed for signature
   0x1F: Signature does not exist
   0x20: Battery fault detected
   0x21: Recovery in progress
   0x22: Recovery only after CMOS reset
   0x23: Real-Time Clock needs programming
   0x24: Z closure date warning
   0x25: Bad character in stream
   0x01: Device not accessible

   0x41: Device not accessible
   0x42: No such file
   0x43: Device Sync Failed
   0x44: Bad Serial Number
   0x45: Query found no devices
   0x50: File contains invalid characters

=head1 EXAMPLES

Take a look at the examples directory of the distribution for a complete command line utility (OpenEAFDSS.pl) using the
library.

=head1 SUPPORT / WARRANTY

The EAFDSS is free Open Source software. IT COMES WITHOUT WARRANTY OF ANY KIND.

=head1 VERSION

This is version 0.80.

=head1 AUTHOR

Hasiotis Nikos, E<lt>hasiotis@gmail.comE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2008 by Hasiotis Nikos

This library is free software; you can redistribute it and/or modify
it under the terms of the LGPL or the same terms as Perl itself,
either Perl version 5.8.8 or, at your option, any later version of
Perl 5 you may have available.

=cut



( run in 2.546 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )