Epson Fiscal Driver Specification
Epson Fiscal Driver Specification
SPECIFICATION
EPSON FISCAL DRIVER
1 INTRODUCTION ............................................................................................................................................................................... 6
2 LIBRARIES ....................................................................................................................................................................................... 7
6 EXAMPLES..................................................................................................................................................................................... 21
EPSON FISCAL DRIVER
1 Introduction
2 Libraries
3 Installation
3.1 Linux
Static Linking – Just link the lib (.a file) during the application building process.
Dynamic Linking – Link and distribute the lib (.so file) with your executable file.
3.2 Windows
Install the drivers package running EpsonFiscalDriverInstaller.exe
After that, OCX can be referenced and used by the application.
The dynamic/static libraries (DLL and LIB) are used by the application in the same way as Linux ones.
Note that, in all cases, EpsonFiscalDriverInstaller.exe should also be installed in the PC where the application is
executed.
3.3 Android
In your project add EpsonFiscalDriver.aar as dependencies and after that can be imported and used by the
application.
This is a mandatory import: import epson.epsonfiscaldriver.EpsonFiscalDriver.
EPSON FISCAL DRIVER
4 Code Error
5 Programming Interface
Name: ComPort
Access: Read/Write
Input: Integer
Output: Integer
5.3.3 Notes
Windows
The value of the port can be: 0=USB, 1=Com1, 2=Com2…
Linux
The value of the port can be: 0=USB, 1=/dev/tty/S0 or /dev/ttyUSB0, 2=/dev/ttyS1 or /dev/ttyUSB1
5.5.3 Notes
Set the value to “0” to use the Compatible protocol
Set the value to “1”to use Extended protocol
Set the value to “2” to use HTTP protocol
Set the value to “3” to use HTTPS protocol
5.6 State
Gets the current control state.
5.6.1 DLL
Prototype: getState( void );
5.6.2 OCX
Access method: Property
Name: State
Access: Read only
Output: Integer
5.6.3 Notes
Close=0, Idle=1, Busy=2
5.7 LastError
Gets the last control error.
5.7.1 DLL
Prototype: int getLastError( void );
5.7.2 OCX
Access method: Property
Name: State
Access: Read only
Output: Integer
5.7.3 Notes
Check the error codes table.
5.8 FiscalStatus
Gets the last fiscal status.
5.8.1 DLL
Prototype: int getFiscalStatus( void );
EPSON FISCAL DRIVER
5.8.2 OCX
Access method: Property
Name: FiscalStatus
Access: Read only
Output: Integer
5.9 PrinterStatus
Get the last printer status.
5.9.1 DLL
Prototype: int getPrinterStatus( void );
5.9.2 OCX
Access method: Property
Name: PrinterStatus
Access: Read only
Output: Integer
5.10 ReturnCode
Get the last command’s return code.
5.10.1 DLL
Prototype: getReturnCode( void );
5.10.2 OCX
Access method: Property
Name: ReturnCode
Access: Read only
Output: Integer
5.14.1 DLL
Prototype: void ReOpenPortByName( char *portname );
5.14.2 OCX
Access method: Method
Name: ReOpenPortByName
Input: OLE String
Output: Nothing
5.14.3 Notes:
The DLL/OCX is a thread safe control. Use this method if your application requires than multiplex threads to
access the same fiscal printer communication port
5.23.2 OCX
Access method: Property
Name: ReceivedFrame
Input: Nothing
Output: OLE String
5.25 POST
Send POST request
5.25.1 DLL
Prototype: void SendPostRequest( char *uri, char *body );
5.25.2 OCX
Access method: Method
Name: SendPostRequest
Input: OLE Strings
Output: Nothing
5.25.3 Notes:
This method is valid only in the HTTP/S protocols
5.26 GET
Send GET request
5.26.1 DLL
Prototype: void SendGetRequest( char *uri, char *query_string );
EPSON FISCAL DRIVER
5.26.2 OCX
Access method: Method
Name: SendGetRequest
Input: OLE Strings
Output: Nothing
5.26.3 Notes:
This method is valid only in the HTTP/S protocols
5.31.3 Notes:
This method is valid only in the HTTP/S protocols.
5.32 getPermission
This method returns a string with information about device and request a permission to use USB port. It is only available in
ANDROID.
5.32.1 AAR
Prototype: String getPermission( void );
Input: Nothing
Output: String
5.32.2 Notes:
The device must have a USB host( check in specification device ). Use the function getUSBHostPort to check it.
The function getPermission is mandatory and must to be used before the function OpenPort. After execution will be
appears a dialog box. Press “OK” to allow the use of USB port.
5.33 getUSBHostPort
This method checks if device has a USB Host. It is only available in ANDROID.
5.33.1 AAR
Prototype: getUSBHostPort( void );
Input: Nothing
Output: Boolean
5.33.2 Notes:
True – device has a USB host, otherwise False
6 Examples
Code examples can be found into the .\Examples folder, showing the use of the methods and properties. It is very
important to correctly check the return codes and exceptions.