TC2 for JavaPOS (JPOS)

This page is intended for POS application developers who intend to integrate the TC2 (Tiliter Camera 2) into their application using a JavaPOS Driver (also referred to as “JPOS")

JavaPOS (JPOS) Driver for TC2

Windows 32-bit

FileDescriptionDownload URLVersionRelease date
JAR fileThis is the JPOS driver librarytc2-jpos-driver-1.0.jar1.011/Dec/24
DLLsThe DLLs are the dependencies of the JPOS library.tc2-jpos-driver-libs-windows-x86.zip1.011/Dec/24

Driver interface

This driver implements a subset of the JPOS ImageScanner interface. The list of methods implemented is as follows:

public void claim(int timeout)
Establishes a connection to the camera until release is called. timeout is not used. The camera is found using its USB VID (Vendor ID) and PID (Product ID). These are VID=0xEBA4 and PID=0x1303. If no free USB device is connected with these IDs, then connection will fail and a log message will be logged.

void setIlluminateMode(boolean mode)
If mode is true will enable the lights, else will disable the lights.

boolean getIlluminateMode()
Will return the current state of the lights: true if enabled and false if disabled.

public byte[] getFrameData()
Capture a single frame from the camera and return the data as a flattened bitmap in a byte array.

public boolean getCapIlluminate()
This will always return true.

public boolean getCapImageData()
This will always return true.

public void release()
Disconnect from the camera and free all associated resources.


Example Java Implementation

This is a small Java program that when executed will toggle the TC2 lights on and off several times, and then capture one frame from the camera.

Note: you’ll need to update pom.xml with the path to the tc2-jpos-driver JAR file.

Windows 32-bit

FileDescriptionDownload URLVersionRelease date
Example codeThis is a small Java program that when executed will toggle the lights on and off several times, and then capture one frame from the camera.stolmen-sample_jpos_client-e2866a3b1bd5.zip1.011/Dec/24

Instructions for Implementation using the Example

Step 1: Download artifacts

Download the artifacts from above (JPOS Driver & Example Code) for your target operating system.


Step 2: Modify example code

Update the pom.xml from the example code, with the path to the tc2-jpos-driver JAR file


Step 3: Add Maven Dependencies

<dependency>
	<groupId>com.tiliter</groupId>
	<artifactId>tc2-jpos-driver</artifactId>
	<version>1.0</version>
	<scope>system</scope>  
	<systemPath>
		PATHTOJAR/tc2-jpos-driver-1.0.jar
	</systemPath>
</dependency>

See the pom.xml file of the example code.


Step 4: Make DLL files discoverable

Move the DLL files provided to somewhere in disk. We recommend to avoid C:\Windows\System32 as this may not be accessible by default. Select a location the application will have read/write access to, example: C:\my_driver_location, then copy the DLLs into there as follows:

### C:\my_driver_location
|-- pthreadVC2.dll
`-- win32-x86
    `-- libuvc.dll

The result:

>> cd c:\my_driver_location
>> dir
10/12/2024  05:12 PM    <DIR>          .
09/12/2024  01:55 PM            55,808 pthreadVC2.dll
10/12/2024  05:12 PM    <DIR>          win32-x86
>> cd win32-x86
10/12/2024  05:12 PM    <DIR>          .
10/12/2024  05:12 PM    <DIR>          ..
09/12/2024  01:40 PM           204,800 libuvc.dll

Then add the following JVM arguments so that these DLLs can be found:

-Djava.library.path=C:\my_driver_location
-Djna.platform.library.path=C:\my_driver_location\win32-x86

Step 5: Add the Tiliter Camera device to the list of JPOS devices in jpos.xml

See the pom.xml file of the example code. The new entry should look something like this:

<JposEntry logicalName="tiliterCamera">
    <creation factoryClass="com.tiliter.tc2_jpos_driver.TiliterCameraDriverInstanceFactory" serviceClass="com.tiliter.tc2_jpos_driver.TiliterCameraService"/>
    <vendor name="Tiliter Pty Ltd" url="http://www.tiliter.com"/>
    <jpos category="ImageScanner" version="114"/>
    <product description="Tiliter camera 2" name="Tiliter camera 2" url="http://www.javapos.com"/>        
</JposEntry>