Package SampleUdpDevice
Class Device
java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposBaseDevice
de.gmxhome.conrad.jpos.jpos_base.JposDevice
SampleUdpDevice.Device
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
BeltCashboxDrawer
,Biometrics
JposDevice based implementation base for JavaPOS device service implementations for the
sample device implemented in SampleUdpDevice.tcl. It implements methods, properties and interfaces that
can be used for server class implementations.
All frames have variable length and start with a SUBDEV:Function where SUBDEV is a sub-device specific id (e.g.
DRAWER) and Function the name of a sub-device specific function to be processed. The corresponding response starts
with the same SUBDEV:Function pair.
Communication will be made with UDP sockets.
Multiple commands can be sent in a single frame, separated by comma (,). The corresponding responses will
be sent in one frame, separated by comma as well.
Here a full list of all device specific properties that can be changed via jpos.xml:
- MaxRetry: Specifies the maximum number of retries. Default: 2.
- OwnPort: Integer value between 0 and 65535 specifying the UDP port used for communication with the device simulator. Default: 0 (for random port number selected by operating system).
- PollDelay: Minimum time between status requests, in milliseconds. Status requests will be used to monitor the device state. Default: 200.
- Port: Operating system specific name of the UDP address to be used for communication with the device simulator. Names are of the form IPv4:port, where IPv4 is the IP address of the device and port its UDP port.
- RequestTimeout: Maximum time, in milliseconds, between sending a command to the simulator and getting the first byte of its response. Default: 200.
- UseClientIO: Specifies whether UdpClientIOProcessor or UdpIOProcessor shall be used for communication. If true, UdpClientIOProcessor will be used, otherwise UdpIOProcessor. Default: true.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
Class used to check whether command and return parameters are correct. -
Field Summary
FieldsModifier and TypeFieldDescriptionList of ReturnValueCheckers to be used by a specific device implementation for the UDP sampleFields 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
checkProperties(jpos.config.JposEntry entry)
Checks whether a JposEntry belongs to a predefined property value an if so, sets the corresponding driver valuevoid
run()
protected String
Sends a single command to the device and returns the response on success.protected String[]
Sends multiple commands to the device and returns the responses on success.Methods 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, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, checkScannerInit, coinAcceptorInit, coinDispenserInit, deviceMonitorInit, electronicJournalInit, electronicValueRWInit, fiscalPrinterInit, gateInit, gestureControlInit, getArrayOf, getBeltProperties, getBillAcceptorProperties, getBillDispenserProperties, getBiometricsProperties, getBumpBarProperties, getCashChangerProperties, getCashDrawerProperties, getCATProperties, getCheckScannerProperties, getCoinAcceptorProperties, getCoinDispenserProperties, getDeviceMonitorProperties, getElectronicJournalProperties, getElectronicValueRWProperties, getFiscalPrinterProperties, getGateProperties, getGestureControlProperties, getGraphicDisplayProperties, getHardTotalsProperties, getImageScannerProperties, getIndividualRecognitionProperties, getItemDispenserProperties, getKeylockProperties, getLightsProperties, getLineDisplayProperties, getMICRProperties, getMotionSensorProperties, getMSRProperties, getPINPadProperties, getPointCardRWProperties, getPOSKeyboardProperties, getPOSPowerProperties, getPOSPrinterProperties, getRemoteOrderDisplayProperties, getRFIDScannerProperties, getScaleProperties, getScannerProperties, getSignatureCaptureProperties, getSmartCardRWProperties, getSoundPlayerProperties, getSoundRecorderProperties, getSpeechSynthesisProperties, getToneIndicatorProperties, 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
-
Field Details
-
Toolsets
List of ReturnValueCheckers to be used by a specific device implementation for the UDP sample
-
-
Constructor Details
-
Device
Constructor. id specifies the server to be connected in format host:port.- Parameters:
id
- IPv4 target address and port
-
-
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
-
sendResp
Sends a single command to the device and returns the response on success. In case of a recoverable error, maximum MaxRetry to send the command will be made.- Parameters:
command
- Command to be sent to the device.- Returns:
- Return parameters of the response on success, otherwise null.
-
sendResp
Sends multiple commands to the device and returns the responses on success. In case of a recoverable error, maximum MaxRetry to send the commands will be made.
On success, the response values will be returned within a String array of the same length as the array of commands passed as method parameter.- Parameters:
commandParts
- Array of commands to be sent to the device.- Returns:
- Array of return parameters of the corresponding responses on success, otherwise null.
-
run
public void run()
-