
Originally Posted by
GregBrannon
I doubt that it's possible to create a program that will interface correctly with ALL POS devices.
Well I'm not too sure and that is why I need let say a structure of how to normally do this. By referring to jpos I saw that they use a variable "LogicalDeviceName" but since I've never worked with device controlling before I'm having a problem on tracing the right files in jpos but I think jpos is capable of doing so, meaning of controlling any device because I think it first check the firmware of that particular device and assign its name to the variable "LogicalDeviceName" the structure for this in jpos if I will only look at BaseControl file goes as follows but I will only quote what looks like what I want in this file.
// This is for a file named BaseJposControl public String getPhysicalDeviceName() throws JposException { // Make sure control is opened if(!bOpen) { throw new JposException(JposConst.JPOS_E_CLOSED, "Control not opened"); } try { return service.getPhysicalDeviceName(); } catch(JposException je) { throw je; } catch(Exception e) { throw new JposException(JposCosnt.JPOS_E_FAILURE, "Unhandled exception from Device Service", e); } } // Now the file BaseControl has the properties and methods which has implementation in BaseJposControl, I will look at the method directIO. // BaseControl public void directIO(int command, int[] data, Object object) throws JposException; // BaseJposControl public void directIO(int command, int[] data, Object object) throws JposException { // Make sure control is opened if(!bOpen) { throw new JposException(JposConst.JPOS_E_CLOSED, "Control not opened"); } // Perform the operation try { service.directIO(command, data, object); } catch(JposException je) { throw je; } catch(Exception e) { throw new JposException(JposConst.JPOS_E_FAILURE, "Unhandled exception from Device Service", e); } } Now I did try to use the jpos but all the files which have service111 have error on their very first public line so I couldn't use it then but I tried to take the files like BaseControl, BaseJposControl, JposConst, etc. But the problem now is to use them in my own class I don't know how to because they have many files which need to be loaded so that they won't be any errors on a new project which I've used using the source found in the link on my very first post so that is why I was looking for a structure of communicating with the device so that I can be able to identify on these files the file that I can call or use in my class that will call the class to perform the desired task or send direct command to the device.
Thank you.