Android SSP API
Android SSP API
Version 0.0.3
Android SSP API
Contents
Version History........................................................................................................................................ 3
Introduction ............................................................................................................................................ 4
Description .............................................................................................................................................. 5
Serial Communications ........................................................................................................................... 6
Use ...................................................................................................................................................... 7
API functions ........................................................................................................................................... 8
SetAddress .......................................................................................................................................... 8
DisableDevice ...................................................................................................................................... 8
EnableDevice ....................................................................................................................................... 8
EscrowMode ....................................................................................................................................... 9
SetBillEscrowAction ............................................................................................................................ 9
SetESSPMode .................................................................................................................................... 10
SetBarcodeConfig.............................................................................................................................. 10
SetPayoutRoute ................................................................................................................................ 11
PayoutAmount .................................................................................................................................. 11
FloatAmount ..................................................................................................................................... 12
EmptyPayout ..................................................................................................................................... 12
GetDownloadState ............................................................................................................................ 13
GetComsConfig ................................................................................................................................. 14
SetComsBufferWritten...................................................................................................................... 15
GetNewData...................................................................................................................................... 15
ProcessResponse............................................................................................................................... 15
SetDownload ..................................................................................................................................... 16
GetBillPositions ................................................................................................................................. 17
BillPayoutAction ................................................................................................................................ 17
Version 0.0.3
Android SSP API
Version History
Version 0.0.3
Android SSP API
Introduction
This document describes the ITL sspcom.jar library for use with android applications.
Version 0.0.3
Android SSP API
Description
The library is supplied as a sspcoms.jar file and the SDK includes an Android Studio™
example application to demonstrate its use.
The library provides an API of functions and parameters to allow the system programmer to
connect, control and read events from a ITL SSP devices.
The user creates an object of the SSPSystem class, sets some initial parameters and event
listeners and provides a method to pass the communications buffers to and from the object.
Version 0.0.3
Android SSP API
Serial Communications
To abstract the serial communications hardware and handers away from the API, the
SSPSystem use a polling and flag method to allow the serial information to be transmitted
from and received to the object for processing.
The final implementation of this is up to the developer but it is suggested that a thread
handler loop is employed to handle this
See the example Android Studio implementations for full details of how to use the library.
Version 0.0.3
Android SSP API
Use
ssp object
ssp parameters
UI Commands
Run
Stop
Device Events Enable
New Setup Disable
Disconnection
Escrow
Device Events Escrow Accept
Payout Events Escrow Reject
File Update Events Payout
Float
Empty
Route
Barcode Config
Set Download
UI Activity
Version 0.0.3
Android SSP API
API functions
SetAddress
Function void SetAddress(int address)
Return none
DisableDevice
Function void DisableDevice()
Description A command to disable the device for Bill entry after start-up
Parameters none
Return none
EnableDevice
Function void EnableDevice()
Description A command to re-enable the device for Bill entry after a DisableDevice()
command has been sent;
Parameters none
Return none
Version 0.0.3
Android SSP API
EscrowMode
Function void EscrowMode(boolean mode)
Return none
SetBillEscrowAction
Function void SetBillEscrowAction(BillAction action)
Default none
Version 0.0.3
Android SSP API
SetESSPMode
Function void SetESSPMode
Return none
SetBarcodeConfig
Function void SetBarCodeConfig
Return none
Version 0.0.3
Android SSP API
SetPayoutRoute
Function void SetPayoutRoute
Default none
Return none
PayoutAmount
Function void PayoutAmount
Default none
Return none
Version 0.0.3
Android SSP API
FloatAmount
Function void FloatAmount
Default none
Example use //float to GBP 30.00 leaving a min payment of GBP 5.00
ItlCurrency cur = new IitlCurrency();
cur.country = “GBP”;
cur.value = 3000;
ItlCurrency curmin = new IitlCurrency();
curmin.country = “GBP”;
curmin.value = 500;
ssp.FloatAmount(cur,curmin);
Return none
EmptyPayout
Function void EmptyPayout
Parameters none
Default none
Return none
Version 0.0.3
Android SSP API
GetDownloadState
Function DownloadSetupState GetDownloadState()
Parameters none
Default DownloadSetupState.idle
Version 0.0.3
Android SSP API
GetComsConfig
Function SSPComsConfig GetComsConfig()
Description returns the coms config object to allow changes to be made to baud
rates etc.
Parameters none
Default The coms is set to 9600 bd with np parity, two stop bits with flow
control none at start-up by default
Example use SSPComsConfig cfg = ssp.GetComsConfig();
public SSPComsConfig(){
configUpdate = ComsConfigChangeState.ccIdle;
}
Version 0.0.3
Android SSP API
SetComsBufferWritten
Function void SetComsBufferWritten(boolean cr)
Description Sets or clears a flag to show object that system has written bhytes to
communciations buffer
Parameters cr: Boolean, true buffer has been written, false buffer has not been
wrriten
Default none
Return none
GetNewData
Function int GetNewData(byte[] data)
Description Call from the loop thread handle to poll the SSPSystem object for any
data that needs to be transmitted.
Parameters data: byte array ref to copy the data into . When downloading this needs
to be a 4K (4096 byte) buffer.
Default none
Example use int ret = ssp.GetNewData(new byte[] data[]); // enable for escrow mode
ProcessResponse
Function void ProcessResponse(byte[] data, int length)
Description Send any received bytes to this function so the SSPSystem object can
decode the responses;
Parameters data: byte array of coms response buffer, length: the length of the data
in the buffer
Default none
Return none
Version 0.0.3
Android SSP API
SetDownload
Function boolean SetDownload(SSPUpdate update)
Description Sets the update class to the SSPSystem class reference and initiate the
download process
Parameters SSPUpdate object populated with update file information
Default none
Example use
SSPUpdate sspUpdate = new SSPUpdate(flname);
// path = full file path string
final File up = new File(path);
// init the object data array
sspUpdate.fileData = new byte[(int) up.length()];
Version 0.0.3
Android SSP API
GetBillPositions
Function ArrayList<ItlCurrencyValue> GetStoredBillPositions()
Description For NoteFloat (NV11,CBA11) only. Returns a list showing the order of
bills stored in the device.
Parameters none
Default none
BillPayoutAction
Function BillPayoutAction(BillActionRequest request);
Description For NoteFloat (NV11,CBA11) only. Stacks or Payout the last bill in the
note float store.
Parameters BillActionRequest.Stack :- stacks the bill.
BillActionRequest.Payout :- pays out the bill.
Default none
Return none
Version 0.0.3