Package SampleCombiDevice
Class Device
java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposBaseDevice
de.gmxhome.conrad.jpos.jpos_base.JposDevice
SampleCombiDevice.Device
- All Implemented Interfaces:
Runnable
Base of a JposDevice based implementation of JavaPOS CashDrawer, Keylock, LineDisplay,MSR, POSKeyboard, Scanner and
ToneIndicator device service implementations for the sample device implemented in CombiSim.tcl.
For a complete list of possible commands and responses, look at the comments at the beginning of the device simulator script.
For a complete list of possible commands and responses, look at the comments at the beginning of the device simulator script.
Here a full list of all device specific properties that can be changed via jpos.xml:
- Baudrate: Baud rate of the communication device. Must be one of the baud rate constants specified in the
SerialIOProcessor class. Default: 9600 (SerialIOProcessor.BAUDRATE_9600).
This property may only be set if the communication with the device shall be made via serial port. - BinaryEKey: This property specifies whether the service shall convert electronic key values. If false, electronic key values will be passed to the application as received from the simulator: as a series of ASCII codes representing hexadecimal values ('0' - '9', 'A' - 'F'). If true, electronic key values will be converted to byte values before passing them to the application. Default: true.
- CharacterTimeout: Positive integer value, specifying the maximum delay between bytes that belong to the same frame. Default value: 10 milliseconds.
- ComPort: Operating system specific name of the serial communication port (e.g. RS232, Usb2Serial, Bluetooth...) or the TCP address to be used for communication with the device simulator. In case of RS232, names look typically like COM2 or /dev/ttyS1. In case of TCP, names are of the form IPv4:port, where IPv4 is the IP address of the device and port its TCP port.
- Databits: Number of data bits per data unit. Must be 7 or 8. Default: 8. It is strictly recommended to let
this value unchanged.
This property may only be set if the communication with the device shall be made via serial port. - LoggingType: Specifies the logging format used by the IO processor. Must be one of the logging type values specified in the UniqueIOProcessor class. Default: 1 (UniqueIOProcessor.LoggingTypeEscapeString).
- MaxRetry: Specifies the maximum number of retries. Should be > 0 only for RS232 (real COM ports) where characters can become lost or corrupted on the communication line. Default: 2.
- OwnPort: Integer value between 0 and 65535 specifying the TCP port used for communication with the device
simulator. Default: 0 (for random port number selected by operating system).
This property may only be set if the communication with the device shall be made via TCP. - Parity: Parity of each data unit. Must be one of the parity constants specified in the
SerialIOProcessor class. Default: 0 (SerialIOProcessor.PARITY_NONE).
This property may only be set if the communication with the device shall be made via serial port. - PollDelay: Minimum time between status requests, in milliseconds. Status requests will be used to monitor the device state. Default: 50.
- RequestTimeout: Maximum time, in milliseconds, between sending a command to the simulator and getting the first byte of its response. Default: 500.
- Stopbits: Number of stop bits per data unit. Must be 1 or 2. Default: 2.
This property may only be set if the communication with the device shall be made via serial port.
The key values of the keyboard must be configured within the SampleCombiDevice.Device.properties file. It must contain an entry of the form Keyrow-columnValue = keyvalue for every supported key, where row must be the two-digit key row (01 - 10), column must be the two-digit key column (01 - 16) and keyvalue must be the application-specific integer value that specifies that key.
-
Field Summary
Fields inherited from class de.gmxhome.conrad.jpos.jpos_base.JposDevice
Belts, BillAcceptors, BillDispensers, Biometricss, BumpBars, CashChangers, CashDrawers, CATs, CheckScanners, ClaimedBelt, ClaimedBillAcceptor, ClaimedBillDispenser, ClaimedBiometrics, ClaimedBumpBar, ClaimedCashChanger, ClaimedCashDrawer, ClaimedCAT, ClaimedCheckScanner, ClaimedCoinAcceptor, ClaimedCoinDispenser, ClaimedDeviceMonitor, ClaimedElectronicJournal, ClaimedElectronicValueRW, ClaimedFiscalPrinter, ClaimedGate, ClaimedGestureControl, ClaimedGraphicDisplay, ClaimedHardTotals, ClaimedImageScanner, ClaimedIndividualRecognition, ClaimedItemDispenser, ClaimedKeylock, ClaimedLights, ClaimedLineDisplay, ClaimedMICR, ClaimedMotionSensor, ClaimedMSR, ClaimedPINPad, ClaimedPointCardRW, ClaimedPOSKeyboard, ClaimedPOSPower, ClaimedPOSPrinter, ClaimedRemoteOrderDisplay, ClaimedRFIDScanner, ClaimedScale, ClaimedScanner, ClaimedSignatureCapture, ClaimedSmartCardRW, ClaimedSoundPlayer, ClaimedSoundRecorder, ClaimedSpeechSynthesis, ClaimedToneIndicator, ClaimedVideoCapture, ClaimedVoiceRecognition, CoinAcceptors, CoinDispensers, DeviceMonitors, ElectronicJournals, ElectronicValueRWs, FiscalPrinters, Gates, GestureControls, GraphicDisplays, HardTotalss, ImageScanners, IndividualRecognitions, ItemDispensers, Keylocks, Lightss, LineDisplays, MICRs, MotionSensors, MSRs, PINPads, PointCardRWs, POSKeyboards, POSPowers, POSPrinters, RemoteOrderDisplays, RFIDScanners, Scales, Scanners, SignatureCaptures, SmartCardRWs, SoundPlayers, SoundRecorders, SpeechSynthesiss, ToneIndicators, VideoCaptures, VoiceRecognitions
Fields inherited from class de.gmxhome.conrad.jpos.jpos_base.JposBaseDevice
AllowAlwaysSetProperties, AsyncProcessorRunning, CapCompareFirmwareVersion, CapPowerReporting, CapUpdateFirmware, CurrentCommand, DrawerBeepVolume, ID, JposVersion, Log, LogFilePath, LogFilePattern, LoggerFormat, LoggerName, LogLevel, MaxArrayStringElements, MaximumConfirmationEventWaitingTime, PendingCommands, PhysicalDeviceDescription, PhysicalDeviceName, SerialIOAdapterClass, StrictFIFOEventHandling
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
changeDefaults(CashDrawerProperties props)
Change defaults of properties.void
changeDefaults(KeylockProperties props)
Change defaults of properties.void
changeDefaults(LineDisplayProperties props)
Change defaults of properties.void
changeDefaults(MSRProperties props)
Change defaults of properties.void
changeDefaults(POSKeyboardProperties props)
Change defaults of properties.void
changeDefaults(ScannerProperties props)
Change defaults of properties.void
Change defaults of properties.void
checkProperties(jpos.config.JposEntry entry)
Checks whether a JposEntry belongs to a predefined property value an if so, sets the corresponding driver valuegetCashDrawerProperties(int index)
Returns device implementation of CashDrawerProperties.getKeylockProperties(int index)
Returns device implementation of KeylockProperties.getLineDisplayProperties(int index)
Returns device implementation of LineDisplayProperties.getMSRProperties(int index)
Returns device implementation of MSRProperties.getPOSKeyboardProperties(int index)
Returns device implementation of POSKeyboardProperties.getScannerProperties(int index)
Returns device implementation of ScannerProperties.getToneIndicatorProperties(int index)
Returns device implementation of ToneIndicatorProperties.void
run()
Thread main, used for status check loop while device is opened.protected Byte
sendCommand(byte[] request, byte responseType)
Method to perform any commandMethods inherited from class de.gmxhome.conrad.jpos.jpos_base.JposDevice
beltInit, billAcceptorInit, billDispenserInit, biometricsInit, bumpBarInit, cashChangerInit, cashDrawerInit, cATInit, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, checkScannerInit, coinAcceptorInit, coinDispenserInit, deviceMonitorInit, electronicJournalInit, electronicValueRWInit, fiscalPrinterInit, gateInit, gestureControlInit, getArrayOf, getBeltProperties, getBillAcceptorProperties, getBillDispenserProperties, getBiometricsProperties, getBumpBarProperties, getCashChangerProperties, getCATProperties, getCheckScannerProperties, getCoinAcceptorProperties, getCoinDispenserProperties, getDeviceMonitorProperties, getElectronicJournalProperties, getElectronicValueRWProperties, getFiscalPrinterProperties, getGateProperties, getGestureControlProperties, getGraphicDisplayProperties, getHardTotalsProperties, getImageScannerProperties, getIndividualRecognitionProperties, getItemDispenserProperties, getLightsProperties, getMICRProperties, getMotionSensorProperties, getPINPadProperties, getPointCardRWProperties, getPOSPowerProperties, getPOSPrinterProperties, getRemoteOrderDisplayProperties, getRFIDScannerProperties, getScaleProperties, getSignatureCaptureProperties, getSmartCardRWProperties, getSoundPlayerProperties, getSoundRecorderProperties, getSpeechSynthesisProperties, getVideoCaptureProperties, getVoiceRecognitionProperties, graphicDisplayInit, hardTotalsInit, imageScannerInit, individualRecognitionInit, itemDispenserInit, keylockInit, lightsInit, lineDisplayInit, mICRInit, motionSensorInit, mSRInit, noOfPropertySets, pINPadInit, pointCardRWInit, pOSKeyboardInit, pOSPowerInit, pOSPrinterInit, remoteOrderDisplayInit, rFIDScannerInit, scaleInit, scannerInit, signatureCaptureInit, smartCardRWInit, soundPlayerInit, soundRecorderInit, speechSynthesisInit, toneIndicatorInit, videoCaptureInit, voiceRecognitionInit
Methods inherited from class de.gmxhome.conrad.jpos.jpos_base.JposBaseDevice
check, checkext, checkMember, checkRange, concurrentProcessingSupported, createConcurrentRequestThread, delay, getClaimingInstance, getCount, getPropertySetInstance, getRequestRunnersRequest, handleEvent, handleEvent, handleEvent, handleEvent, handleEvent, handleEvent, handlePowerStateOnEnable, invokeRequestThread, log, member, member, postDirectIOProcessing, postTransitionProcessing, prepareSignalStatusWaits, processEventList, removePropertySet, signalStatusWaits, stringArrayToLongArray, synchronizedMessageBox
-
Constructor Details
-
Device
Constructor, Stores communication target. Communication target can be a COM port or a TCP target. Valid COM port specifiers differ between operating systems, e.g. on Windows, COM1 can be a valid communication target while on Linux, /dev/ttyS0 might specify the same target. Format of TCP targets is IpAddress:Port, e.g. 10.11.12.13:45678.- Parameters:
port
- COM port or TCP target.- Throws:
jpos.JposException
- if Communication target invalid.
-
-
Method Details
-
checkProperties
public void checkProperties(jpos.config.JposEntry entry) throws jpos.JposExceptionDescription copied from class:JposBaseDevice
Checks whether a JposEntry belongs to a predefined property value an if so, sets the corresponding driver value- Overrides:
checkProperties
in classJposBaseDevice
- Parameters:
entry
- Entry to be checked, contains value to be set- Throws:
jpos.JposException
- if a property value is invalid
-
changeDefaults
Description copied from class:JposDevice
Change defaults of properties. Must be implemented within derived classed that support line display services.- Overrides:
changeDefaults
in classJposDevice
- Parameters:
props
- Property set for setting the propperty defaults
-
changeDefaults
Description copied from class:JposDevice
Change defaults of properties. Must be implemented within derived classed that support cash drawer services.- Overrides:
changeDefaults
in classJposDevice
- Parameters:
props
- Property set for setting the property defaults
-
changeDefaults
Description copied from class:JposDevice
Change defaults of properties. Must be implemented within derived classed that support POS keyboard services.- Overrides:
changeDefaults
in classJposDevice
- Parameters:
props
- Property set for setting the propperty defaults
-
changeDefaults
Description copied from class:JposDevice
Change defaults of properties. Must be implemented within derived classed that support keylock services.- Overrides:
changeDefaults
in classJposDevice
- Parameters:
props
- Property set for setting the propperty defaults
-
changeDefaults
Description copied from class:JposDevice
Change defaults of properties. Must be implemented within derived classed that support magnetic stripe reader services.- Overrides:
changeDefaults
in classJposDevice
- Parameters:
props
- Property set for setting the property defaults
-
changeDefaults
Description copied from class:JposDevice
Change defaults of properties. Must be implemented within derived classed that support scanner services.- Overrides:
changeDefaults
in classJposDevice
- Parameters:
props
- Property set for setting the propperty defaults
-
changeDefaults
Description copied from class:JposDevice
Change defaults of properties. Must be implemented within derived classed that support tone indicator services.- Overrides:
changeDefaults
in classJposDevice
- Parameters:
props
- Property set for setting the property defaults
-
run
public void run()Thread main, used for status check loop while device is opened. -
sendCommand
Method to perform any command- Parameters:
request
- Data to be sentresponseType
- type of response frame (first byte)- Returns:
- null on timeout, Byte(responseType) on success
- Throws:
jpos.JposException
- in error case
-
getCashDrawerProperties
Description copied from class:JposDevice
Returns device implementation of CashDrawerProperties.- Overrides:
getCashDrawerProperties
in classJposDevice
- Parameters:
index
- Device index, see constructor of JposCommonProperties.- Returns:
- Instance of CashDrawerProperties that matches the requirements of the corresponding device service.
-
getKeylockProperties
Description copied from class:JposDevice
Returns device implementation of KeylockProperties.- Overrides:
getKeylockProperties
in classJposDevice
- Parameters:
index
- Device index, see constructor of JposCommonProperties.- Returns:
- Instance of KeylockProperties that matches the requirements of the corresponding device service.
-
getToneIndicatorProperties
Description copied from class:JposDevice
Returns device implementation of ToneIndicatorProperties.- Overrides:
getToneIndicatorProperties
in classJposDevice
- Parameters:
index
- Device index, see constructor of JposCommonProperties.- Returns:
- Instance of ToneIndicatorProperties that matches the requirements of the corresponding device service.
-
getLineDisplayProperties
Description copied from class:JposDevice
Returns device implementation of LineDisplayProperties.- Overrides:
getLineDisplayProperties
in classJposDevice
- Parameters:
index
- Device index, see constructor of JposCommonProperties.- Returns:
- Instance of LineDisplayProperties that matches the requirements of the corresponding device service.
-
getPOSKeyboardProperties
Description copied from class:JposDevice
Returns device implementation of POSKeyboardProperties.- Overrides:
getPOSKeyboardProperties
in classJposDevice
- Parameters:
index
- Device index, see constructor of JposCommonProperties.- Returns:
- Instance of POSKeyboardProperties that matches the requirements of the corresponding device service.
-
getMSRProperties
Description copied from class:JposDevice
Returns device implementation of MSRProperties.- Overrides:
getMSRProperties
in classJposDevice
- Parameters:
index
- Device index, see constructor of JposCommonProperties.- Returns:
- Instance of MSRProperties that matches the requirements of the corresponding device service.
-
getScannerProperties
Description copied from class:JposDevice
Returns device implementation of ScannerProperties.- Overrides:
getScannerProperties
in classJposDevice
- Parameters:
index
- Device index, see constructor of JposCommonProperties.- Returns:
- Instance of ScannerProperties that matches the requirements of the corresponding device service.
-