200-338_0.2 Money Controls CcTalk User Manual

226
MoneyControls ccTalk SDK Software Programmers’ Reference Manual Doc. ref. 200-338_0.1 DRAFT Page 1 of 226 Money Controls ccTalk SDK Software Programmers’ Reference Manual 200-338 0.2 19 Sep 2008 AD CS Part Issue Date Produced Checked Approved

Transcript of 200-338_0.2 Money Controls CcTalk User Manual

Page 1: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 1 of 226

Money Controls

ccTalk SDK

Software Programmers’ Reference Manual

200-338 0.2 19 Sep 2008 AD CS Part Issue Date Produced Checked Approved

Page 2: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 2 of 226

Revision History Version Author Date Notes

0.1 AD 18/08/08 Initial Version based on 200-322-1.1

0.2 AD 19/09/08 Added new information about device variables to application layer;

Added many new application layer API calls.

Page 3: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 3 of 226

© 2007-2008 INNOCORE GAMING LIMITED This document may not be copied, reproduced, translated, transmitted or reduced to any printed or electronic medium or to any machine-readable form, or stored in a retrieval system, either in whole or in part, without the prior written consent of INNOCORE GAMING LTD or one of its subsidiaries. Whilst every effort has been made to ensure the accuracy of this document, Innocore Gaming accepts no responsibility for any errors or omissions contained herein. However, if you do discover any inaccuracy in this document, we would be grateful if you would forward the details by fax to: Design & Development Department Innocore Gaming Ltd.

Contact us at: United Kingdom Innocore Gaming Ltd Innocore House KingFisher Way Silverlink Business Park North Shields NE28 9NX Tel +44 (0) 191 262 4844 Fax +44 (0) 191 263 9287 Email: [email protected] USA Innocore Gaming Ltd., 10400-4 Pioneer Boulevard, Santa Fe Springs, CA 90670 Tel. +1 (562) 941-5000 Fax. +1 (562) 941-5757 Email: [email protected]

Page 4: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 4 of 226

Table of Contents

1 INTRODUCTION .................................................................................................................. 8

1.1 OVERVIEW........................................................................................................................... 8 1.2 INSTALLATION ..................................................................................................................... 8 1.2.1 WINDOWS ........................................................................................................................ 8 1.2.2 LINUX............................................................................................................................... 8 1.3 SDK FILES STRUCTURE ....................................................................................................... 8 1.4 SAMPLE CODE .................................................................................................................... 9

2 GETTING STARTED, FREQUENTLY ASKED QUESTIONS............................................ 10

2.1 PREREQUISITES................................................................................................................. 10 2.2 FILES ................................................................................................................................ 10 2.3 ERROR CODES .................................................................................................................. 10 2.4 USB AND SERIAL CONVERTERS ........................................................................................ 11 2.5 MONEY CONTROLS’ ARDAC ELITE .................................................................................. 11 2.6 FREQUENTLY-ASKED QUESTIONS ...................................................................................... 12 2.6.1 DO I USE THE CCTALK APPLICATION LAYER OR THE CCTALK NATIVE API? ........................ 12 2.6.2 HOW DO I FIND OUT WHICH BILLS/NOTES ARE PROGRAMMED? ....................................... 12 2.6.3 HOW DO I ACCEPT OR DECLINE (REJECT) SPECIFIC NOTES?............................................. 12 2.6.4 HOW DO I PROGRAM THE BILL ACCEPTOR TO (NOT) USE ESCROW-MODE?....................... 13 2.6.5 HOW DO I PROGRAM THE BILL ACCEPTOR TO (NOT) USE THE STACKER? ......................... 13 2.6.6 HOW DO I ACCEPT BARCODES?...................................................................................... 13 2.6.7 HOW CAN I PROGRAM IN A BILL/NOTE TABLE? ................................................................. 14 2.6.8 HOW CAN I PROGRAM IN NEW FIRMWARE?...................................................................... 14 2.6.9 HOW DO I USE ENCRYPTED DATA OR 16-BIT CHECKSUMS FOR MY ARDAC ELITE? ............ 15 2.6.10 MY APPLICATION ALREADY HAS AN EVENT-DRIVEN LOOP: WHAT DO I DO? ..................... 15

3 CCTALK APIS.................................................................................................................... 16

3.1 SYSTEM FUNCTIONS .......................................................................................................... 17 3.1.1 DGSYS_ERROR_TO_TEXT: CONVERT AN ERROR MESSAGE TO A TEXT STRING.................... 17 3.2 CCTALK APPLICATION LAYER ............................................................................................ 18 3.2.1 CCTALK_APP_INIT: INITIALISE APPLICATION LAYER........................................................... 18 3.2.2 DG_CCTALK_APP_EVT_HANDLER: CUSTOMER EVENT HANDLING FUNCTION............ 20 3.2.3 DG_CCTALK_APP_EVT_CODE, DG_CCTALK_APP_EVT_TYPE............................. 23 3.2.4 DG_CCTALK_APP_DEVICE_INFO: DEVICE INFORMATION .......................................... 30 3.2.5 CCTALK_APP_ADD_LINK: ADD A LINK FOR APPLICATION LAYER MONITORING.................... 33 3.2.6 CCTALK_APP_RUN: START THE CCTALK APPLICATION LAYER EVENT-LOOP ...................... 36 3.2.7 CCTALK_APP_FINISH: TERMINATE THE DEVICE MONITORING LOOP................................... 38 3.2.8 CCTALK_APP_GET_DEVICE_INFO: GET A DISCOVERED DEVICE’S INFORMATION ................ 39 3.2.9 CCTALK_APP_ENABLE_DEVICE: ENABLE A DEVICE ........................................................... 41 3.2.10 CCTALK_APP_DISABLE_DEVICE: DISABLE A DEVICE ....................................................... 43 3.2.11 CCTALK_APP_EVENT_NAME: TRANSLATE AN EVENT CODE INTO READABLE TEXT ........... 45 3.2.12 CCTALK_APP_ACCEPT_BILL: ACCEPT A BILL IN ESCROW POSITION................................. 47 3.2.13 CCTALK_APP_REJECT_BILL: REJECT A BILL IN ESCROW POSITION.................................. 49 3.2.14 CCTALK_APP_LOAD_BILL_TABLE: LOAD A NEW BILL TABLE ............................................ 50

Page 5: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 5 of 226

3.2.15 CCTALK_APP_LOAD_FIRMWARE: LOAD NEW DEVICE FIRMWARE..................................... 51 3.2.16 CCTALK_APP_GET_MONEY_IN: RETURN HOW MUCH CURRENCY HAS BEEN ACCEPTED .. 52 3.2.17 CCTALK_APP_CLEAR_MONEY_IN: CLEAR THE ACCOUNT OF MONEY ACCEPTED .............. 54 3.2.18 CCTALK_APP_GET_CURRENCY_REVISION: RETURN AN IDENTIFIER FOR THE CURRENT BILL TABLE 55 3.2.19 CCTALK_APP_GET_NUMBER_BILLS: RETURN HOW MANY BILLS ARE PROGRAMMED........ 57 3.2.20 CCTALK_APP_GET_BILL_INFO: RETURN INFORMATION ON A SPECIFIED BILL ................... 59 3.3 CCTALK NATIVE API: COMMANDS AND REQUESTS............................................................. 61 3.3.1 CCTALK_OPEN_LINK: OPEN LINK CONNECTION................................................................. 61 3.3.2 CCTALK_CLOSE_LINK: CLOSE LINK CONNECTION.............................................................. 63 3.3.3 CCTALK_CMD_SIMPLE_POLL: SIMPLE POLL (254)............................................................. 64 3.3.4 CCTALK_CMD_ADDRESS_POLL: ADDRESS POLL (253) ...................................................... 65 3.3.5 CCTALK_CMD_ADDRESS_CLASH: ADDRESS CLASH (252) ................................................. 66 3.3.6 CCTALK_CMD_ADDRESS_CHANGE: ADDRESS CHANGE (251)............................................ 67 3.3.7 CCTALK_CMD_ADDRESS_RANDOM: ADDRESS RANDOM (250)........................................... 68 3.3.8 CCTALK_REQ_POLLING_PRIORITY: REQUEST POLLING PRIORITY (249) ............................. 69 3.3.9 CCTALK_REQ_STATUS: REQUEST STATUS (248) .............................................................. 71 3.3.10 CCTALK_REQ_VARIABLE_SET: REQUEST VARIABLE SET (247) ........................................ 72 3.3.11 CCTALK_REQ_MANUFACTURE: REQUEST MANUFACTURE ID (246) .................................. 73 3.3.12 CCTALK_REQ_CATEGORY_ID: REQUEST EQUIPMENT CATEGORY ID (245)....................... 74 3.3.13 CCTALK_REQ_PRODUCT_CODE: REQUEST PRODUCT CODE (244)................................... 75 3.3.14 CCTALK_REQ_DATABASE_VERSION: REQUEST DATABASE VERSION (243)....................... 76 3.3.15 CCTALK_REQ_SERIAL_NUMBER: REQUEST SERIAL NUMBER (242) .................................. 77 3.3.16 CCTALK_REQ_SOFTWARE_VERSION: REQUEST SOFTWARE VERSION (241)..................... 78 3.3.17 CCTALK_CMD_TEST_SOLENOIDS: TEST SOLENOIDS (240) .............................................. 79 3.3.18 CCTALK_CMD_TEST_OUTPUT_LINES: TEST OUTPUT LINES (238) .................................... 80 3.3.19 CCTALK_REQ_INPUT_LINES_STATE: READ INPUT LINES (237)......................................... 81 3.3.20 CCTALK_REQ_OPTO_STATE: REQUEST OPTO STATE (236) ............................................. 83 3.3.21 CCTALK_CMD_LATCH_OUTPUT_LINES: LATCH OUTPUT LINES (233) ................................ 84 3.3.22 CCTALK_REQ_SELF_TEST: PERFORM SELF-TEST (232) .................................................. 85 3.3.23 CCTALK_CMD_MODIFY_INHIBIT_STATUS: MODIFY INHIBIT STATUS (231) ......................... 86 3.3.24 CCTALK_CMD_MODIFY_INHIBIT_STATUS_BUFFER: MODIFY INHIBIT STATUS BUFFER (231)88 3.3.25 CCTALK_REQ_INHIBIT_STATUS: REQUEST INHIBIT STATUS (230)..................................... 90 3.3.26 CCTALK_REQ_INHIBIT_STATUS_BUFFER: REQUEST INHIBIT STATUS BUFFER (230) .......... 91 3.3.27 CCTALK_REQ_EVENTS: READ BUFFERED CREDIT OR ERROR CODES (229) ...................... 93 3.3.28 CCTALK_CMD_MASTER_INHIBIT_STATUS :MODIFY MASTER INHIBIT STATUS (228)............ 95 3.3.29 CCTALK_REQ_MASTER_INHIBIT_STATUS :REQUEST MASTER INHIBIT STATUS (227) ......... 96 3.3.30 CCTALK_REQ_INSERTION_COUNT :REQUEST INSERTION COUNT (226)............................ 97 3.3.31 CCTALK_REQ_ACCEPT_COUNT :REQUEST ACCEPT COUNT (225).................................... 98 3.3.32 CCTALK_CMD_MODIFY_SORTER_STATUS: MODIFY SORTER OVERRIDE STATUS (222)...... 99 3.3.33 CCTALK_REQ_SORTER_STATUS: REQUEST SORTER OVERRIDE STATUS (221)............... 101 3.3.34 CCTALK_CMD_CHANGE_PIN_NUMBER: ENTER NEW PIN NUMBER (219) ........................ 102 3.3.35 CCTALK_CMD_ENTER_PIN_NUMBER: ENTER PIN NUMBER (218) .................................. 103 3.3.36 CCTALK_REQ_PAYOUT_LEVEL: REQUEST PAYOUT LEVEL (217) .................................... 104 3.3.37 CCTALK_REQ_DATA_STORAGE_INFO: REQUEST DATA STORAGE AVAILABILITY (216) ..... 105 3.3.38 CCTALK_CMD_READ_DATA_BLOCK :READ DATA BLOCK (215)....................................... 107 3.3.39 CCTALK_CMD_WRITE_DATA_BLOCK :WRITE DATA BLOCK (214).................................... 109 3.3.40 CCTALK_REQ_OPTION_FLAGS :REQUEST OPTION FLAGS (213)..................................... 110 3.3.41 CCTALK_REQ_COIN_POSITION :REQUEST COIN POSITION (212).................................... 112 3.3.42 CCTALK_CMD_MODIFY_SORTER_PATH: MODIFY SORTER PATH (210) ........................... 113 3.3.43 CCTALK_REQ_SORTER_PATH: REQUEST SORTER PATH (209) ...................................... 115 3.3.44 CCTALK_CMD_TEACH_MODE: TEACH MODE CONTROL (202)......................................... 116

Page 6: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 6 of 226

3.3.45 CCTALK_REQ_TEACH_STATUS: REQUEST TEACH STATUS (201) ................................... 117 3.3.46 CCTALK_CMD_CONFIG_TO_EEPROM: CONFIGURATION TO EEPROM (199) .................. 118 3.3.47 CCTALK_CMD_COUNTERS_TO_EEPROM: COUNTERS TO EEPROM (198) ..................... 119 3.3.48 CCTALK_REQ_ROM_CHECKSUM: CALCULATE ROM CHECKSUM (197)........................... 120 3.3.49 CCTALK_REQ_CREATION_DATE: REQUEST CREATION DATE (196)................................. 121 3.3.50 CCTALK_REQ_MODIFICATION_DATE: REQUEST MODIFICATION DATE (195) .................... 122 3.3.51 CCTALK_REQ_REJECT_COUNT: REQUEST REJECT COUNTER (194)............................... 123 3.3.52 CCTALK_REQ_FRAUD_COUNT: REQUEST FRAUD COUNTER (193) ................................. 124 3.3.53 CCTALK_REQ_BUILD_CODE: REQUEST BUILD CODE (192) ............................................ 125 3.3.54 CCTALK_CMD_MODIFY_DEFAULT_SORTER :MODIFY DEFAULT SORTER PATH (189)........ 126 3.3.55 CCTALK_REQ_DEFAULT_SORTER :REQUEST DEFAULT SORTER PATH (188)................... 127 3.3.56 CCTALK_CMD_MODIFY_COIN_ID: MODIFY COIN ID (185) ............................................... 128 3.3.57 CCTALK_REQ_COIN_ID: REQUEST COIN ID (184) .......................................................... 129 3.3.58 CCTALK_CMD_UPLOAD_WINDOW_DATA: UPLOAD WINDOW DATA (183)......................... 130 3.3.59 CCTALK_REQ_CALIBRATION_INFO: DOWNLOAD CALIBRATION INFORMATION (182)......... 131 CCTALK_CMD_MODIFY_SECURITY :MODIFY SECURITY SETTING (181) ......................................... 133 3.3.60 CCTALK_REQ_SECURITY :REQUEST SECURITY SETTING (180) ...................................... 134 3.3.61 CCTALK_CMD_MODIFY_BANK :MODIFY BANK SELECT (179) .......................................... 135 3.3.62 CCTALK_REQ_BANK: REQUEST BANK SELECT (178) ..................................................... 136 3.3.63 CCTALK_REQ_ALARM_COUNT:REQUEST ALARM COUNTER (176) .................................. 137 3.3.64 CCTALK_REQ_THERMISTOR_READING: REQUEST THERMISTOR READING (173) ............. 138 3.3.65 CCTALK_REQ_BASE_YEAR: REQUEST BASE YEAR (170) ............................................... 139 3.3.66 CCTALK_CMD_EMERGENCY_STOP: EMERGENCY STOP (172) ....................................... 140 3.3.67 CCTALK_REQ_HOPPER_COIN: REQUEST HOPPER COIN (171) ....................................... 141 3.3.68 CCTALK_REQ_ADDRESS_MODE: REQUEST ADDRESS MODE (169)................................. 142 3.3.69 CCTALK_REQ_DISPENSE_COUNT: REQUEST HOPPER DISPENSE COUNT (168)............... 144 3.3.70 CCTALK_CMD_DISPENSE_HOPPER_COINS: DISPENSE HOPPER COINS (167) ................. 145 3.3.71 CCTALK_REQ_HOPPER_STATUS: REQUEST HOPPER STATUS (166)............................... 147 3.3.72 CCTALK_CMD_MODIFY_VARIABLES: MODIFY VARIABLE SET (165) ................................. 148 3.3.73 CCTALK_CMD_ENABLE_HOPPER: ENABLE HOPPER (164)............................................. 149 3.3.74 CCTALK_REQ_TEST_HOPPER: TEST HOPPER (163)...................................................... 150 3.3.75 CCTALK_CMD_MODIFY_REGISTERS: MODIFY INHIBIT AND OVERRIDE REGISTERS (162) .. 152 3.3.76 CCTALK_CMD_PUMP_RNG: PUMP RNG (161).............................................................. 154 3.3.77 CCTALK_REQ_CIPHER_KEY: REQUEST CIPHER KEY (160)............................................. 155 3.3.78 CCTALK_REQ_BILL_EVENTS: READ BUFFERED BILL EVENTS (159) ................................ 156 3.3.79 CCTALK_REQ_BILL_ID: REQUEST BILL ID (157)............................................................. 159 3.3.80 CCTALK_REQ_COUNTRY_SCALE_FACTOR: REQUEST COUNTRY SCALING FACTOR (156) 161 3.3.81 CCTALK_REQ_BILL_POSITION: REQUEST BILL POSITION (155) ...................................... 163 3.3.82 CCTALK_REQ_BILL_POSITION_BUFFER: REQUEST BILL POSITION BUFFER (155) ............ 164 3.3.83 CCTALK_CMD_ROUTE_BILL: ROUTE BILL (154)............................................................. 166 3.3.84 CCTALK_CMD_MODIFY_BILL_OP_MODE: MODIFY BILL OPERATING MODE (153) ............. 168 3.3.85 CCTALK_REQ_BILL_OP_MODE: REQUEST BILL OPERATING MODE (152) ........................ 169 3.3.86 CCTALK_CMD_TEST_LAMPS: TEST LAMPS (151) .......................................................... 170 3.3.87 CCTALK_REQ_ACCEPT_COUNTER: REQUEST INDIVIDUAL ACCEPT COUNTER (150) ........ 171 3.3.88 CCTALK_REQ_ERROR_COUNTER: REQUEST INDIVIDUAL ERROR COUNTER (149) ........... 172 3.3.89 CCTALK_REQ_OPTO_VOLTAGES: REQUEST OPTO VOLTAGES (148) .............................. 173 3.3.90 CCTALK_CMD_STACKER_CYCLE: STACKER CYCLE (147) .............................................. 174 3.3.91 CCTALK_CMD_OP_MOTORS: OPERATE BI-DIRECTION MOTORS (146) ............................ 176 3.3.92 CCTALK_REQ_CURRENCY_REV: REQUEST CURRENCY REVISION (145) ......................... 178 3.3.93 CCTALK_CMD_UPLOAD_BILL_TABLE: UPLOAD BILL-TABLE FROM A FILE ........................ 180 3.3.94 CCTALK_CMD_UPLOAD_BILL_TABLE_DATA: UPLOAD BILL TABLES (144)........................ 181 3.3.95 CCTALK_CMD_BEGIN_BILL_UPGRADE: BEGIN BILL TABLE UPGRADE (143) ..................... 183

Page 7: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 7 of 226

3.3.96 CCTALK_CMD_FINISH_BILL_UPGRADE: FINISH BILL TABLE UPGRADE (142) .................... 184 3.3.97 CCTALK_REQ_UPGRADE_CAPABILITY: FIRMWARE UPGRADE CAPABILITY (141) .............. 185 3.3.98 CCTALK_CMD_UPLOAD_FIRMWARE: UPLOAD FIRMWARE FROM A FILE .......................... 186 3.3.99 CCTALK_CMD_UPLOAD_FIRMWARE_DATA: UPLOAD FIRMWARE DATA (140).................. 187 3.3.100 CCTALK_CMD_BEGIN_FIRMWARE_UPGRADE: BEGIN FIRMWARE UPGRADE (139) ......... 188 3.3.101 CCTALK_CMD_FINISH_FIRMWARE_UPGRADE: FINISH FIRMWARE UPGRADE (138) ........ 189 3.3.102 CCTALK_CMD_SWITCH_ENCRYPTION: SWITCH ENCRYPTION CODE (137) .................... 190 3.3.103 CCTALK_CMD_STORE_ENCRYPTION: STORE ENCRYPTION CODE (136) ....................... 191 3.3.104 CCTALK_CMD_SET_ACCEPT_LIMIT: SET ACCEPT LIMIT (135) ...................................... 192 3.3.105 CCTALK_REQ_BARCODE: READ BARCODE DATA (129)................................................ 194 3.3.106 CCTALK_REQ_CURRENCY_SPEC_ID: REQUEST CURRENCY SPECIFICATION ID (91) ..... 195 3.3.107 CCTALK_REQ_CURRENCY_SPEC_ID: REQUEST NOTE IMAGE (90) ............................... 196 3.3.108 CCTALK_CMD_CLEAR_AUDIT: CLEAR AUDIT DATA (89) ............................................... 198 3.3.109 CCTALK_REQ_COMMS_REVISION: REQUEST COMMS REVISION (4) .............................. 199 3.3.110 CCTALK_CMD_CLEAR_COMMS: CLEAR COMMS STATUS VARIABLES (3)........................ 200 3.3.111 CCTALK_REQ_COMMS_STATUS: REQUEST COMMS STATUS VARIABLES (2).................. 201 3.3.112 CCTALK_CMD_RESET: RESET DEVICE (1)................................................................... 203

4 WINDOWS XP EMBEDDED SUPPORT .......................................................................... 204

4.1 COMPONENT INSTALLATION............................................................................................. 204 4.2 COMPONENTS ................................................................................................................. 207 4.2.1 MONEY CONTROLS CCTALK SDK CCTALK PROTOCOL ................................................... 208 4.2.2 MONEY CONTROLS CCTALK SDK SAMPLE PROGRAMS .................................................. 209 4.2.3 MONEY CONTROLS CCTALK SDK UTILITY PROGRAMS ................................................... 210

5 COMMAND LINE UTILITIES............................................................................................ 211

5.1 CCUTIL ........................................................................................................................... 211

APPENDIX 1 INNOCORE GAMING LOCATIONS ............................................................. 226

Page 8: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 8 of 226

1 INTRODUCTION

1.1 OVERVIEW

This manual describes the ccTalk SDK and constituent functions, utilities and other features.

The targeted audience of this product is software developers.

The purpose of the SDK is to provide a developer with functions that can be easily used to communicate with different peripheral devices used in gaming industry such as coin hoppers, printers, bill acceptors and coin mechanisms.

1.2 INSTALLATION

1.2.1 WINDOWS

Windows version of ccTalk SDK comes with an installer called setup.exe. Run the installer and follow the on-screen instructions. By default the ccTalk SDK files will be installed into <System drive>:\Program Files\Money Controls\ccTalk SDK.

1.2.2 LINUX

Linux version of ccTalk SDK comes as GNU-zipped tar file called connector_install_1.0.1.x_linux_i686.tar.bz2. Extract the contents of the file into any directory you prefer using the following command:

# tar –jxvf connector_install_1.0.1.x_linux_i686.tar.bz2

You will end up with directories called ./lib, ./include and ./tests. ./lib and ./include directories contain the libraries and C header files respectively. ./tests directory contains sample code. There is also script file called install.sh. If you run this file then the files in ./lib directory will be copied over into /usr/lib, ./include directory will be copied over into /usr/include and ./tests directory will be copied over into /usr/src/Innocore/DPXConnector. You will need root privileges in order for this script to run successfully.

1.3 SDK FILES STRUCTURE

After SDK installation the installation directory contains the following directories:

Page 9: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 9 of 226

<SDK installation directory>/ include/ lib/ tests/

The include directory contains the header files, the lib directory contains the protocol and link libraries and the tests directory contains the sample code for every protocol library.

1.4 SAMPLE CODE

As it was mentioned earlier in section 1.2 the demos directory contains sample code for every protocol library provided by SDK.

Linux users can just issue make command in order to build the sample executable. After make finishes there will be two directories: Debug and Release which contain debug and release versions of the sample code. The directories will also contain the stream_rs.so lib file and the protocol-specific library used by the sample code. If you haven’t copied all the library files into one of the directories pointed by LD_LIBRARY_PATH environment then add current directory to the LD_LIBRARY_PATH variable:

# export LD_LIBRARY_PATH = $LD_LIBRARY_PATH:./

This tells the OS to search for the needed libraries in the directory, where you will be running the sample code from.

Windows users are provided with VC6 studio workspace files. Just build the sample code and you are ready to run the executables.

Page 10: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 10 of 226

2 GETTING STARTED, FREQUENTLY ASKED QUESTIONS

2.1 PREREQUISITES

This manual is written for the C/C++ programmer/developer. It assumes the reader is familiar with C/C++ programming, including pointers, Fabstract and aggregated data types and is able to roughly understand how programs, libraries and the symbols (the names for variables and functions) are linked together.

2.2 FILES

In order to successfully compile your code please make sure that you have included the following header files:

connector_sdk.h

ccTalk.h

cctalk_app.h

Libraries (Windows) ccTalk.dll

ccTalk.lib (import library)

Libraries (Linux) libccTalk.so

2.3 ERROR CODES

All the API functions return date of type DG_ERROR. The error code values are defined in the header file dg_error.h.

The full error code values which are returned by API functions consist of two parts: the first 16 bits define the error code itself and the other 16 bits define the module which generated the error.

There are two helper macros defined in dg_error.h file:

DG_IS_SUCCESS(<error code>) – The macro returns TRUE if the function returned no error and FALSE otherwise.

DGErrorCode(<error code>) – The macro extracts the error code value from the full error code.

The function dgsys_error_to_text() is often more helpful – it converts any error code expressed as a DG_ERROR into a human readable text string.

Page 11: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 11 of 226

2.4 USB AND SERIAL CONVERTERS

An increasing number of devices supporting ccTalk communication have USB connectors too. This applies, for example, to the MoneyControls Ardac Elite bill acceptor; additionally some devices with standard ccTalk communication ports can be attached to a computer without ccTalk ports by using a USB-to-serial converter. A suitable software driver must be loaded for this to work.

For MoneyControls’ devices, a suitable Windows driver by FTDI is supplied with the device. This should be installed according to the driver and the peripheral instructions.

For MoneyControls devices to be used with the GNU/Linux operating system, the ftdi_sio driver should be loaded with the vendor and product parameters set to the USB vendor-id and product-id respectively. This information can be determined by using the lsusb command.

For example,

# lsusb Bus 004 Device 001: ID 0000:0000 Bus 003 Device 001: ID 0000:0000 Bus 002 Device 001: ID 0000:0000 Bus 001 Device 003: ID 106f:0001 Money Controls Bus 001 Device 001: ID 0000:0000 # modprobe ftdi_sio vendor=0x1067 product=0x1 #

The Linux serial port device is called /dev/ttyUSBn; where n starts at 0 and increases monotonically for each USB serial device configured.

2.5 MONEY CONTROLS’ ARDAC ELITE

This device can be connected either to traditional RS-232-based serial communications lines (either COM3 and COM4 for ccTalk or another COM port for ID003 protocol) or to a USB port.

When using traditional ccTalk communications, the baud-rate to use is 9600.

When using USB communications, an appropriate USB-to-Serial converter driver must be loaded (see 2.4 above). The USB vendor ID for this device is 0x1067 and the device ID is 0x0001. The standard baud rate for this communication line is 921600.

The default ccTalk address for this device is 40.

Page 12: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 12 of 226

2.6 FREQUENTLY-ASKED QUESTIONS

The following sections deal with how to perform specific tasks with the ccTalk application layer and API.

2.6.1 DO I USE THE CCTALK APPLICATION LAYER OR THE CCTALK NATIVE API?

This depends upon your need. To get started quickly, use the application layer described in section 3.2. If your application doesn’t already have its own main processing loop then you may also use the application layer.

However, if your own application architecture precludes using the application layer’s polling loop then you may have to use the ccTalk native API to discover devices and poll these devices for their events.

2.6.2 HOW DO I FIND OUT WHICH BILLS/NOTES ARE PROGRAMMED?

There are two ways to determine the contents of the bill/note table.

From the Linux command line or the Windows command prompt, you can use the ccutil program (see section 5) thus:

C:\>ccutil –p COM3 –a 40 –-show-bills

Where COM3 is the port to which the bill/note validator connector and 40 is its ccTalk protocol address. On Linux, the COM3 device will likely be /dev/ttyUSB0 or /dev/ttySx. See the previous sections 2.4 and 2.5 for more information.

In a C/C++ program, you may use either the ccTalk native API function cctalk_req_bill_id().

2.6.3 HOW DO I ACCEPT OR DECLINE (REJECT) SPECIFIC NOTES?

Using the ccTalk application layer, use the API function cctalk_app_reject_bill() to reject the bill just inserted into a bill/note validator or the function cctalk_app_accept_bill() to accept the bill.

Most bill/note validators automatically reject notes that are not known (not in the programmed bill table) so that when an event is received documenting an invalid bill, there is no need to reject the note explicitly using cctalk_app_reject_bill().

These methods also apply to coupons bearing bar-codes recognised by the device in question.

Page 13: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 13 of 226

2.6.4 HOW DO I PROGRAM THE BILL ACCEPTOR TO (NOT) USE ESCROW-MODE?

The ccTalk native API function cctalk_cmd_modify_bill_op_mode() (command 153) can be used to change this.

Since the parameter to this command controls also the use of a stacker, you should read back the existing operating mode word using cctalk_req_bill_op_mode() in order to avoid change the previous setting, unless you wish to set both capabilities at once.

For example

unsigned char uchOpMode; DG_ERROR iResult; iResult = cctalk_req_bill_op_mode(handle, address, &uchOpMode); if (!DG_IS_SUCCESS(iResult)) { // Error handling } // Enable the escrow mode. // uchOpMode |= 2; iResult = cctalk_cmd_modify_bill_op_mode(handle, address, uchOpMode); if (!DG_IS_SUCCESS(iResult)) { // Error handling }

2.6.5 HOW DO I PROGRAM THE BILL ACCEPTOR TO (NOT) USE THE STACKER?

Configuring use of the stacker is nearly identical to configuring use of escrow mode. Bit 0 of the byte configuring the bill operating mode is reserved for configuring the stacker operating.

2.6.6 HOW DO I ACCEPT BARCODES?

The Money Controls Ardac Elite bill/note validator is pre-programmed to recognise and scan a range of different types of bar-code common to various target markets. In the unlikely event your bar-codes are not automatically recognised, please contact your Money Controls sales representative for assistance.

Programmatically, acceptable bar-codes result in the Ardac Elite issuing an event with data {ResultA,ResultB} = {0,20}. (See Table 7 in the ccTalk Generic Specification available from http://www.ccTalk.org.)

Page 14: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 14 of 226

When using the application layer, your event handler receive an event of type DG_CCTALK_APP_EVT_BARCODE_INSERTED before receiving a further event of type DG_CCTALK_APP_EVT_BILL_IN_ESCROW or (…IN_STACKER if you have escrow mode disabled) with the iBillAmount event structure member set to 0.

When use the native ccTalk API, the event table returned by cctalk_req_bill_events() will contain an event of code DGC_CCTALK_BEVT_S_BARCODE followed by DGT_CCTALK_BEVT_C_STACKED or DGT_CCTALK_BEVT_C_ESCROWED.

2.6.7 HOW CAN I PROGRAM IN A BILL/NOTE TABLE?

There are two ways to program in a bill/note table.

From the Linux command line or the Windows command prompt, you can use the ccutil program (see section 5) thus:

C:\>ccutil –p COM3 –a 40 –-table-upload file.tab

Where COM3 is the port to which the bill/note validator connector and 40 is its ccTalk protocol address. On Linux, the COM3 device will likely be /dev/ttyUSB0 or /dev/ttySx. See the previous sections 2.4 and 2.5 for more information.

In a C/C++ program, you may use either the API function cctalk_cmd_upload_bill_table() or the set of functions cctalk_cmd_begin_bill_upgrade(), cctalk_cmd_upload_bill_table_data() and cctalk_cmd_finish_bill_upgrade().

2.6.8 HOW CAN I PROGRAM IN NEW FIRMWARE?

There are two ways to program in a bill/note table.

From the Linux command line or the Windows command prompt, you can use the ccutil program (see section 5) thus:

C:\>ccutil –p COM3 –a 40 –-firmware-upload firmware.bin

Where COM3 is the port to which the bill/note validator connector and 40 is its ccTalk protocol address. On Linux, the COM3 device will likely be /dev/ttyUSB0 or /dev/ttySx. See the previous sections 2.4 and 2.5 for more information.

In a C/C++ program, you may use either the API function cctalk_cmd_upload_firmware() or the set of functions cctalk_cmd_begin_firmware_upgrade(), cctalk_cmd_upload_firmware_data() and cctalk_cmd_finish_firmware_upgrade().

Page 15: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 15 of 226

2.6.9 HOW DO I USE ENCRYPTED DATA OR 16-BIT CHECKSUMS FOR MY ARDAC ELITE?

Neither encrypted data nor 16-bit checksums are supported in this release of the ccTalk API.

2.6.10 MY APPLICATION ALREADY HAS AN EVENT-DRIVEN LOOP: WHAT DO I DO?

Two choices available in this event:

On both Windows and Linux, you may create a thread within your application to accommodate the ccTalk application layer polling loop. It is beyond the scope of this manual to describe how this is done, although it is not technically demanding.

If your application cannot accommodate a separate thread then you will have to use the ccTalk native API (see section 3.3) and discover devices manually and poll them for their events at an interval of your choice.

Page 16: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 16 of 226

3 CCTALK APIS

The library provides functions that enable communication with devices using ccTalk protocol. Please visit

libdgccTalk Files

C Header files ccTalk.h

cctalk_app.h

Libraries (Windows) ccTalk.dll

ccTalk.lib (import library)

Libraries (Linux) libccTalk.so

In order to successfully compile your code please make sure that you have included the following header files:

connector_sdk.h

If you are writing your application in C++ please make sure that you have specified Connector SDK namespace:

#include <connector_sdk.h> #include <ccTalk.h> using namespace __CONNECTOR_SDK;

Page 17: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 17 of 226

3.1 SYSTEM FUNCTIONS

3.1.1 DGSYS_ERROR_TO_TEXT: CONVERT AN ERROR MESSAGE TO A TEXT STRING

Definition const char *dgsys_error_to_text(IN DG_ERROR error_code);

Parameters Error_code This is an error code returned by any other ccTalk application

layer function, command or request returning a DG_ERROR code.

Description This function converts the error code in error_code into a text string of the form

“%s layer error 0x%x: %s”

where the first %s is the name of the subsystem producing the error, the %x is the error code error_code and the final %s is the specific error string for the subsystem.

Return Value The return value is a pointer to NUL-terminated C string showing the error text for the error number in error_code.

Errors None.

Notes If the error code is invalid, a valid text string is still returned stating that the code is unknown and quoting the error code in hexadecimal.

Example

#include <connector_sdk.h> #include <ccTalk.h> iResult = cctalk_app_init(NULL); if(!DG_IS_SUCCESS(iResult)) { printf(“Couldn’t intialise application layer: %s\n”, dgsys_error_to_text(iResult)); }

Please see dgcctalk_demo.cpp for more information how to use the command.

Page 18: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 18 of 226

3.2 CCTALK APPLICATION LAYER

The ccTalk application is a higher-level approach to ccTalk device communication than is available using solely the ccTalk command/request API (see section 3.3) and provides a somewhat simpler interface than the latter. You may still, however, use command/request API functions if necessary, only a few of which conflict with use of the application layer. These conflicts are pointed out where appropriate in the sections following.

The following devices are supported in this release.

• Money Controls International’s Ardac Elite (Ardac6) Bill/note Validator.

3.2.1 CCTALK_APP_INIT: INITIALISE APPLICATION LAYER

Definition #include <ccTalk.h>

#include <cctalk_app.h>

DG_ERROR cctalk_app_init(DG_CCTALK_APP_EVT_HANDLER pfnHandler);

typedef void (*DG_CCTALK_APP_EVT_HANDLER)

(PDG_CCTALK_APP_EVT pEVT);

Parameters pfnHandler A pointer to a function to be called when new events are

available. The function takes a single parameter which is a pointer to a structure of type DG_CCTALK_APP_EVT; it returns no data.

This parameter may not be NULL.

Description cctalk_app_init() initialises the application layer for ccTalk operations.

Errors DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_LINK_OPEN The application layer has already been initialised

and may not be reinitialized.

Page 19: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 19 of 226

Notes The event codes and handling of events is covered in the following section.

Example

#include <connector_sdk.h> #include <connector_sdk.h> #include <ccTalk.h> #include <cctalk_app.h> using namespace __CONNECTOR_SDK; void my_event_handler(PDG_CCTALK_APP_EVT *pEVT) { ... } ... DG_ERROR iResult = cctalk_app_init(my_event_handler); if(!DG_IS_SUCCESS(iResult)) { fprintf(stderr, “Couldn’t initialise application layer: %s\n”, dgsys_error_to_text(iResult)); // other error handling code here // }

Please see dgcctalk_app_demo.cpp for more information how to use the command.

Page 20: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 20 of 226

3.2.2 DG_CCTALK_APP_EVT_HANDLER: CUSTOMER EVENT HANDLING FUNCTION

Definition #include <ccTalk.h>

#include <cctalk_app.h>

typedef void (*DG_CCTALK_APP_EVT_HANDLER)

(PDG_CCTALK_APP_EVT pEVT);

typedef struct

{

DG_CCTALK_APP_EVT_CODE eEventCode;

DG_CCTALK_APP_EVT_TYPE eEventType;

int iTime;

int iHandle;

unsigned char uchAddress;

DG_CCTALK_BILL_INFO sBillInfo;

int iBillAmount;

union

{

long lData;

int iData;

unsigned char ucArray[128];

char *cString;

void *pvoid;

} uData;

void *_private; // for use by ccTalk app layer

} DG_CCTALK_APP_EVT, *PDG_CCTALK_APP_EVT;

Description The data type DG_CCTALK_APP_EVT (and its associated pointer type PDG_CCTALK_APP_EVT) are used to describe events being delivered to the customer application.

The fields of the event structure have the following meanings. eEventCode This is the code of the event delivered. See the event

codes described in 3.2.3. eEventType This is the type of the event delivered. See the event

types described in 3.2.3.

Page 21: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 21 of 226

iTime This is the time at which the event was received by the application layer. (Due to delays induced by the communications protocol, the response time of the device and latencies in the host operating system, this time will rarely be the same as the time at which the event occurred on the device reporting it.

iHandle This is the handle for the link upon which the device is connected which reported the event. This value may be passed as the iHandle parameter to all ccTalk API functions which require one.

uchAddress This is the ccTalk address for the device which reported the event. This value may be passed as the device destination address parameter (uchAddress or uchDstAddress) to all ccTalk API functions which require one.

sBillInfo For events which pertain to bills or coupons being inserted into or stacked by a bill/note validator, this structure contains information about the bill in the same format as returned by cctalk_req_bill_id().

iBillAmount For events which pertain to bills or coupons being inserted into or stacked by a bill/note validator, this member contains the corrected value for the bill, taking into account all bill and country scaling factors.

_private This member is populated by the ccTalk application layer and is for internal use. It should not be modified.

The union uData exists in this structure to represent any ancillary data that may be required to be reported for the current event. uData.lData Data represented as a long integer. uData.iData Data represented as a regular integer. uData.ucArray Data represented as a byte (unsigned char) array of up to

128 bytes. uData.cString A pointer to a string elsewhere in memory. uData.pvoid A void pointer to something somewhere else in memory.

Generally, your event handling function need only examine a few fields of the event structure – namely eEventType, eEventCode and, if necessary, iBillAmount. Rarely will it be necessary to use the other members or use ccTalk API commands.

Page 22: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 22 of 226

Notes The memory associated with the event being delivered may be re-used for future events and, as such, should not be referenced after the event handler has completed.

Example Please see dgcctalk_app_demo.cpp for more information how to construct an event handler.

Page 23: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 23 of 226

3.2.3 DG_CCTALK_APP_EVT_CODE, DG_CCTALK_APP_EVT_TYPE

Definition #include <ccTalk.h>

#include <cctalk_app.h>

typedef enum _DG_CCTALK_APP_EVT_TYPE

{

DG_CCTALK_APP_EVT_TYPE_NONE = 0,

DG_CCTALK_APP_EVT_CREDIT,

DG_CCTALK_APP_EVT_PENDING_CREDIT,

DG_CCTALK_APP_EVT_STATUS,

DG_CCTALK_APP_EVT_REJECT,

DG_CCTALK_APP_EVT_ERROR,

DG_CCTALK_APP_EVT_FRAUD,

} DG_CCTALK_APP_EVT_TYPE;

typedef enum _DG_CCTALK_APP_EVT_CODE

{

DG_CCTALK_APP_EVT_CODE_NONE = 0,

DG_CCTALK_APP_EVT_OPENED_LINK,

DG_CCTALK_APP_EVT_FOUND_DEVICE,

DG_CCTALK_APP_EVT_START_DEVICE,

DG_CCTALK_APP_EVT_STOP_DEVICE,

DG_CCTALK_APP_EVT_DEVICE_NOT_RESPONDING,

DG_CCTALK_APP_EVT_DEVICE_RESPONDING,

DG_CCTALK_APP_EVT_DEVICE_POWER_CYCLE,

DG_CCTALK_APP_EVT_BILL_IN_ESCROW,

DG_CCTALK_APP_EVT_BILL_IN_STACKER,

DG_CCTALK_APP_EVT_BILL_INHIBITED,

DG_CCTALK_APP_EVT_BILL_PULLED,

DG_CCTALK_APP_EVT_BILL_TAMPERED,

DG_CCTALK_APP_EVT_BILL_INVALID,

DG_CCTALK_APP_EVT_BILL_FAILED_TRANSPORT,

DG_CCTALK_APP_EVT_BILL_RETURNED,

DG_CCTALK_APP_EVT_BILL_JAMMED_SAFE,

DG_CCTALK_APP_EVT_BILL_JAMMED_UNSAFE,

DG_CCTALK_APP_EVT_UPGRADE_SUCCESS,

DG_CCTALK_APP_EVT_UPGRADE_FAILURE,

DG_CCTALK_APP_EVT_BILLTABLE_LOADED,

Page 24: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 24 of 226

DG_CCTALK_APP_EVT_BILLTABLE_LOAD_FAILURE,

DG_CCTALK_APP_EVT_BARCODE_INSERTED,

DG_CCTALK_APP_EVT_STACKER_OK,

DG_CCTALK_APP_EVT_STACKER_JAMMED,

DG_CCTALK_APP_EVT_STACKER_REMOVED,

DG_CCTALK_APP_EVT_STACKER_INSERTED,

DG_CCTALK_APP_EVT_STACKER_FAULTY,

DG_CCTALK_APP_EVT_STACKER_FULL,

DG_CCTALK_APP_EVT_STRING_FRAUD,

DG_CCTALK_APP_EVT_ANTISTRING_ERROR,

DG_CCTALK_APP_EVT_OPTO_FRAUD,

_DG_CCTALK_APP_EVT_INVALID // MARKS END OF ENUMERATOR TYPE

} DG_CCTALK_APP_EVT_CODE;

Description These two enumerated types are essential for understanding what event and what type of event is being delivered.

The event type enumeration values have the following meanings. DG_CCTALK_APP_EVT_TYPE_NONE This value exists for completion’s sake and

should not be seen. DG_CCTALK_APP_EVT_CREDIT The event-type means a valid bill or coupon

has been accepted by the a bill acceptor and sent to the stacker.

DG_CCTALK_APP_EVT_PENDING_CREDIT

The event-type means a valid bill or coupon has been inserted into a bill acceptor and is being held in escrow for further processing.

DG_CCTALK_APP_EVT_STATUS This event-type pertains to events which are merely informational and on which action need not necessarily be taken.

DG_CCTALK_APP_EVT_REJECT This event-type demarks the rejection of a bill or coupon and its return to the customer.

DG_CCTALK_APP_EVT_ERROR This event-type pertains to events that mark an error during device operations.

DG_CCTALK_APP_EVT_FRAUD This event-type demarks cases where the device reports that an attempt at fraud has been made.

Page 25: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 25 of 226

The event type enumeration values have the following meanings. Except where indicated otherwise, the iHandle and uchAddress members of the event structure are populated with the link ID and destination address of the device concerned. DG_CCTALK_APP_EVT_CODE_NONE

This event exists merely for completions’ sake as a marker that no event has occurred. It should never be seen in a delivered event.

DG_CCTALK_APP_EVT_OPENED_LINK

This event is sent when a link is successfully opened for the first time. The iHandle member of the event structure can now be used with ccTalk request or command functions. The uchAddress member is set to 1 – the address of the ccTalk host device.

DG_CCTALK_APP_EVT_FOUND_DEVICE

This event is delivered when a new device is found on an open link.

One such event is delivered for each device found on a link when cctalk_app_add_link() is invoked. The iHandle and uchAddress members of the event structure are populated with the link ID and destination address of the device just discovered.

The application may invoke cctalk_app_get_device_info() to find out more information about the device which was discovered. For bill/note validators, the ccTalk application layer loads all of the bill and country code information from the device prior to delivering this event.

Other functions such as cctalk_app_load_firmware() and cctalk_app_load_note_table() may also be invoked at this stage.

This is also the correct time in the application layer start-up to determine whether other device settings (such as individual note inhibits, whether to enable escrow mode and self-test results) need to be adjusted.

DG_CCTALK_APP_EVT_START_DEVICE

This event is delivered when cctalk_app_run() is invoked just prior to regular polling of the device. The iHandle and uchAddress members of the event structure are populated with the link ID and destination address of the device being started.

For bill/note acceptors, this is the time at which functions such as cctalk_cmd_master_inhibit_status() should be invoked.

The ccTalk application layer itself takes no other action to start devices other than to deliver this event.

DG_CCTALK_APP_EVT_STOP_DEVICE

Page 26: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 26 of 226

This event is delivered when cctalk_app_run() is about to finish because the function cctalk_app_finish() was invoked.

Once this event has been delivered and the event handler has completed, the ccTalk application layer makes a final attempt to shutdown each device. For bill/note validators, the master inhibit is set and so the device is disabled.

DG_CCTALK_APP_EVT_DEVICE_NOT_RESPONDING

This event is delivered when a device stops responding to its regular polling.

All devices found are subject to a regular simple ccTalk poll. After N failed polls, this event is delivered once only until the device starts responding again.

DG_CCTALK_APP_EVT_DEVICE_RESPONDING

This event is delivered when a device starts responding again to its regular polling.

After the first successful re-poll, this event is delivered once only until the device stops responding again.

DG_CCTALK_APP_EVT_DEVICE_POWER_CYCLE

This event is delivered if the device has been power-cycled. For bill/note validators this happens by detecting when the device’s event count reverts to zero.

DG_CCTALK_APP_EVT_BILL_IN_ESCROW

This event is delivered when a valid note or coupon is inserted into a bill/note validator and the validator has been programmed for escrow mode (as opposed to simply sending each note/coupon directly to the stacker).

The iBillAmount member of the event has the corrected value of the inserted bill set. The sBillInfo member also has the bill acceptor’s native bill information.

If a coupon has been entered with a valid bar-code, then the iBillAmount member will be zero. A seperate event notifying the detection of a bar-code will already have been delivered.

DG_CCTALK_APP_EVT_BILL_IN_STACKER

This event is delivered when a valid note or coupon has been routed to the device’s stacker (if fitted). This happens either if the validator has been programmed to simply send each note/coupon directly to the stacker, or if the note was previous escrowed and validated and the application then specifically routed the bill to the stacker.

Page 27: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 27 of 226

The iBillAmount member of the event has the corrected value of the inserted bill set. The sBillInfo member also has the bill acceptor’s native bill information.

If a coupon was entered with a valid bar-code, then the iBillAmount member will be zero. A seperate event notifying the detection of a bar-code will already have been delivered. Note that in the case where escrow mode is enabled and a bar-code is detected, the bar-code event is delivered only once.

DG_CCTALK_APP_EVT_BILL_INHIBITED

This event is delivered when a note has been inserted into a bill/note validator and the validator has been programmed (either programmatically or via physical switches present on the device hardware) to inhibit that note.

It is not possible to determine which note was entered.

DG_CCTALK_APP_EVT_BILL_PULLED

This event is delivered when an attempt is made to pull the note back out of the bill acceptor while it is being inserted. (This is a fraud attempt which is based around having the device validate a bill and report the successful validation without submitting the bill to the device’s stacker.)

DG_CCTALK_APP_EVT_BILL_TAMPERED

This event is delivered when a bill is submitted to a bill/note validator which is considered to be the subject of tampering.

DG_CCTALK_APP_EVT_BILL_INVALID

This event is delivered when the bill submitted by the customer does not match any programmed bill in the bill/note validator’s tables or a coupon is submitted which has no valid bar-code.

DG_CCTALK_APP_EVT_BILL_FAILED_TRANSPORT

This event is delivered when a bill/note validator fails to wind the bill/coupon into its detection mechanism.

DG_CCTALK_APP_EVT_BILL_RETURNED

This event is delivered when a bill or coupon is returned to the user.

DG_CCTALK_APP_EVT_BILL_JAMMED_SAFE

This event is delivered when a bill is jammed in the bill/note acceptor.

DG_CCTALK_APP_EVT_BILL_JAMMED_UNSAFE

This event is delivered when a bill is jammed in the bill/note acceptor.

DG_CCTALK_APP_EVT_UPGRADE_SUCCESS

This event is delieverd when a successful upgrade of the device’s firmware has been completed.

Page 28: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 28 of 226

DG_CCTALK_APP_EVT_UPGRADE_FAILURE

This event is delieverd when an upgrade of the device’s firmware has failed.

DG_CCTALK_APP_EVT_BILLTABLE_LOADED

This event is delieverd when loading bill/note tables into a bill/note validator has succeeded.

DG_CCTALK_APP_EVT_BILLTABLE_LOAD_FAILURE

This event is delieverd when loading bill/note tables bill/note tables into a bill/note validator has failed.

DG_CCTALK_APP_EVT_BARCODE_INSERTED

This event is delivered when a coupon bearing a bar-code is entered into a bill/note validator. Please refer to the manufacturer’s technical manuals for information about the permitted formats of bills. The barcode event is reported once only – before an event notifying that a coupon has been inserted – and is not repeated if an escrowed coupon is later transferred to the stacker.

The uData.ucArray member of the event structure contains an ASCII string representing the validation digits of the bar code.

DG_CCTALK_APP_EVT_STACKER_OK

This event is delivered when the stacker of a bill/note validator is now in acceptable status, having previously been jammed or faulty or full.

DG_CCTALK_APP_EVT_STACKER_JAMMED

This event is delivered when the stacker mechanism of a bill/note validator has jammed.

DG_CCTALK_APP_EVT_STACKER_REMOVED

This event is delivered when the stacker tray of a bill/note validator has been removed.

DG_CCTALK_APP_EVT_STACKER_INSERTED

This event is delivered when the stacker tray of a bill/note validator has been inserted.

DG_CCTALK_APP_EVT_STACKER_FAULTY

This event is delivered when the stacker mechanism of a bill/note validator is faulty.

DG_CCTALK_APP_EVT_STACKER_FULL

This event is delivered when the stacker tray of a bill/note validator is full.

DG_CCTALK_APP_EVT_STRING_FRAUD

Page 29: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 29 of 226

This event is delivered when a bill/note validator detects string fraud. Consult the device manufacturer’s technical manuals for further information.

DG_CCTALK_APP_EVT_ANTISTRING_ERROR

This event is delivered when a bill/note validator detects the anti-string fraud mechanism has an error. Consult the device manufacturer’s technical manuals for further information.

DG_CCTALK_APP_EVT_OPTO_FRAUD

This event is delivered when a bill/note validator detects optical fraud. Consult the device manufacturer’s technical manuals for further information.

Notes The memory associated with the event being delivered may be re-used for future events and, as such, should not be referenced after the event handler has completed.

At present, only events associated with bill/note validators are represented.

Page 30: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 30 of 226

3.2.4 DG_CCTALK_APP_DEVICE_INFO: DEVICE INFORMATION

Definition #include <ccTalk.h>

#include <cctalk_app.h>

typedef enum _DG_CCTALK_APP_DEVICE_TYPE

{

DG_CCTALK_APP_DEVICE_UNKNOWN = 0,

DG_CCTALK_APP_DEVICE_HOST, // master device on bus.

DG_CCTALK_APP_DEVICE_PAYOUT, // coin hopper

DG_CCTALK_APP_DEVICE_COINMECH, // coin acceptor/validator

DG_CCTALK_APP_DEVICE_BNV, // Bill/note acceptor/validator

_DG_CCTALK_APP_DEVICE_INVALID // MARKS END OF ENUMERATOR TYPE

} DG_CCTALK_APP_DEVICE_TYPE;

typedef struct _DG_CCTALK_APP_DEVICE_INFO

{

int iHandle;

unsigned char uchAddress;

DG_CCTALK_APP_DEVICE_TYPE eType;

char sManufacturer[256];

char sCategory[256];

char sModel[256];

char sFirmware[256];

char sBuildCode[256];

char sSerialNumber[256];

char sCommsRevision[256];

unsigned long ulRomChecksum;

unsigned char ucVariables[256];

int iNVariables;

} DG_CCTALK_APP_DEVICE_INFO, *PDG_CCTALK_APP_DEVICE_INFO;

Description The data type DG_CCTALK_APP_DEVICE_INFO (and its associated pointer type PDG_CCTALK_APP_DEVICE_INFO) are used to describe a device discovered by the ccTalk application layer.

The fields of the event structure have the following meanings.

Page 31: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 31 of 226

iHandle This is the handle for the link upon which the device is connected which reported the event. This value may be passed as the iHandle parameter to all ccTalk API functions which require one.

uchAddress This is the ccTalk address for the device is connected which reported the event. This value may be passed as the device destination address parameter (uchAddress or uchDstAddress) to all ccTalk API functions which require one.

eType This records the type of device discovered. sManufacturer This records the manufacturer’s name string returned by

the device on receiving ccTalk command #246. sCategory This records the equipment category string returned by

the device on receiving ccTalk command #245. sModel This records the device’s product code string returned by

the device on receiving ccTalk command #246. sFirmware This records the software version string returned by the

device on receiving ccTalk command #241. sBuildCode This records the device build code string returned by the

device on receiving ccTalk command #192. sSerialNumber This records the device’s serial number returned by the

device on receiving ccTalk command #242. The four bytes returned are combined into a single unsigned integer and then formatted into the buffer.

sCommsRevision This string records the ccTalk communications revision as returned by ccTalk command #4. The string is formatted thus: major-revison.minor-revision (release level)

ulRomChecksum This records the device ROM checksum data returned by the device on receiving ccTalk command #197.

ucVariables This array of unsigned characters contains the variable-set returned by the device.

iNVariables This denotes how many characters of data in ucVariables are valid.

Notes An internal copy of this structure is initialized to zero when each device is found. If for some reason a given string couldn’t be obtained then that field will contain a zero-length string.

Page 32: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 32 of 226

Example Please see dgcctalk_app_demo.cpp for more information how to obtain and use device information.

Page 33: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 33 of 226

3.2.5 CCTALK_APP_ADD_LINK: ADD A LINK FOR APPLICATION LAYER MONITORING

Definition #include <ccTalk.h>

#include <cctalk_app.h>

DG_ERROR cctalk_app_add_link(char *szPortSpec);

Parameters szPortSpec The communications specification for the port on which to

open ccTalk communications.

This parameter may not be NULL.

Description cctalk_app_add_link() opens ccTalk communications on a give com port and scans for ccTalk compatible devices connected to it. For each device found, that device’s manufacturer, product-name, build-code, serial-number, firmware-version and ROM checksum are obtained before an event of type DG_CCTALK_APP_EVT_FOUND_DEVICE is delivered.

The szPortSpec parameter is composed from key=value pairs delimted by a comma (,). The following parameters are accepted. port The value specifies the serial port that needs to be used. For MS

Windows it is the name of the com ports: COM1, COM2 etc. For Linux it is the name of the ttyS files in the dev directory: /dev/ttyS0, /dev/ttyS1 etc. This parameter must be specified.

baudrate The value specifies the baud rate. The possible values are: 110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 56000, 57600, 115200, 230400, 460800, 500000, 576000, 921600, 1000000, 1152000, 1500000, 2000000, 2500000, 3000000, 3500000, 4000000. If not specified, the baud-rate defaults to 9600.

bytesize The value specifies the number of data bits. The possible values are: 5,6,7,8. If not specified, the byte size is 8 bits.

stopbit Specifies the number of stop bits to be used: 1 or 2. If not specified then 1 stop bit is used.

parity Specifies the parity scheme to be used: no, even or odd. If not specified then no parity bit is used.

Page 34: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 34 of 226

ctsrts Sets hardware flow control. If set to 1 then hardware flow control is enabled. This works if the CTS on the computer is connected to RTS on the peripheral device and RTS on the computer is connected to CTS on the peripheral device. If not specified then no hardware flow control is used.

xonchar Sets XON character used for software flow control. If either XON or XOFF character have been specified then software flow control is enabled. <optional parameter>

xoffchar Sets XOFF character used for software flow control. If either XON or XOFF character have been specified then software flow control is enabled. <optional parameter>

Errors DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_NORESOURCES Memory could not be allocated for this

operation. DGERROR_NODEVICES The link was opened successfully but no devices

could be detected.

Notes The event codes and handling of events is covered in the section 3.2.3.

ctalk_app_add_link() operates by calling cctalk_open_link() and then using cctalk_cmd_address_poll(); error codes returned by both these functions are also possible in addition to those listed above.

Example

#include <connector_sdk.h> #include <ccTalk.h> #include <cctalk_app.h> using namespace __CONNECTOR_SDK; void my_event_handler(PDG_CCTALK_APP_EVT *pEVT); ... DG_ERROR iResult = cctalk_app_init(my_event_handler); if(!DG_IS_SUCCESS(iResult)) { // Error handling code here } // Configure the link suitable for a Money Controls Ardac Elite.

Page 35: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 35 of 226

// iResult = cctalk_app_add_link(“port=COM3,baudrate=921600”); if(!DG_IS_SUCCESS(iResult)) { // Error handling code here // }

Please see dgcctalk_app_demo.cpp for more information how to use the command.

Page 36: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 36 of 226

3.2.6 CCTALK_APP_RUN: START THE CCTALK APPLICATION LAYER EVENT-LOOP

Definition #include <ccTalk.h>

#include <cctalk_app.h>

DG_ERROR cctalk_app_run(void);

Parameters None.

Description cctalk_app_run() starts the main event loop of the ccTalk application layer.

For each device discovered on each link added, an event of code DG_CCTALK_APP_EVT_START_DEVICE is first delivered.

The ccTalk application now goes into polling mode in which each device is polled at regular intervals with events delivered to the registed event handler when these are received by the polling function.

Once the normal polling operations have begun, cctalk_app_run() does not return to the caller unless cctalk_app_finish() is called.

Once the application has been instructed to terminate, for each device discovered on each link added, an event of code DG_CCTALK_APP_EVT_STOP_DEVICE is then delivered.

Errors DGERROR_OK The operation completed successfully. DGERROR_NODEVICES No Links have been added or there are no

devices discovered on those links.

Notes The event codes and handling of events is covered in the section 3.2.3.

You should not use cctalk_req_bill_events (ccTalk command code 159) when using this function; if you do, then events may be missed by the application loop.

Example

#include <connector_sdk.h> #include <ccTalk.h> #include <cctalk_app.h> using namespace __CONNECTOR_SDK;

Page 37: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 37 of 226

void my_event_handler(PDG_CCTALK_APP_EVT *pEVT); ... DG_ERROR iResult = cctalk_app_init(my_event_handler); if(!DG_IS_SUCCESS(iResult)) { // Error handling code here } // Configure the link suitable for a Money Controls Ardac Elite. // iResult = cctalk_app_add_link(“port=COM3,baudrate=921600”); if(!DG_IS_SUCCESS(iResult)) { // Error handling code here } // Configure the link suitable for a Money Controls Ardac Elite. // iResult = cctalk_app_run(); if(!DG_IS_SUCCESS(iResult)) { // Error handling code here }

Please see dgcctalk_app_demo.cpp for more information how to use the command.

Page 38: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 38 of 226

3.2.7 CCTALK_APP_FINISH: TERMINATE THE DEVICE MONITORING LOOP

Definition #include <ccTalk.h>

#include <cctalk_app.h>

DG_ERROR cctalk_app_finish(void);

Parameters None

Description This function causes the device monitor loop started by calling cctalk_app_run() to terminate. cctalk_app_run() first shutdown each device before returning to its caller.

Errors DGERROR_OK The operation completed successfully.

Notes None.

Example Please see dgcctalk_app_demo.cpp for more information how to use the command.

Page 39: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 39 of 226

3.2.8 CCTALK_APP_GET_DEVICE_INFO: GET A DISCOVERED DEVICE’S INFORMATION

Definition #include <ccTalk.h>

#include <cctalk_app.h>

DG_ERROR cctalk_app_get_device_info(PDG_CCTALK_APP_EVT pEVT,

PDG_CCTALK_APP_DEVICE_INFO pDI);

Parameters pEVT An event containing the link and address information for the

device concerned.

pDI A pointer to an instance of DG_CCTALK_APP_DEVICE_INFO into which the device’s information will be placed. See 3.2.4 for a description of this data type.

Description cctalk_app_get_device_info() returns a copy of the device information obtained when the device was discovered. This information is obtained prior to an event of type DG_CCTALK_APP_EVT_FOUND_DEVICE being delivered.

Errors DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER If pEVT or pDI is NULL or pEVT is not an event

presented by the application or has been corrupted.

Notes None.

Example

#include <connector_sdk.h> #include <ccTalk.h> #include <cctalk_app.h> using namespace __CONNECTOR_SDK; void my_event_handler(PDG_CCTALK_APP_EVT *pEVT) { DG_CCTALK_APP_DEVICE_INFO sDeviceInfo; DG_ERROR iError;

Page 40: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 40 of 226

iError = cctalk_app_get_device_info(pEVT, &sDeviceInfo); if (!DG_IS_SUCCESS(iError)) { // Error handling } else { printf(“Event from device %s at address %d on link %d\n”, pDI->sModel, pDI->uchAddress, pDI->iHandle); } // Do other event handling stuff now. }

Please see dgcctalk_app_demo.cpp for more information how to use the command.

Page 41: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 41 of 226

3.2.9 CCTALK_APP_ENABLE_DEVICE: ENABLE A DEVICE

Definition #include <ccTalk.h>

#include <cctalk_app.h>

DG_ERROR cctalk_app_enable_device(PDG_CCTALK_APP_EVT pEVT);

Parameters pEVT An event containing the link and address information for the

device concerned.

Description cctalk_app_enable_device() attempts to enable a given ccTalk device. The definition of enabling differs with each device equipment category. At present, enabling is only defined for Bill/Note validators, where this operation amounts to clearing (disabling) the device’s master inhibit flag.

Errors DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER If pEVT is NULL or pEVT is not for a supported

device. DGERROR_NOTSUPPORTED The enable operation is not supported for the

device type.

Notes None.

Example

#include <connector_sdk.h> #include <ccTalk.h> #include <cctalk_app.h> using namespace __CONNECTOR_SDK; void my_event_handler(PDG_CCTALK_APP_EVT *pEVT) { DG_ERROR iError; switch (pEVT->eEventCode) { case DG_CCTALK_APP_EVT_START_DEVICE: // We’re starting up now as cctalk_app_run() has been

Page 42: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 42 of 226

// called – enable the device so it can receive notes. // iError = cctalk_app_enable_device(pEVT); break; // other event handling… } }

Please see dgcctalk_app_demo.cpp for more information how to use the command.

Page 43: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 43 of 226

3.2.10 CCTALK_APP_DISABLE_DEVICE: DISABLE A DEVICE

Definition #include <ccTalk.h>

#include <cctalk_app.h>

DG_ERROR cctalk_app_disable_device(PDG_CCTALK_APP_EVT pEVT);

Parameters pEVT An event containing the link and address information for the

device concerned.

Description cctalk_app_enable_device() attempts to disable a given ccTalk device. The definition of disabling differs with each device equipment category and usually the opposite operation to enabling the device. At present, enabling and disabling is only defined for Bill/Note validators, where disabling amounts to setting (enabling) the device’s master inhibit flag so that it will not accept bills or coupons.

Errors DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER If pEVT is NULL or pEVT is not for a supported

device. DGERROR_NOTSUPPORTED The enable operation is not supported for the

device type.

Notes None.

Example

#include <connector_sdk.h> #include <ccTalk.h> #include <cctalk_app.h> using namespace __CONNECTOR_SDK; void my_event_handler(PDG_CCTALK_APP_EVT *pEVT) { DG_ERROR iError; switch (pEVT->eEventCode)

Page 44: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 44 of 226

{ case DG_CCTALK_APP_EVT_STOP_DEVICE: // We’re starting up now as cctalk_app_run() has been // called – enable the device so it can receive notes. // iError = cctalk_app_disable_device(pEVT); break; // other event handling… } }

Please see dgcctalk_app_demo.cpp for more information how to use the command.

Page 45: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 45 of 226

3.2.11 CCTALK_APP_EVENT_NAME: TRANSLATE AN EVENT CODE INTO READABLE TEXT

Definition #include <ccTalk.h>

#include <cctalk_app.h>

const char *cctalk_app_event_name (PDG_CCTALK_APP_EVT_CODE code);

Parameters codeEVT An event code, for example from the eEventCode member of

DG_CCTALK_APP_EVT.

Description cctalk_app_get_event_name() converts an event code into a human-readable text string.

Errors If the event code code is not a valid event code then a string of format “Invalid event code #%d” is returned.

Notes cctalk_app_event_name() always returns a valid, non-empty, NUL-terminated C string.

Example

#include <connector_sdk.h> #include <ccTalk.h> #include <cctalk_app.h> using namespace __CONNECTOR_SDK; void my_event_handler(PDG_CCTALK_APP_EVT *pEVT) { DG_CCTALK_APP_DEVICE_INFO sDeviceInfo; DG_ERROR iError; iError = cctalk_app_get_device_info(pEVT, &sDeviceInfo); if (!DG_IS_SUCCESS(iError)) { // Error handling } else { printf(“Event %s from device %s (address %d) on link %d\n”,

Page 46: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 46 of 226

cctalk_app_event_name(pEVT->eEventCode), pDI->sModel, pDI->uchAddress, pDI->iHandle); } // Do other event handling stuff now. }

Please see dgcctalk_app_demo.cpp for more information how to use the command.

Page 47: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 47 of 226

3.2.12 CCTALK_APP_ACCEPT_BILL: ACCEPT A BILL IN ESCROW POSITION

Definition #include <ccTalk.h>

#include <cctalk_app.h>

DG_ERROR cctalk_app_accept_bill(PDG_CCTALK_APP_EVT pEVT);

Parameters pEVT An event containing the link and address information for the

device which has had the bill inserted.

Description cctalk_app_accept_bill() causes a bill/note validator to accept into its stacker a bill which it currently has in the escrow position. This function may be called in response to the customer event handler receiving an event with the event code DG_CCTALK_APP_EVT_BILL_IN_ESCROW.

Errors DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER If pEVT is NULL or pEVT is not an event an

event notifiying that a bill is in the escrow position.

Notes None.

Example

#include <connector_sdk.h> #include <ccTalk.h> #include <cctalk_app.h> using namespace __CONNECTOR_SDK; void my_event_handler(PDG_CCTALK_APP_EVT *pEVT) { DG_ERROR iError; switch (pEVT->eEventCode) { case DG_CCTALK_APP_EVT_BILL_IN_ESCROW: if (pEVT->iBillAmount >= 1000) // $10/£10 iError = cctalk_app_accept_bill(pEVT);

Page 48: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 48 of 226

else iError = cctalk_app_reject_bill(pEVT); } if (!DG_IS_SUCCESS(iError)) { // Error handling } }

Please see dgcctalk_app_demo.cpp for more information how to use the command.

Page 49: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 49 of 226

3.2.13 CCTALK_APP_REJECT_BILL: REJECT A BILL IN ESCROW POSITION

Definition #include <ccTalk.h>

#include <cctalk_app.h>

DG_ERROR cctalk_app_reject_bill(PDG_CCTALK_APP_EVT pEVT);

Parameters pEVT An event containing the link and address information for the

device which has had the bill inserted.

Description cctalk_app_accept_bill() causes a bill/note validator to reject (returning it to the customer) a bill which it currently has in the escrow position. This function may be called in response to the customer event handler receiving an event with the event code DG_CCTALK_APP_EVT_BILL_IN_ESCROW.

Errors DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER If pEVT is NULL or pEVT is not an event an

event notifiying that a bill is in the escrow position.

Notes None.

Example Please see preceding example for cctalk_app_accept_bill(). Also see dgcctalk_app_demo.cpp for more information how to use the command.

Page 50: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 50 of 226

3.2.14 CCTALK_APP_LOAD_BILL_TABLE: LOAD A NEW BILL TABLE

Definition #include <ccTalk.h>

#include <cctalk_app.h>

DG_ERROR cctalk_app_load_bill_table(PDG_CCTALK_APP_EVT pEVT,

char *szFilepath);

Parameters pEVT An event containing the link and address information for the

device which is to have a new note-table programmed.

szFilepath The location of the note table file.

Description cctalk_app_load_bill_table() causes a bill/note validator to have a new bill table programmed. When the programming is completed successfully, the device is reset and an event of type DG_CCTALK_APP_EVT_BILTABLE_LOADED is delivered. If the programming fails then an event of type DG_CCTALK_APP_EVT_BILTABLE_FAILED is delivered.

Errors DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER If either of pEVT or szFilepath is NULL. DGERROR_NOTSUPPORTED This operation is not supported by the target

device.

Notes None.

Page 51: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 51 of 226

3.2.15 CCTALK_APP_LOAD_FIRMWARE: LOAD NEW DEVICE FIRMWARE

Definition #include <ccTalk.h>

#include <cctalk_app.h>

DG_ERROR cctalk_app_load_firmware(PDG_CCTALK_APP_EVT pEVT,

char *szFilepath);

Parameters pEVT An event containing the link and address information for the

device which is to have a new note-table programmed.

szFilepath The location of the note table file.

Description cctalk_app_load_firmware() causes a device with programmable firmnware to have a new firmware programmed. When the programming is completed successfully, the device is reset and an event of type DG_CCTALK_APP_EVT_FIRMWARE_LOADED is delivered. If the programming fails then an event of type DG_CCTALK_APP_EVT_FIRMWARE_FAILED is delivered.

Errors DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER If either of pEVT or szFilepath is NULL. DGERROR_NOTSUPPORTED This operation is not supported by the target

device.

Notes None.

Page 52: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 52 of 226

3.2.16 CCTALK_APP_GET_MONEY_IN: RETURN HOW MUCH CURRENCY HAS BEEN ACCEPTED

Definition #include <ccTalk.h>

#include <cctalk_app.h>

DG_ERROR cctalk_app_get_money_in(PDG_CCTALK_APP_EVT pEVT,

int *piTotal);

Parameters pEVT An event containing the link and address information for the

device whose money-in count is to be received, or NULL

piTotal A pointer to an integer which will have the amount of currency received place into it. This parameter may not be NULL.

Description cctalk_app_get_money_in() returns the amount of currency accepted by the device in the memory pointed to by piTotal.

If pEVT is NULL, then a total for all detected devices is returned.

Errors DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER If pEVT is NULL. DGERROR_NOTSUPPORTED If the device pointed to by pEVT is not a device

which accepts currency.

Notes None.

Example

#include <connector_sdk.h> #include <ccTalk.h> #include <cctalk_app.h> using namespace __CONNECTOR_SDK; void my_event_handler(PDG_CCTALK_APP_EVT *pEVT) { DG_ERROR iError; int iMoneyIn;

Page 53: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 53 of 226

switch (pEVT->eEventCode) { case DG_CCTALK_APP_EVT_BILL_IN_STACKER: iError = cctalk_app_get_money_in(pEVT, &iMoneyIn); printf(“Accept currency to value %d\n”, pEVT->iBillAmount); if (!DG_IS_SUCCESS(iError)) { // Error handling } printf(“Total accepted currency now %d\n”, iMoneyIn); } }

Please see dgcctalk_app_demo.cpp for more information how to use the command.

Page 54: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 54 of 226

3.2.17 CCTALK_APP_CLEAR_MONEY_IN: CLEAR THE ACCOUNT OF MONEY ACCEPTED

Definition #include <ccTalk.h>

#include <cctalk_app.h>

DG_ERROR cctalk_app_clear_money_in(PDG_CCTALK_APP_EVT pEVT);

Parameters pEVT An event containing the link and address information for the

device whose money-in count is to be received, or NULL

Description cctalk_app_clear_money_in() clear the record of currency accepted by the device. If pEVT is NULL then the account of money in for all devices is cleared.

Errors DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER If pEVT is NULL or pEVT is not an event an

event notifiying that a bill is in the escrow position.

DGERROR_NOTSUPPORTED If the device pointed to by pEVT is not a device which accepts currency.

Notes None.

Page 55: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 55 of 226

3.2.18 CCTALK_APP_GET_CURRENCY_REVISION: RETURN AN IDENTIFIER FOR THE CURRENT BILL TABLE

Definition #include <cctalk_app.h>

DG_ERROR cctalk_app_get_currency_revision(

PDG_CCTALK_APP_EVT pEVT,

char *pBuffer,

unsigned int uiBufferLen);

Parameters pEVT An event containing the link and address information for the

device whose money-in count is to be received.

pBuffer A buffer into which will be placed a string identifying the currently loaded bill-table

uiBufferLen The size of the buffer pBuffer. No more than uiBufferLen characters (including a NUL-terminator) will be placed in the memory pointed to by pBuffer.

Description cctalk_app_get_currency_revision() returns a string describing the bill table currently programmed into a bill/note validator. This is string is formed as follows:

• request the general currency revision (ccTalk command #145)’

• request the currency specification ID (ccTalk command #91);

• strip trailing spaces from the specification ID and change \ to –;

• suffix a ‘/’ then the general currency revision onto the end of the specification ID.

For example, EURUUS-001/001.

Errors DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER If pEVT is NULL. DGERROR_NOTSUPPORTED If the device pointed to by pEVT is not a device

which accepts currency.

Page 56: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 56 of 226

Notes None.

Example

#include <connector_sdk.h> #include <ccTalk.h> #include <cctalk_app.h> using namespace __CONNECTOR_SDK; void my_event_handler(PDG_CCTALK_APP_EVT *pEVT) { DG_ERROR iError; char buf[64]; switch (pEVT->eEventCode) { case DG_CCTALK_APP_EVT_FOUND_DEVICE: iError = cctalk_app_get_currency_revision(pEVT, buf, sizeof(buf)); printf(“Currency revision: %s\n”, buf); } }

Please see dgcctalk_app_demo.cpp for more information how to use the command.

Page 57: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 57 of 226

3.2.19 CCTALK_APP_GET_NUMBER_BILLS: RETURN HOW MANY BILLS ARE PROGRAMMED

Definition #include <ccTalk.h>

#include <cctalk_app.h>

DG_ERROR cctalk_app_get_money_in(PDG_CCTALK_APP_EVT pEVT,

int *piNBills);

Parameters pEVT An event containing the link and address information for the

device whose money-in count is to be received.

piNBills A pointer to an integer which will have placed in it the maximum number of programmed bill types supported by the bill/note validator identified by pEVT.

Description cctalk_app_get_number_bills() returns the maximum number of bills that can be programmed into the device identified by pEVT. Note that this may be different from the number of bills defined in the bill/note table currently programmed into the target device.

Errors DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER If pEVT is NULL. DGERROR_NOTSUPPORTED If the device pointed to by pEVT is not a device

which accepts currency.

Notes None.

Example

#include <connector_sdk.h> #include <ccTalk.h> #include <cctalk_app.h> using namespace __CONNECTOR_SDK; void my_event_handler(PDG_CCTALK_APP_EVT *pEVT) { DG_ERROR iError;

Page 58: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 58 of 226

int iMaxBills; switch (pEVT->eEventCode) { case DG_CCTALK_APP_EVT_FOUND_DEVICE: iError = cctalk_app_get_number_bills(pEVT, &iMaxBills); printf(“Device supports up to %d bills\n”, iMaxBills); } }

Please see dgcctalk_app_demo.cpp for more information how to use the command.

Page 59: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 59 of 226

3.2.20 CCTALK_APP_GET_BILL_INFO: RETURN INFORMATION ON A SPECIFIED BILL

Definition #include <ccTalk.h>

#include <cctalk_app.h>

typedef struct _DG_CCTALK_BILL_INFO {

char CountryCode[2];

unsigned short ushScalingFactor;

char chIssueCode; } DG_CCTALK_BILL_INFO, *PDG_CCTALK_BILL_INFO

DG_ERROR cctalk_app_get_bill_info(PDG_CCTALK_APP_EVT pEVT,

int iBillNo,

PDG_CCTALK_BILL_INFO pBillInfo);

Parameters pEVT An event containing the link and address information for the

device whose money-in count is to be received.

iBillNo The bill number on which information is to be returned. This is a number between 0 and MAX_BILLs (as returned by cctalk_app_get_number_bills()).

pBillInfo A pointer to some memory into which will be placed information on the bill at position iBillNo in the bill table.

Description cctalk_app_get_bill_info() returns the specific information about a chosen bill in the programmed bill table.

Note that in the structure returned, the ushScalingFactor member is set to the value of the bill value from the ccTalk information returned by ccTalk command #157 multiplied by the scaling factor for the country code named in the bill (this is returned by ccTalk command #156).

Errors DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER If pEVT is NULL, iBillNo is not in the allowed

range or pBillInfo is NULL. DGERROR_NOTSUPPORTED If the device pointed to by pEVT is not a device

Page 60: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 60 of 226

which accepts currency.

Notes None.

Example

#include <connector_sdk.h> #include <ccTalk.h> #include <cctalk_app.h> using namespace __CONNECTOR_SDK; void my_event_handler(PDG_CCTALK_APP_EVT *pEVT) { DG_ERROR iError; int iMaxBills, iBillNo; switch (pEVT->eEventCode) { case DG_CCTALK_APP_EVT_FOUND_DEVICE: iError = cctalk_app_get_number_bills(pEVT, &iMaxBills); for (iBillNo = 0; iBillNo < iMaxBills; iBillNo++) { DG_CCTALK_BILL_INFO sBillInfo; iError = cctalk_app_get_bill_info(pEVT, iBillNo, &sBillInfo); if (!DG_IS_SUCCESS(iError)) { // error handling... } printf(“Bill #%d is country %c%c value %d, issue %c\n”, sBillInfo.CountryCode[0], sBillInfo.CountryCode[1], sBillInfo.ushScalingFactor, sBillInfo.chIssueCode); } } }

Please see dgcctalk_app_demo.cpp for more information how to use the command

Page 61: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 61 of 226

3.3 CCTALK NATIVE API: COMMANDS AND REQUESTS

These commands are complementary to the application layer API functions and may be used to effect additional control of the devices connected to your main-board hardware.

3.3.1 CCTALK_OPEN_LINK: OPEN LINK CONNECTION

Definition DG_ERROR cctalk_open_link(IN char* pInitString,

IN unsigned char uchHostAddress,

IN DGT_CCTALK_CRC uchCRCType,

OUT int *piHandle);

Parameters pInitString A pointer to NULL terminated string, which specifies the

initialization parameters. The initialization string has the following format: <link library>: <link library init parameters>

Where

Link library – The link library file name.

Link library_init_parameters – The parameters passed to the link library.

uchHostAddress The address of the ccTalk device to establish the communication with.

uchCRCType The valiable defines the CRC calculation type that will be used to validate the integrity of sent and received data. The possible values are: DG_CCTALK_CRC_8_BIT and DG_CCTALK_CRC_16_BIT

piHandle A pointer to int variable where the function stores a handle value to the opened link.

Description The function establishes a link and returns a handle, which is used by other functions of the library. This is the first function that must be used in order to use any other functions provided by the library.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

Page 62: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 62 of 226

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid.

Notes If the physical connection has already been established by another thread then the function returns a handle but ignores the specified link library initialization parameters.

This function should not be used if the ccTalk application layer has been initialized and the same port has been added using cctalk_app_add_link().

Example

#include <connector_sdk.h> #include <ccTalk.h> using namespace __CONNECTOR_SDK; DG_ERROR iResult; int iHandle; //Linux init string char chInitStr[]=”rs:port=/dev/ttyS0,baudrate=9600,bytesize=8,stopbit=1,parity=no”; //Windows init string char chInitStr[]=”rs:port=com1,baudrate=9600,bytesize=8,stopbit=1,parity=no”; iResult = cctalk_open_link (chInitStr, 3, DG_CCTALK_CRC_8_BIT, &iHandle); if(DG_IS_SUCCESS(iResult)) { //Success }

Please see dgcctalk_demo.cpp for more information how to use the command.

Page 63: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 63 of 226

3.3.2 CCTALK_CLOSE_LINK: CLOSE LINK CONNECTION.

Definition void cctalk_close_link(IN int iHandle);

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function.

Description The function closes the established link connection when it is not needed anymore.

Notes If the physical connection is still used by other threads then it still stays open until all the threads call the close function.

Please see dgcctalk_demo.cpp for more information on how to use the command.

Page 64: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 64 of 226

3.3.3 CCTALK_CMD_SIMPLE_POLL: SIMPLE POLL (254)

Definition DG_ERROR cctalk_cmd_simple_poll(IN int iHandle,

IN unsigned char uchDstAddress)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the device to poll.

Description The function is used to check if the slave device is powered up and working. The command implements header 254.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Please see dgcctalk_demo.cpp for more information how to use the command.

Page 65: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 65 of 226

3.3.4 CCTALK_CMD_ADDRESS_POLL: ADDRESS POLL (253)

Definition DG_ERROR cctalk_cmd_address_poll(IN int iHandle,

IN unsigned char* pAddressList,

IN unsigned int uiAddressListSize,

OUT unsigned int *puiDataReceived);

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. pAddressList Pointer to a buffer which will hold an address list of

the connected devices. uiAddressListSize The length of the provided address list buffer. puiDataReceived Pointer to an integer variable where the function returns

the number of the devices that replied to the request.

Description The function is used to determine which devices are connected to the bus by requesting that all attached devices return their address. The function implements command header 253.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle.

Please see dgcctalk_demo.cpp for more information how to use the command.

Page 66: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 66 of 226

3.3.5 CCTALK_CMD_ADDRESS_CLASH: ADDRESS CLASH (252)

Definition DG_ERROR cctalk_cmd_address_clash(

IN int iHandle,

IN unsigned char* pAddressList,

IN unsigned int uiAddressListSize,

OUT unsigned int *puiDataReceived);

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. pAddressList Pointer to a buffer which will hold an address list of all the

devices that replied. uiAddressListSize The length of the provided address list buffer. puiDataReceived Pointer to an integer variable where the function returns

the number of the devices that replied to the request.

Description The function is used to determine if one or more devices share the same address. The function implements command header 252.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle.

Please see dgcctalk_demo.cpp for more information how to use the command.

Page 67: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 67 of 226

3.3.6 CCTALK_CMD_ADDRESS_CHANGE: ADDRESS CHANGE (251)

Definition DG_ERROR cctalk_cmd_address_change(

IN int iHandle,

IN unsigned char uchDstAddress,

unsigned char uchNewAddress);

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the device that should execute the command. uchNewAddress The new address value that the device should respond to.

Description The function is used to change the address of a device to the specified new value. The command implements header 251.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_TIMEOUT The addressed device did not reply. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle.

Please see dgcctalk_demo.cpp for more information how to use the command.

Page 68: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 68 of 226

3.3.7 CCTALK_CMD_ADDRESS_RANDOM: ADDRESS RANDOM (250)

Definition DG_ERROR cctalk_cmd_address_random(

IN int iHandle,

IN unsigned char uchDstAddress)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the device that should execute the command.

Description The function is used to change the address of a device to random value. This is the escape route when one or more devices share the same address. The command implements header 250.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle.

Please see dgcctalk_demo.cpp for more information how to use the command.

Page 69: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 69 of 226

3.3.8 CCTALK_REQ_POLLING_PRIORITY: REQUEST POLLING PRIORITY (249)

Definition DG_ERROR cctalk_req_polling_priority(

IN int iHandle,

IN unsigned char uchDstAddress,

OUT PDG_POLL_PRIORITY pPollPriority)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the device to poll. pPollingPriority Pointer to DG_POLL_PRIORITY structure where the

polling information is returned. The pPollPriority->Units member specifies the polling units. The following values are permitted:

DG_CCTALK_PP_UNSPECIFIED DG_CCTALK_PP_MS DG_CCTALK_PP_10MS DG_CCTALK_PP_SECONDS DG_CCTALK_PP_MINUTES DG_CCTALK_PP_HOURS DG_CCTALK_PP_DAYS DG_CCTALK_PP_WEEKS DG_CCTALK_PP_MONTHS DG_CCTALK_PP_YEARS

Description The function reads the recommended polling interval for buffered credit information. Polling a device at an interval longer than this may result in lost credits.

If pPollPriority->Units = DG_CCTALK_PP_UNSPECIFIED and pPollPriority->uchValue = 0 then refer to the product manual for polling information If pPollPriority->Units = DG_CCTALK_PP_UNSPECIFIED and pPollPriority->uchValue = 255 then the device uses a hardware REQUEST POLL line

The implemented command header is 249

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation.

Page 70: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 70 of 226

DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Please see dgcctalk_demo.cpp for more information how to use the command.

Page 71: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 71 of 226

3.3.9 CCTALK_REQ_STATUS: REQUEST STATUS (248)

Definition DG_ERROR cctalk_req_status(IN int iHandle,

IN unsigned char uchDstAddress,

OUT DGT_CCTALK_CA_STATUS *pAcceptorStatus)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device . pAcceptorStatus Pointer to DGT_CCTALK_CA_STATUS variable where the

function returns the status of a coin acceptor. The following are valid:

DG_CCTALK_CA_OK DG_CCTALK_CA_DECK_OPEN DG_CCTALK_CA_COS_ACTIVATED

Description The function reports the status of a coin acceptor.

The implemented command header is 248

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Please see dgcctalk_demo.cpp for more information how to use the command.

Page 72: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 72 of 226

3.3.10 CCTALK_REQ_VARIABLE_SET: REQUEST VARIABLE SET (247)

Definition DG_ERROR cctalk_req_variable_set(IN int iHandle,

IN unsigned char uchDstAddress,

IN char* pBuffer,

IN unsigned int uiBufferLen,

OUT unsigned int *puiDataLen)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pBuffer The buffer where the received data is stored. uiBufferLen The size of the provided buffer in bytes. puiDataLen A pointer to a variable where the number of received bytes is

returned.

Description The function is used to read a set of variables from the slave device. The number of variables is determined by the hardware manufacture. The command implements header 247.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Please see dgcctalk_demo.cpp for more information how to use the command.

Page 73: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 73 of 226

3.3.11 CCTALK_REQ_MANUFACTURE: REQUEST MANUFACTURE ID (246)

Definition DG_ERROR cctalk_req_manufacture(

IN int iHandle,

IN unsigned char uchDstAddress,

IN char* pBuffer,

IN unsigned int uiBufferLen,

OUT unsigned int *puiDataLen)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pBuffer The buffer where the received data is stored. uiBufferLen The size of the provided buffer in bytes. puiDataLen A pointer to a variable where the number of received bytes is

returned.

Description The function is used to read the unique device's manufacture name. The command implements header 246.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Please see dgcctalk_demo.cpp for more information how to use the command.

Page 74: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 74 of 226

3.3.12 CCTALK_REQ_CATEGORY_ID: REQUEST EQUIPMENT CATEGORY ID (245)

Definition DG_ERROR cctalk_req_category_id(

IN int iHandle,

IN unsigned char uchDstAddress,

IN char* pBuffer,

IN unsigned int uiBufferLen,

OUT unsigned int *puiDataLen)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pBuffer The buffer where the received data is stored. uiBufferLen The size of the provided buffer in bytes. puiDataLen A pointer to a variable where the number of received bytes is

returned.

Description The function is used to read the standard equipment category identification string. The command implements header 245.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Please see dgcctalk_demo.cpp for more information how to use the command.

Page 75: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 75 of 226

3.3.13 CCTALK_REQ_PRODUCT_CODE: REQUEST PRODUCT CODE (244)

Definition DG_ERROR cctalk_req_product_code(

IN int iHandle,

IN unsigned char uchDstAddress,

IN char* pBuffer,

IN unsigned int uiBufferLen,

OUT unsigned int *puiDataLen)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pBuffer The buffer where the received data is stored. uiBufferLen The size of the provided buffer in bytes. puiDataLen A pointer to a variable where the number of received bytes is

returned.

Description The function is used to read the product code. The command implements header 244.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Please see dgcctalk_demo.cpp for more information how to use the command.

Page 76: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 76 of 226

3.3.14 CCTALK_REQ_DATABASE_VERSION: REQUEST DATABASE VERSION (243)

Definition DG_ERROR cctalk_req_database_version(

IN int iHandle,

IN unsigned char uchDstAddress,

OUT unsigned char *pCDBVersion)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pCDBVersion Pointer to unsigned char variable where the function returns

the database version. The valid values are 0 to 255.

Description The function retrieves a database number from 1 to 255 which may be used for remote coin programming. A database number of 0 indicates remote coin programming is not possible.

The implemented command header is 243.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Please see dgcctalk_demo.cpp for more information how to use the command.

Page 77: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 77 of 226

3.3.15 CCTALK_REQ_SERIAL_NUMBER: REQUEST SERIAL NUMBER (242)

Definition DG_ERROR cctalk_req_serial_number(

IN int iHandle,

IN unsigned char uchDstAddress,

OUT PDG_SERIAL pSerialNumber)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pSerialNumber A pointer to DG_SERIAL structure where the serial number

is returned.

Description The function is used to read the device’s serial number. The command implements header 242.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 78: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 78 of 226

3.3.16 CCTALK_REQ_SOFTWARE_VERSION: REQUEST SOFTWARE VERSION (241)

Definition DG_ERROR cctalk_req_software_version(

IN int iHandle,

IN unsigned char uchDstAddress,

IN char* pBuffer,

IN unsigned int uiBufferLen,

OUT unsigned int *puiDataLen)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pBuffer The buffer where the received data is stored. uiBufferLen The size of the provided buffer in bytes. puiDataLen A pointer to a variable where the number of received bytes is

returned.

Description The function is used to read the slave device’s software revision. The command implements header 241.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 79: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 79 of 226

3.3.17 CCTALK_CMD_TEST_SOLENOIDS: TEST SOLENOIDS (240)

Definition DG_ERROR cctalk_cmd_test_solenoids(IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchSolenoidMask)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. uchSlenoidMask The solenoid bit mask. The mask can be combined from the

following valid flag values:

DG_CCTALK_FL_GATE_SOLENOID DG_CCTALK_FL_SORTER_SOLENOID1 DG_CCTALK_FL_SORTER_SOLENOID2 DG_CCTALK_FL_SORTER_SOLENOID3

Description The function send command to a coin acceptor which in responds pulses the solenoids for a set time. The bit mask indicates which solenoids to operate.

The command implements header 240.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 80: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 80 of 226

3.3.18 CCTALK_CMD_TEST_OUTPUT_LINES: TEST OUTPUT LINES (238)

Definition DG_ERROR cctalk_cmd_test_output_lines(IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchOLinesMask)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. uchOLinesMask The output lines bit mask. 0-no action, 1-pulse.

Description The function send command to a coin acceptor which in responds pulses the output lines for a set time. The bit mask indicates which lines to pulse. The length of the pulses is product specific.

The command implements header 238.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 81: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 81 of 226

3.3.19 CCTALK_REQ_INPUT_LINES_STATE: READ INPUT LINES (237)

Definition DG_ERROR cctalk_req_input_lines_state(

IN int iHandle,

IN unsigned char uchDstAddress,

IN char* pBuffer,

IN unsigned int uiBufferLen,

OUT unsigned int *puiDataLen)

iHandle A valid handle value that was returned by cctalk_open_link function.

uchDstAddress The address of the slave device. pBuffer Address of buffer where the function returns the recevied

data. uiBufferLen The length of the provided buffer. puiDataLen Pointer to the variable where the number of read bytes is

returned.

Description The command is implemented on slave devices which have an input port. This command requests various input data from a slave device and is an excellent debugging tool. It can be used to check the operation of switches, push buttons, connector signals, processor input lines etc. Refer to the product manual for more details.

The command implements header 237.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Page 82: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 82 of 226

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 83: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 83 of 226

3.3.20 CCTALK_REQ_OPTO_STATE: REQUEST OPTO STATE (236)

Definition DG_ERROR cctalk_req_opto_state(IN int iHandle,

IN unsigned char uchDstAddress,

OUT char *puchBitMask)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the device to poll. puchBitMask A pointer to a variable where an opto mask is returned.

Description The function is used to check the state of various opto devices in the slave device. The command implements header 236.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Page 84: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 84 of 226

3.3.21 CCTALK_CMD_LATCH_OUTPUT_LINES: LATCH OUTPUT LINES (233)

Definition DG_ERROR cctalk_cmd_latch_output_lines (IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchOLinesMask)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. uchOLinesMask The output lines bit mask. 0-no action, 1-pulse.

Description Implemented on slave devices which have an output port. Various output lines are latched. The bit mask indicates which lines to latch. Polarities and bit mask interpretation will be detailed in the product manual.

The command implements header 233.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 85: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 85 of 226

3.3.22 CCTALK_REQ_SELF_TEST: PERFORM SELF-TEST (232)

Definition DG_ERROR cctalk_req_self_test(

IN int iHandle,

IN unsigned char uchDstAddress,

OUT PDG_FAULT_CODE pFaultCode)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pFaultCode Pointer to DG_FAULT_CODE variable where the fault code

is returned.

Description This command instructs the peripheral device to perform a self-check, i.e. a full diagnostic test without user intervention. The actual level of testing is decided by the slave rather than the host and a fault code is returned. Some slave devices support an additional byte of information for certain fault codes. Where more than one fault exists on a product, faults will be reported in priority order. Once one fault is fixed, the next fault will be reported. The time to execute this command should be made clear in the product manual.

The command implements header 232.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 86: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 86 of 226

3.3.23 CCTALK_CMD_MODIFY_INHIBIT_STATUS: MODIFY INHIBIT STATUS (231)

Definition DG_ERROR cctalk_cmd_modify_inhibit_status (

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned short ushEnableMask)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. ushEnableMask The variable which contains the enable coins/bills mask. You

can use DG_CCTALK_FL_COIN(CoinNmb) macro to specify which coin/bill to enable. For example: DG_CCTALK_FL_COIN(0) – enable coin/bill 1, DG_CCTALK_FL_COIN(1) + DG_CCTALK_FL_COIN(10) – enable coins/bills 2 and 11. The maximum CoinNmb value is 15.

Description The function sends an individual inhibit pattern to a coin acceptor or bill validator. With a 2 byte inhibit mask, up to 16 coins or bills can be inhibited or enabled.

• 0 = coin / bill disabled ( inhibited )

• 1 = coin / bill enabled ( not inhibited ) The product manual should make clear whether these changes are permanent ( stored in non- volatile memory ) or temporary ( stored in RAM ).

The command implements header 231.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Page 87: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 87 of 226

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 88: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 88 of 226

3.3.24 CCTALK_CMD_MODIFY_INHIBIT_STATUS_BUFFER: MODIFY INHIBIT STATUS BUFFER (231)

Definition DG_ERROR cctalk_cmd_modify_inhibit_status_buffer(

IN int iHandle,

IN unsigned char uchDstAddress,

IN PDG_CCTALK_COPY_BUFFER pEnableMask)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pEnableMask Pointer to DG_CCTALK_COPY_BUFFER structure which

holds information about user specified buffer. The buffer contain required inhibit infomraion and number of bytes in the buffer.

Description The function is the same as cctalk_cmd_modify_inhibit_status but some devices can accept more than two bytes data. Therefore structure DG_CCTALK_COPY_BUFFER is used to transmit variable sized information. The structure is defined as follows:

typedef struct _DG_CCTALK_COPY_BUFFER { void *pBufferPtr; unsigned int uiBufferSize; unsigned int uiDataCopied; } DG_CCTALK_COPY_BUFFER, *PDG_CCTALK_COPY_BUFFER;

where pBufferPtr Pointer to user allocated buffer which holds inhibit masks. uiBufferSize Size of the user allocated buffer. uiDataCopied Unused.

The command implements header 231.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

Page 89: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 89 of 226

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 90: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 90 of 226

3.3.25 CCTALK_REQ_INHIBIT_STATUS: REQUEST INHIBIT STATUS (230)

Definition DG_ERROR cctalk_req_inhibit_status (

IN int iHandle,

IN unsigned char uchDstAddress,

OUT unsigned short* pEnableMask)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pEnableMask Pointer to unsigned short variable where the coins/bills

inhibit status mask is returned.

Description The function requests an individual inhibit pattern from a coin acceptor or bill validator. Please see cctalk_cmd_modify_inhibit_status for more information.

The function implements header command 230.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 91: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 91 of 226

3.3.26 CCTALK_REQ_INHIBIT_STATUS_BUFFER: REQUEST INHIBIT STATUS BUFFER (230)

Definition DG_ERROR cctalk_req_inhibit_status_buffer(

IN int iHandle,

IN unsigned char uchDstAddress,

OUT PDG_CCTALK_COPY_BUFFER pEnableMask)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pEnableMask Pointer to DG_CCTALK_COPY_BUFFER structure which

holds information about user specified buffer. When the function returns the variable also contains the number of copied bytes.

Description The function is the same as cctalk_req_inhibit_status but some devices return more than two bytes data. Therefore structure DG_CCTALK_COPY_BUFFER was introduced to receive variable size information. The structure is defined as follows:

typedef struct _DG_CCTALK_COPY_BUFFER { void *pBufferPtr; unsigned int uiBufferSize; unsigned int uiDataCopied; } DG_CCTALK_COPY_BUFFER, *PDG_CCTALK_COPY_BUFFER;

where pBufferPtr Pointer to user allocated buffer. uiBufferSize Size of the user allocated buffer. uiDataCopied Number of bytes that have been copied into the buffer.

The command implements header 230.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation.

Page 92: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 92 of 226

DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 93: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 93 of 226

3.3.27 CCTALK_REQ_EVENTS: READ BUFFERED CREDIT OR ERROR CODES (229)

Definition DG_ERROR cctalk_req_events(IN int iHandle,

IN unsigned char uchDstAddress,

IN PDG_CREDIT_EVENT pEvents)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pEvents Pointer to DG_CREDIT_EVENT structure where the function

returns credit and error codes events information.

Description The function returns a past history of event codes for a coin acceptor in a small data buffer. This allows a host device to poll a coin acceptor at a rate lower than that of coin insertion and still not miss any credits or other events.validator.

The DG_CREDIT_EVENT structure has the following definition:

typedef struct _DG_CREDIT_EVENT { unsigned int uiEventCnt; struct _DG_EVENT { DGT_EVENT_TYPE Type; union _DG_EVENT_ENTRY { struct _DG_CREDIT_ENTRY { unsigned short ushCoin; unsigned short ushSorterPath; } Credit; DGT_CCTALK_EVT_ERROR_CODE ErrorCode; } Event; } Events[DG_CCTALK_EVENTLIST_SIZE]; } DG_CREDIT_EVENT, *PDG_CREDIT_EVENT;

If the Type member of the _DG_EVENT structure is set to DG_CCTALK_EVT_CREDIT then the relevant information should be accessed using Credit member of the _DG_EVENT_ENTRY union. If the Type member is set to DG_CCTALK_EVT_ERROR then the ErrorCode member of the _DG_EVENT_ENTRY union contains the error code.

The function implements header command 229.

Page 94: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 94 of 226

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 95: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 95 of 226

3.3.28 CCTALK_CMD_MASTER_INHIBIT_STATUS :MODIFY MASTER INHIBIT STATUS (228)

Definition DG_ERROR cctalk_cmd_master_inhibit_status(

IN int iHandle,

IN unsigned char uchDstAddress,

IN DGT_CCTALK_INHIBIT_STATUS InhibitStatus)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. InhibitStatus The variable specifies the new inhibit status. The value

DGT_CCTALK_INHIBIT_ENABLED enables the inhibit status where no coins or bills are accepted. The value DGT_CCTALK_INHIBIT_DISABLED returns the device into normal mode of operation.

Description The function changes the master inhibit status in the slave device. In a coin acceptor, if the master inhibit is active then no coins can be accepted. Likewise for a bill validator. The product manual sho uld make clear whether this change is permanent ( stored in non-volatile memory ) or temporary ( stored in RAM ).

The function implements header command 228.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 96: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 96 of 226

3.3.29 CCTALK_REQ_MASTER_INHIBIT_STATUS :REQUEST MASTER INHIBIT STATUS (227)

Definition DG_ERROR cctalk_reg_master_inhibit_status (

IN int iHandle,

IN unsigned char uchDstAddress,

IN DGT_CCTALK_INHIBIT_STATUS

*pInhibitStatus)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pInhibitStatus The pointer to a variable where the inhibit status is returned.

The value DG_CCTALK_INHIBIT_ENABLED specifies that the inhibit status is enabled - no coins or bills are accepted. The value DG_CCTALK_INHIBIT_DISABLED specifies that the device is functioning in normal mode of operation.

Description The function requests the master inhibit status in the slave device.

The function implements header command 227.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 97: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 97 of 226

3.3.30 CCTALK_REQ_INSERTION_COUNT :REQUEST INSERTION COUNT (226)

Definition DG_ERROR cctalk_req_insertion_count(

IN int iHandle,

IN unsigned char uchDstAddress,

OUT unsigned int* puiInsertedCount)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. puiInsertedCount The pointer to a variable where the total number of

coins/bills put through the device is returned..

Description This command returns the total number of coins / bills put through a device.

The function implements header command 226.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 98: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 98 of 226

3.3.31 CCTALK_REQ_ACCEPT_COUNT :REQUEST ACCEPT COUNT (225)

Definition DG_ERROR cctalk_reg_accept_count(

IN int iHandle,

IN unsigned char uchDstAddress,

OUT unsigned int puiAcceptCount)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. puiAcceptCount The pointer to a variable where the total number of

coins/bills accepted by the device is returned..

Description This command returns the total number of coins / bills accepted by a device.

The function implements header command 225.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 99: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 99 of 226

3.3.32 CCTALK_CMD_MODIFY_SORTER_STATUS: MODIFY SORTER OVERRIDE STATUS (222)

Definition DG_ERROR cctalk_cmd_modify_sorter_status(

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchOverrideMask)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. uchOverrideMask The sorter override bit mask.

Bit 0 - Sorter Path 1

.....................

Bit 7 - Sorter Path 8

1 - sorter override to a different or default path.

0 - no action, normal sorting

Use macro DG_CCTALK_FL_SORTER(PathNmb) to specify which sorter path needs overriding. You can also override several paths using ‘|’ or ‘+’ operators: DG_CCTALK_FL_SORTER(0) + DG_CCTALK_FL_SORTER(4).

Description This command allows the sorter override status to be set in a coin acceptor. Each bit represents a sorter path for the accepted coin. A bit set to 1 overrides that sorter path to another one ( possibly the default sorter path ). The product manual should make clear whether this change is permanent (stored in non-volatile memory ) or temporary ( stored in RAM ).

The command implements header 222.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid.

Page 100: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 100 of 226

DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to accommodate all of the received data.

DGERROR_LINK_CONFIG Failed to acquire access to the stream specified by the handle.

DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 101: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 101 of 226

3.3.33 CCTALK_REQ_SORTER_STATUS: REQUEST SORTER OVERRIDE STATUS (221)

Definition DG_ERROR cctalk_req_sorter_status (

IN int iHandle,

IN unsigned char uchDstAddress,

OUT unsigned char* puchOverrideMask)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. puchOverrideMask Address of a variable where the sorter override status mask

is returned. If a bit in the bit mask is set it means that the sorter path has an active override.

Description The command returns the sorter override status in a coin acceptor. Each bit represents a sorter path for the accepted coin. A zero means tha t the sorter path has an active override. Refer to the ‘cctalk_cmd_modify_sorter_status’ command for more details.

The command implements header 221.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 102: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 102 of 226

3.3.34 CCTALK_CMD_CHANGE_PIN_NUMBER: ENTER NEW PIN NUMBER (219)

Definition DG_ERROR cctalk_cmd_change_pin_number(

IN int iHandle,

IN unsigned char uchDstAddress,

IN PDG_PIN_NUMBER pPinNumber)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. pPinNumber A pointer to the DG_PIN_NUMBER structure, which

contains the new PIN number.

Description Certain commands can be PIN protected. The function allows to change the existing PIN number to a new one. This command is itself PIN protected so the existing PIN number should have been entered before this function is called. The command implements header 219.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 103: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 103 of 226

3.3.35 CCTALK_CMD_ENTER_PIN_NUMBER: ENTER PIN NUMBER (218)

Definition DG_ERROR cctalk_cmd_enter_pin_number(

IN int iHandle,

IN unsigned char uchDstAddress,

IN PDG_PIN_NUMBER pPinNumber)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. pPinNumber A pointer to the DG_PIN_NUMBER structure, which

contains the PIN number.

Description Certain commands can be PIN protected. The function allows to enter a PIN number so the PIN protected commands can be successfully executed. This has to be done after each power-up or reset. The command implements header 218.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 104: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 104 of 226

3.3.36 CCTALK_REQ_PAYOUT_LEVEL: REQUEST PAYOUT LEVEL (217)

Definition DG_ERROR cctalk_req_payout_level(

IN int iHandle,

IN unsigned char uchDstAddress,

IN short shHopperNumber,

OUT char *puchLevelPayout)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the device to poll. shHopperNumber A hopper number if multiple hoppers exist. Set this value to -

1 if only one hopper is connected. puchLevelPayout A pointer to a variable where the payout level is returned.

Description The function is used to read the high/low level sensors in a payout system. The command implements header 217.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Page 105: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 105 of 226

3.3.37 CCTALK_REQ_DATA_STORAGE_INFO: REQUEST DATA STORAGE AVAILABILITY (216)

Definition DG_ERROR cctalk_req_data_storage_info(

IN int iHandle,

IN unsigned char uchDstAddress,

OUT PDG_STORAGE_INFO pStorage)

typedef struct

{

unsigned int uiReadBlocks;

unsigned int uiReadBlockSize;

unsigned int uiWriteBlocks;

unsigned int uiWriteBlockSize; } DG_STORAGE_INFO, *PDG_STORAGE_INFO;

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the device to poll. pStorage A pointer to DG_STORAGE_INFO structure where the

memory information is stored. The MemoryType member of the structure specifies the type of storage provided by the slave device:

DG_CCTALK_MEM_VOL_RESET – Volitile memory that loses data on reset.

DG_CCTALK_MEM_VOL_POWER – Volitile memory that loses data on power down.

DG_CCTALK_MEM_PERM_LIMITED – Permanent memory but of limited use.

DG_CCTALK_MEM_PERM_UNLIMITED – Permanent memory.

Description Some slave devices allow host data to be stored for whatever reason. The function is used to determine whether this service is provided. The command implements header 216.

Note that this function corrects the block count to be 256 when the raw ccTalk data is zero, as per the special case notes in the ccTalk Generic Specification, section 3.40.

Page 106: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 106 of 226

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Page 107: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 107 of 226

3.3.38 CCTALK_CMD_READ_DATA_BLOCK :READ DATA BLOCK (215)

Definition DG_ERROR cctalk_cmd_read_data_block (

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchBlockNumber,

IN char* pData,

IN unsigned int uiDataLen,

OUT unsigned int* puiDataRead)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. uchBlockNumber The block to write the data to. pData Pointer to the buffer where the data is read to. uiDataLen The size of the provided buffer. puiDataRead Pointer to a variable where the number of read bytes is

copied into.

Description Some slave devices allow host data to be stored for whatever reason. This function allows to read the data from a slave device. The function read data in blocks and returns the number of read bytes.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Page 108: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 108 of 226

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 109: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 109 of 226

3.3.39 CCTALK_CMD_WRITE_DATA_BLOCK :WRITE DATA BLOCK (214)

Definition DG_ERROR cctalk_cmd_write_data_block (

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchBlockNumber,

IN char* pData,

IN unsigned int uiDataLen)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. uchBlockNumber The block to write the data to. pData Pointer to the buffer which contains the data. uiDataLen The number of byte to write from the specified buffer.

Description Some slave devices allow host data to be stored for whatever reason. This function allows to write the data into a slave device. The command implements header 214.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Please see dgcctalk_demo.cpp for more information how to use the command.

Page 110: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 110 of 226

3.3.40 CCTALK_REQ_OPTION_FLAGS :REQUEST OPTION FLAGS (213)

Definition DG_ERROR cctalk_req_option_flags(

IN int iHandle,

IN unsigned char uchDstAddress,

OUT unsigned char* puchOFlags)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. puchOFlags Pointer to a variable where the function stores the option

flags.

Description The command reads option flags ( single bit control variables ) rom a slave device. If the slave device is a bill validator then the following macros can be used to test check the supported features:

DG_CCTALK_FL_OP_STACKER - Stacker

DG_CCTALK_FL_OP_ESCROW - Escrow

DG_CCTALK_FL_OP_ACCEPT_COUNTERS - Individual bill accept counters.

DG_CCTALK_FL_OP_ERROR_COUNTERS - Individual error counters.

DG_CCTALK_FL_OP_NONVOLIT_COUNTERS- Non-volitile counters.

DG_CCTALK_FL_OP_BILL_TEACH - Bill teach facility.

DG_CCTALK_FL_OP_BILL_SECURITY - Bill security tuning.

DG_CCTALK_FL_OP_BILL_PROGRAMMING - Remote bill programming.

If the slave device is a coin acceptore then following macro can be used to test the options:

DG_CCTALK_FL_OP_CVF - Credit Code Format is in Coin Value format.

Please refer to ‘ccTalk Generic specification’ for further information.

The command implements header 213.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

Page 111: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 111 of 226

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 112: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 112 of 226

3.3.41 CCTALK_REQ_COIN_POSITION :REQUEST COIN POSITION (212)

Definition DG_ERROR cctalk_req_coin_position (

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchCreditCode,

OUT unsigned short *pushPosMask)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. uchCreditCode The value returned by the ‘Read buffered credit or error

codes’ command. pushPosMask Address of a variable where the coin position mask is

returned.

Description This command can be used in coin acceptors to locate the inhibit position of a given coin based on its ‘credit code’. The inhibit position ties up with the 'Modify inhibit status' command for inhibiting individual coins.

The command implements header 212.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 113: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 113 of 226

3.3.42 CCTALK_CMD_MODIFY_SORTER_PATH: MODIFY SORTER PATH (210)

Definition DG_ERROR cctalk_cmd_modify_sorter_path(

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchCoinPos,

IN PDG_COIN_SORTER_PATHS pCoinPaths)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. uchCoinPos The variable specifies the coin position. The valid values

are 1 to 16. pSorterPaths Pointer to PDG_CCTALK_SORTER_PATHS structure

which specifies the sorter path(s).

PDG_CCTALK_SORTER_PATHS.uchPathsLen - specifies the number of paths that should be transmitted to the slave device. The valid values are 1 and 4.

PDG_CCTALK_SORTER_PATHS.Paths[4] - The array where the sorter paths. The valid values for each element are 1 to 8.

Description This command modifies the sorter path for each coin position in a coin acceptor. Some coin acceptors support multiple sorter paths (override paths) so the DG_CCTALK_SORTER_PATHS.uchPathsLen member of the structure should specify the number of the paths (1 or 4).

The function implements header command 210.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data.

Page 114: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 114 of 226

DGERROR_LINK_CONFIG Failed to acquire access to the stream specified by the handle.

DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 115: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 115 of 226

3.3.43 CCTALK_REQ_SORTER_PATH: REQUEST SORTER PATH (209)

Definition DGCCTALK_PREFIX DG_ERROR cctalk_req_sorter_path(

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchCoinPos,

OUT PDG_CCTALK_SORTER_PATHS pSorterPaths)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. uchCoinPos Specifies the coin position . The valid values are from 1 to 16. pSorterPaths Pointer to a DG_CCTALK_SORTER_PATHS type variable

where the sorter paths are returned. The DG_CCTALK_SORTER_PATHS.uchPathsLen specifies the number of valid values in DG_CCTALK_SORTER_PATHS.Paths array.

Description The function requests coin sorter paths from a coin acceptor.

The function implements header command 209.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Please see dgcctalk_demo.cpp for more information how to use the command.

Page 116: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 116 of 226

3.3.44 CCTALK_CMD_TEACH_MODE: TEACH MODE CONTROL (202)

Definition DG_ERROR cctalk_cmd_teach_mode (IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchPosition,

IN unsigned char uchOrientation)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. uchPosition The coin position parameters. The valid values are 1 to 16. uchOrientation The orientation parameter. The valid values are 1 to 4.

Some devices do not support this parameter in which case it should be set to 0.

Description The command puts the device into ‘teach’ mode. Teach is a mechanism whereby new coins or bills can be ‘learnt’ by entering a representative sample. On existing Money Controls products this is referred to as Teach-and-run®. Once in teach mode the device should be polled with the ‘Request teach status’ command to see what is happening.

The function implements header command 202.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 117: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 117 of 226

3.3.45 CCTALK_REQ_TEACH_STATUS: REQUEST TEACH STATUS (201)

Definition DG_ERROR cctalk_req_teach_status(IN int iHandle,

IN unsigned char uchDstAddress,

IN DGT_CCTALK_REQ_TSTAT TRequest,

OUT PDG_TEACH_STATUS pTStatus)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. TRequest DGT_CCTALK_REQ_TSTAT type variable which specifies

the type of teach status request. pTStatus Pointer to DG_TEACH_STATUS type variable where the

function returns the current teach status and coin/bill counter.

Description The command is used to monitor the progress of teach mode. Only when a ‘teach completed’ status message is received can the operation be deemed successful. The actual teach mechanism is under the full control of the slave device. It decides when enough coins or bills have been entered.

The function implements header command 201.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 118: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 118 of 226

3.3.46 CCTALK_CMD_CONFIG_TO_EEPROM: CONFIGURATION TO EEPROM (199)

Definition DG_ERROR cctalk_cmd_config_to_eeprom (

IN int iHandle,

IN unsigned char uchDstAddress)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device.

Description This command transfers volatile configuration information for a device from RAM into EEPROM. The information for a coin acceptor could possibly include…

a) inhibit information

b) sorter override information

c) sorter paths

Refer to the product manual for more details.

The function implements header command 199.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information on how to use the command.

Page 119: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 119 of 226

3.3.47 CCTALK_CMD_COUNTERS_TO_EEPROM: COUNTERS TO EEPROM (198)

Definition DG_ERROR cctalk_cmd_counters_to_eeprom(

IN int iHandle,

IN unsigned char uchDstAddress)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device.

Description This command transfers volatile counter information from RAM into EEPROM. The information for a coin acceptor could include…

a) coin insertion counter

b) coin accept counter

c) coin reject counter

d) error or alarm counter

Refer to the product manual for more details.

The function implements header command 198.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information on how to use the command.

Page 120: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 120 of 226

3.3.48 CCTALK_REQ_ROM_CHECKSUM: CALCULATE ROM CHECKSUM (197)

Definition DG_ERROR cctalk_req_rom_checksum (

IN int iHandle,

IN unsigned char uchDstAddress,

OUT unsigned long* pulSum)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. pulSum Pointer to a variable where the calculated ROM checksum

is returned.

Description The function sends a request to a slave device to calculate its ROM checksum and returns the result.

The function implements header command 197.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information on how to use the command.

Page 121: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 121 of 226

3.3.49 CCTALK_REQ_CREATION_DATE: REQUEST CREATION DATE (196)

Definition DG_ERROR cctalk_req_creation_date(

IN int iHandle,

IN unsigned char uchDstAddress,

OUT PDG_CCTALK_DATE pDate)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. pDate Pointer to DG_CCTALK_DATE structure where the date is

returned.

Description The function returns the creation date which is also known as the manufacturing date or factory setup date. The year is always stored relative to the PRODUCT_BASE_YEAR which will either be in the product manual or available using the ‘Request base year’ command. The creation date is a maximum of 31 years after the base year.

The function implements header command 196.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information on how to use the command.

Page 122: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 122 of 226

3.3.50 CCTALK_REQ_MODIFICATION_DATE: REQUEST MODIFICATION DATE (195)

Definition DG_ERROR cctalk_req_modification_date(

IN int iHandle,

IN unsigned char uchDstAddress,

OUT PDG_CCTALK_DATE pDate)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. pDate Pointer to DG_CCTALK_DATE structure where the date is

returned.

Description The function returns the last modification date of the product. It is usually changed by remote programming toolkits or PC-based support software.

The function implements header command 195.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information on how to use the command.

Page 123: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 123 of 226

3.3.51 CCTALK_REQ_REJECT_COUNT: REQUEST REJECT COUNTER (194)

Definition DG_ERROR cctalk_req_reject_count (

IN int iHandle,

IN unsigned char uchDstAddress,

OUT unsigned int* pCounter)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. pCounter Pointer to a variable where the reject counter value is

returned.

Description The function returns the total number of reject coins / bills put through a device.

The function implements header command 194.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information on how to use the command.

Page 124: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 124 of 226

3.3.52 CCTALK_REQ_FRAUD_COUNT: REQUEST FRAUD COUNTER (193)

Definition DG_ERROR cctalk_req_fraud_count (

IN int iHandle,

IN unsigned char uchDstAddress,

OUT unsigned int* pCounter)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. pCounter Pointer to a variable where the reject counter value is

returned.

Description The function returns the total number of fraud coins / bills put through a device.

The function implements header command 193.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information on how to use the command.

Page 125: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 125 of 226

3.3.53 CCTALK_REQ_BUILD_CODE: REQUEST BUILD CODE (192)

Definition DG_ERROR cctalk_req_build_code(

IN int iHandle,

IN unsigned char uchDstAddress,

IN char* pBuffer,

IN unsigned int uiBufferLen,

OUT unsigned int *puiDataLen)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pBuffer The buffer where the received data is stored. uiBufferLen The size of the provided buffer in bytes. puiDataLen A pointer to a variable where the number of received bytes is

returned.

Description The function is used to read device’s product build code. The command implements header 192.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information on how to use the command.

Page 126: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 126 of 226

3.3.54 CCTALK_CMD_MODIFY_DEFAULT_SORTER :MODIFY DEFAULT SORTER PATH (189)

Definition DG_ERROR cctalk_cmd_modify_default_sorter(

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchDefPath)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. puchCoinsRemaining The default sorter path position. The valid values are 1 to

8.

Description This command allows the default sorter path on a coin acceptor to be changed. If there is an active override on the current coin sorter path then it will be routed to the default path. The product manual should make clear whether this change is permanent ( stored in non-volatile memory ) or temporary ( stored in RAM ).

The function implements header command 189.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 127: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 127 of 226

3.3.55 CCTALK_REQ_DEFAULT_SORTER :REQUEST DEFAULT SORTER PATH (188)

Definition DG_ERROR cctalk_req_default_sorter(

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char* pDefSorter)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. pDefSorter Pointer to a variable where the default sorter path value is

returned.

Description This command reads the default sorter path on a coin acceptor. See the ‘Modify default sorter path’ command for more details.

The function implements header command 188.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 128: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 128 of 226

3.3.56 CCTALK_CMD_MODIFY_COIN_ID: MODIFY COIN ID (185)

Definition DG_ERROR cctalk_cmd_modify_coin_id(

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchCoinPos,

IN PDG_CCTALK_COIN_DESC pCoinDesc)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. uchCoinPos Specifies the coin position to modify. pCoinDesc Address of the coin description structure

DG_CCTALK_COIN_DESC.

Description Some coin acceptors can store an identification string alongside the normal validation parameters for each coin. Refer to the product manual for details.

The command implements header 185.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 129: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 129 of 226

3.3.57 CCTALK_REQ_COIN_ID: REQUEST COIN ID (184)

Definition DG_ERROR cctalk_req_coin_id(

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchCoinPos,

OUT PDG_CCTALK_COIN_DESC pCoinDesc)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. uchCoinPos Specifies the coin position . pCoinDesc Address of the coin description structure

DG_CCTALK_COIN_DESC where the coin information is returned.

Description This command returns the coin identification string.

The command implements header 184.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 130: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 130 of 226

3.3.58 CCTALK_CMD_UPLOAD_WINDOW_DATA: UPLOAD WINDOW DATA (183)

Definition DG_ERROR cctalk_cmd_upload_window_data(

IN int iHandle,

IN unsigned char uchDstAddress,

IN char* pDataBuffer,

IN unsigned int uiDataBufferLen)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. pDataBuffer The buffer address that contains the data to be uploaded to

a coin acceptor. uiDataBufferLen The size of the data buffer.

Description This command is used for the remote programming of coins or tokens.

The command implements header 183.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 131: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 131 of 226

3.3.59 CCTALK_REQ_CALIBRATION_INFO: DOWNLOAD CALIBRATION INFORMATION (182)

Definition DG_ERROR cctalk_req_calibration_info(IN int iHandle,

IN unsigned char uchDstAddress,

OUT char* pBuffer,

OUT unsigned int uiBufferLen,

OUT unsigned int* puiDataCopied)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. pBuffer Pointer to the buffer where the received data is stored. uiBufferLen The size of the provided buffer. puiDataCopied Pointer to a variable where the actual number of the

recevied data is stored. If the function returns DGERROR_BUFFER_TOO_SMALL then the variable returns the necessary size of the buffer.

Description This command is used to support the remote coin programming operation. Please refer to manufacture's manual for further details.

The command implements header 182.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 132: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 132 of 226

Page 133: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 133 of 226

CCTALK_CMD_MODIFY_SECURITY :MODIFY SECURITY SETTING (181)

Definition DG_ERROR cctalk_cmd_modify_security (

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchCoinPos,

IN unsigned char uchSecurity)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. uchCoinPos Coin position to modify the security settings of. The valid

value are 1-16. uchSecurity Security settings for the specified coin position.

Description This command allows a validator’s performance to be finely tuned. On all known devices there is a trade-off between fraud rejection and true acceptance. The product manual should make clear whether this change is permanent ( stored in non-volatile memory ) or temporary ( stored in RAM ).

The command implements header 181.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 134: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 134 of 226

3.3.60 CCTALK_REQ_SECURITY :REQUEST SECURITY SETTING (180)

Definition DG_ERROR cctalk_req_security(

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchCoinPos,

IN unsigned char* puchSecurity)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. uchCoinPos The variable specifies the coin position the security

settings should be returned for. The valid values are 1-16. puchSecurity Pointer to a variable the security setting is stored.

Description The function is used to read the security settings for the specified coin position.

The command implements header 180.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 135: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 135 of 226

3.3.61 CCTALK_CMD_MODIFY_BANK :MODIFY BANK SELECT (179)

Definition DG_ERROR cctalk_cmd_modify_bank(

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchBankNmb)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. uchBankNmb The variable specifies the coin/bill bank.

Description Some devices can support multiple banks of coins / bills subject to the condition of only a single bank being enabled ( active ) at any one time. This command allows the host controller to switch between banks. Assuming a typical device operates with 16 coins or bills, this command expands the potential capability to 16 x 256 = 4,096 coins or bills, though not all can be accepted concurrently. Coins or bills within a bank can be controlled with the ‘Modify inhibit status’ command.

The function implements header command 179.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 136: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 136 of 226

3.3.62 CCTALK_REQ_BANK: REQUEST BANK SELECT (178)

Definition DG_ERROR cctalk_req_bank(

IN int iHandle,

IN unsigned char uchDstAddress,

OUT unsigned char *puchBankNmb)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. puchBankNmb Pointer to a variable where active coin/bill bank number is

returned.

Description Some devices can support multiple banks of coins / bills subject to the condition of only a single bank being enabled ( active ) at any one time. This command allows the host controller to request the currently active bank number.

The function implements header command 178.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 137: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 137 of 226

3.3.63 CCTALK_REQ_ALARM_COUNT:REQUEST ALARM COUNTER (176)

Definition DG_ERROR cctalk_req_alarm_count(

IN int iHandle,

IN unsigned char uchDstAddress,

OUT unsigned int *puiAlarmCount)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. puiAlarmCount Pointer to a variable where the alarm count is returned.

Description This command returns the number of alarm events since the last request was sent ( i.e. it is cleared on reading ). It is only used on products which support an alarm output line.

The function implements header command 176.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 138: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 138 of 226

3.3.64 CCTALK_REQ_THERMISTOR_READING: REQUEST THERMISTOR READING (173)

Definition DG_ERROR cctalk_req_thermistor_reading(

IN int iHandle,

IN unsigned char uchDstAddress,

OUT char *pchReading)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. pchReading Pointer to a variable where the thermistor value is

returned.

Description Some products use a thermistor to provide an approximate method of determining the ambient temperature. This command returns the raw thermistor reading as a byte. This command is no longer restricted to thermistor temperature measurement – more accurate methods are commonly available. The format of the return data is now specified as ‘degrees Celsius’ in 2’s complement format. This gives a range of -128°C to +127°C.

The function implements header command 173.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 139: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 139 of 226

3.3.65 CCTALK_REQ_BASE_YEAR: REQUEST BASE YEAR (170)

Definition DG_ERROR cctalk_req_base_year(IN int iHandle,

IN unsigned char uchDstAddress,

OUT unsigned int* puiBaseYear)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. puiBaseYear Pointer to an int variable where the base year value is

returned.

Description The function returns the product base year ( see PRODUCT_BASE_YEAR in ‘Request creation date’ and ‘Request last modification date’ commands )

The function implements header command 170.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 140: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 140 of 226

3.3.66 CCTALK_CMD_EMERGENCY_STOP: EMERGENCY STOP (172)

Definition DG_ERROR cctalk_cmd_emergency_stop(

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char* puchCoinsRemaining)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. puchCoinsRemaining Pointer to a variable where the function returns the

number of failed paid coins.

Description This function immediately halts the payout sequence and reports back the number of coins which failed to be paid out. The command implements header 172.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 141: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 141 of 226

3.3.67 CCTALK_REQ_HOPPER_COIN: REQUEST HOPPER COIN (171)

Definition DG_ERROR cctalk_req_hopper_coin(

IN int iHandle,

IN unsigned char uchDstAddress,

IN char* pBuffer,

IN unsigned int uiBufferLen,

OUT unsigned int *puiDataLen)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pBuffer The buffer where the received data is stored. uiBufferLen The size of the provided buffer in bytes. puiDataLen A pointer to a variable where the number of received bytes is

returned.

Description The function is used to read the coin name that the device can pay out. The command implements header 171.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 142: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 142 of 226

3.3.68 CCTALK_REQ_ADDRESS_MODE: REQUEST ADDRESS MODE (169)

Definition DG_ERROR cctalk_req_address_mode(

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char* pModeMask)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pModeMask The pointer to a variable where the function returns the

address mode mask.

Description The function returns the ccTalk addressing mode to help with automatic reconfiguration of ccTalk peripherals. Use the following macros to test the bit mask: DG_CCTALK_FL_AM_ROM The address is stored in ROM. DG_CCTALK_FL_AM _RAM The address is stored in RAM. DG_CCTALK_FL_AM_EEPROM The address is stored in EEPROM or NV

memory DG_CCTALK_FL_AM_INTERFACE The address is selected via interface

connector. DG_CCTALK_FL_AM_PCB The address is selected via PCB links. DG_CCTALK_FL_AM_SWITCH The address is selected via a switch. DG_CCTALK_FL_AM_CMD_VOLITILE The address may be changed with serial

commands (volatile). DG_CCTALK_FL_AM_CMD_NONVOLITILE The address may be changed with serial

commands (non-volatile).

The command implements header 169.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully.

Page 143: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 143 of 226

DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 144: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 144 of 226

3.3.69 CCTALK_REQ_DISPENSE_COUNT: REQUEST HOPPER DISPENSE COUNT (168)

Definition DG_ERROR cctalk_req_address_mode(

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned int *puiDispenseCount)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. puiDispenseCount The pointer to a variable where the function returns the

number of dispensed coins.

Description The function returns the number of coins dispensed by the hopper. The command implements header 168.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 145: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 145 of 226

3.3.70 CCTALK_CMD_DISPENSE_HOPPER_COINS: DISPENSE HOPPER COINS (167)

Definition DG_ERROR cctalk_cmd_dispense_hopper_coins(

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchNumberOfCoins,

IN char* pSecurityCode,

IN unsigned int uiSecurityCodeLen,

IN int *piEventCounter)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. uchNumberOfCoins The number of coins to dispense. pSecurityCode Pointer to a buffer which contains the security code. uiSecurityCodeLen The length of the security code buffer. piEventCounter Pointer to a variable where the event counter is returned.

• The variable can be set to -1 in one of the following conditions:

• If a non ACK or NAK message was received. The slave device did not return the event counter value although the command completed successfully.

Description The function allows to dispense hopper coins securely. The variable data in the pSecurityCode buffer represents special security codes, which have to be correct for a coin payout to be successful. The command implements header 167.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

Page 146: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 146 of 226

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 147: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 147 of 226

3.3.71 CCTALK_REQ_HOPPER_STATUS: REQUEST HOPPER STATUS (166)

Definition DG_ERROR cctalk_req_hopper_status (

IN int iHandle,

IN unsigned char uchDstAddress,

IN PDG_HOPPER_STATUS pStatus)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pStatus The pointer to DG_HOPPER_STATUS structure where the

function returns the hopper’s status.

Description The function returns the current hopper’s status. The command implements header 166.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 148: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 148 of 226

3.3.72 CCTALK_CMD_MODIFY_VARIABLES: MODIFY VARIABLE SET (165)

Definition DG_ERROR cctalk_cmd_modify_variables(

IN int iHandle,

IN unsigned char uchDstAddress,

IN char* pBuffer,

IN unsigned int uiBufferLen)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pBuffer The buffer which contains new variables values. uiBufferLen The length of the buffer.

Description The function modifies variable data on the slave device. The variable set is product dependent and therefore you need to consult the slave device manual. The command implements header 165.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 149: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 149 of 226

3.3.73 CCTALK_CMD_ENABLE_HOPPER: ENABLE HOPPER (164)

Definition DG_ERROR cctalk_cmd_enable_hopper(

IN int iHandle,

IN unsigned char uchDstAddress,

IN DGT_CCTALK_PAYOUTS EnableCode)

Parameters iHandle A valid handle value that was returned by

cctalk_open_link function. uchDstAddress The address of the slave device. EnableCode The variable contains the hopper enable code.

DG_CCTALK_PAYOUTS_DISABLE – Enable payouts.

DG_CCTALK_PAYOUTS_ENABLE – Disable payouts.

Description This function must be used to enable the hopper before making any payouts. The command implements header 164.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 150: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 150 of 226

3.3.74 CCTALK_REQ_TEST_HOPPER: TEST HOPPER (163)

Definition DG_ERROR cctalk_req_test_hopper(

IN int iHandle,

IN unsigned char uchDstAddress,

IN PDG_HOPPER_TEST_STATUS pStatus)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pStatus The pointer to DG_HOPPER_TEST_STATUS structure where

the function returns various operating and error flags.

Description The function reports back various operating and error flags from the hopper and is the equivalent of the ‘Perform self-check’command in coin/bill acceptors .

The DG_HOPPER_TEST_STATUS.uchRegister1 member is a bit mask variable. Use the following macros to test the status condition:

DG_CCTALK_FL1_CURRENT_EXCEEDED Absolute maximum current

exceeded. DG_CCTALK_FL1_PAYOUT_TIMEOUT Payout timeout occurred. DG_CCTALK_FL1_MOTOR_REVERSED Motor reversed during last

payout to clear a jam. DG_CCTALK_FL1_FRAUD_PATH_BLOCKED Opto fraud attempt, path

blocked during idle. DG_CCTALK_FL1_FRAUD_SHORT_CIRCUIT Opto fraud attempt, short-

circuit during idle. DG_CCTALK_FL1_OPTO_BLOCKED_PERMANENTLY Opto blocked permanently

during payout. DG_CCTALK_FL1_POWERUP_DETECTED Power-up detected. DG_CCTALK_FL1_PAYOUT_DISABLED Payout disabled.

The DG_HOPPER_TEST_STATUS.uchRegister2 member is also a bit mask variable. The following macros can be used to test the bit pattern:

Page 151: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 151 of 226

DG_CCTALK_FL2_FRAUD_PAYOUT_SHORT_CIRCUIT Opto fraud attempt, short circuit during payout.

DG_CCTALK_FL2_SINGLE_COIN_MODE Single coin mode. DG_CCTALK_FL2_PIN_MECHANISM PIN number mechanism.

The command implements header 163.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 152: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 152 of 226

3.3.75 CCTALK_CMD_MODIFY_REGISTERS: MODIFY INHIBIT AND OVERRIDE REGISTERS (162)

Definition DG_ERROR cctalk_cmd_modify_registers(

IN int iHandle,

IN unsigned char uchDstAddress,

IN PDG_CCTALK_REGISTERS pCompoundRegs)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pCompoundRegs Pointer to compound DG_CCTALK_REGISTERS type

structure which contains inhibit and status override settings.

Description For coin acceptors this command…

a) sets inhibits and overrides in one operation ( see also the ‘Modify inhibit status’ command and the ‘Modify sorter override status’ command )

b) sets both a ‘current’ value and a ‘next coin’ value The benefit of using this command is that it allows precise coin-by-coin control of the coin acceptor and provides a means of tackling the inherent latency in serial operation. If the next coin is always disabled, the validator will only accept one coin at a time. After each credit ( strictly speaking an attempted accept sequence ) the host software can request another coin and thus control the overall accept rate. If the next coin overrides are always active, the validator will only route one coin at a time to a payout tube - all other coins will go to the cashbox. The host software can thus maintain a precise fill level in any tube.

The command implements header 162.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

Page 153: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 153 of 226

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 154: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 154 of 226

3.3.76 CCTALK_CMD_PUMP_RNG: PUMP RNG (161)

Definition DG_ERROR cctalk_cmd_pump_rng(

IN int iHandle,

IN unsigned char uchDstAddress,

IN char* pRNGBuffer,

IN unsigned int uiRNGBufferLen)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pRNGBuffer The buffer which contains RND seed number. uiRNGBufferLen The length of the buffer.

Description The function “pumps” the slave’s random number generator with a set of random numbers and is part of the hopper dispense encryption algorithm. The command implements header 161.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 155: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 155 of 226

3.3.77 CCTALK_REQ_CIPHER_KEY: REQUEST CIPHER KEY (160)

Definition DG_ERROR cctalk_req_cipher_key(

IN int iHandle,

IN unsigned char uchDstAddress,

IN char* pKeyBuffer,

IN unsigned int uiKeyBufferLen,

OUT unsigned int *puiKeyLen)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pKeyBuffer The pointer to a buffer where the function will store a cipher

key. uiKeyBufferLen The size of the provided buffer. puiKeyLen The size of the returned cipher key in bytes.

Description The function requests a cipher key from the slave device and is part of the hopper dispense encryption algorithm. The command implements header 160.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 156: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 156 of 226

3.3.78 CCTALK_REQ_BILL_EVENTS: READ BUFFERED BILL EVENTS (159)

Definition DG_ERROR cctalk_req_bill_events(

IN int iHandle,

IN unsigned char uchDstAddress,

OUT PDG_CCTALK_BILL_EVENTS pBillEvents)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pBillEvents Pointer to DG_CCTALK_BILL_EVENTS structure where the

history of bill events is returned.

Description The function requests a history of bill events in a similar way of that of a coin acceptor. The DG_CCTALK_BILL_EVENTS structure is defined as follows:

typedef struct _DG_CCTALK_BILL_EVENTS { unsigned int uiEventCounter; DG_CCTALK_BILL_EVENT EventList[DG_CCTALK_EVENTLIST_SIZE]; } DG_CCTALK_BILL_EVENTS, *PDG_CCTALK_BILL_EVENTS;

where uiEventCounter Is a counter which is incremented when a new event is

registered. EventList Is an array which holds the events returned from an

acceptor.

The DG_CCTALK_BILL_EVENT structure is defined as follows:

typedef struct _DG_CCTALK_BILL_EVENT { DGT_CCTALK_BILL_EVT EvtCode; unsigned int uiEventData; } DG_CCTALK_BILL_EVENT, *PDG_CCTALK_BILL_EVENT;

where EvtCode The variable of type DGT_CCTALK_BILL_EVT, which

specifies the event code.

Page 157: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 157 of 226

uiEventData If EvtCode is set to DGT_CCTALK_BEVT_C_STACKED or DGT_CCTALK_BEVT_P_ESCROWED then the variable specifies the bill type that was either stacked or is in the escrow position. In any other case it is set to 0.

The code which is returned in EvtCode variable has event code type embedded into it. The possible event types are: DGT_CCTALK_EVT_CREDIT Set for an event, which implies that a credit

can be issued (a note has been validated and stacked).

DGT_CCTALK_EVT_PENDING_CREDIT Set for an event, which implies that a credit is pending (a note is in the escrow position).

DGT_CCTALK_EVT_STATUS Set for an event, which belongs to the STATUS group. It is an informative event.

DGT_CCTALK_EVT_REJECT Set for an event, which belong to the REJECT group. It implies that the a note has been rejected for some reson.

DGT_CCTALK_EVT_ERROR Set for an event, which belong to the ERROR group. It implies that an error occurred and needs attention.

DGT_CCTALK_EVT_FRAUD Set for an event, which belong to the FRAUD group. It implies that the device detected a fraud attempt.

In order to extract event type from the full event code use the macro called GET_BILL_EVENT_TYPE. If you only need the event code value on its own then use GET_BILL_EVENT_CODE macro.

The command implements header 159.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

Page 158: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 158 of 226

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 159: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 159 of 226

3.3.79 CCTALK_REQ_BILL_ID: REQUEST BILL ID (157)

Definition DG_ERROR cctalk_req_bill_id(IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchBillType,

OUT PDG_CCTALK_BILL_INFO pBillInfo)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. uchBillType The variable specifies which bill type information is required

The valid values are from 1 to 16. pBillInfo Pointer to structure DG_CCTALK_BILL_INFO where bill

information is returned. This includes country code, country scaling factor and bill issue code.

Description The function requests idenitification string alongside the normal validation parameters for each bill specified by bill type variable.

Type DG_CCTALK_BILL_INFO has the following definition:

typedef struct _DG_CCTALK_BILL_INFO { char CountryCode[2]; unsigned short ushScalingFactor; char chIssueCode; } DG_CCTALK_BILL_INFO, *PDG_CCTALK_BILL_INFO;

where CountryCode An array 2 bytes long which contains 2 letter country code.

See Appendix 10 of ccTalk specification for the valid country codes.

ushScalingFactor Bill value in terms of the country scaling factor. chIssueCode Issue code. Starts at A and progresses B, C, D, E…

The command implements header 157.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

Page 160: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 160 of 226

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 161: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 161 of 226

3.3.80 CCTALK_REQ_COUNTRY_SCALE_FACTOR: REQUEST COUNTRY SCALING FACTOR (156)

Definition DG_ERROR cctalk_req_country_scale_factor(IN int iHandle,

IN unsigned char uchDstAddress,

IN char* pCountryCode,

OUT PDG_CCTALK_COUNTRY_SCALING pCountryScaling)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pCountryCode Pointer to a 2 bytes buffer where country code is specified

associated with the returned information. See Appendix 10 of ccTalk specification for the valid country codes.

pCountryScaling Pointer to a variable where country scaling information is returned.

Description The function requests the scaling factor and decimal places for the standard country code provided. All the information is returned in the structure as described below:

typedef struct _DG_CCTALK_COUNTRY_SCALING { unsigned short ushScalingFactor; unsigned short ushDecimalPlaces; } DG_CCTALK_COUNTRY_SCALING, *PDG_CCTALK_COUNTRY_SCALING;

where ushScalingFactor Value of scaling factor. ushDecimalPlaces Value of decimal places.

If ushScalingFactor and ushDecimalPlaces are set to 0 then the specified country code is not supported abd the function returns DGERROR_INVALID_DATA error code.

The command implements header 156.

Page 162: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 162 of 226

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply. DGERROR_INVALID_DATA The specified country code is invalid and is not

supported by the device.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 163: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 163 of 226

3.3.81 CCTALK_REQ_BILL_POSITION: REQUEST BILL POSITION (155)

Definition DG_ERROR cctalk_req_bill_position(IN int iHandle,

IN unsigned char uchDstAddress,

IN char* pCountryCode,

OUT unsigned short *pPosMask)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pCountryCode Pointer to a 2 bytes buffer where country code is specified

associated with the returned information. See Appendix 10 of ccTalk specification for the valid country codes.

pPosMask Pointer to a variable where bill position mask is returned.

Description The function is used to locate the inhibit mask of a given currency based on its country code. The inhibit mask ties up with the 'Modify inhibit status' command for inhibiting individual bills. If this data is used directly as the new inhibit mask then the currency selected will be enabled and all other currencies inhibited.

The command implements header 155.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 164: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 164 of 226

3.3.82 CCTALK_REQ_BILL_POSITION_BUFFER: REQUEST BILL POSITION BUFFER (155)

Definition DG_ERROR cctalk_req_bill_position_buffer(IN int iHandle,

IN unsigned char uchDstAddress,

IN char* pCountryCode,

OUT PDG_CCTALK_COPY_BUFFER pDataBuffer)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pCountryCode Pointer to a 2 bytes buffer where country code is specified

associated with the returned information. See Appendix 10 of ccTalk specification for the valid country codes.

pDataBuffer Pointer to DG_CCTALK_COPY_BUFFER structure which holds information about user specified buffer. When the function returns the variable also contains the number of copied bytes.

Description The function is the same as cctalk_req_bill_position but some devices return more than two bytes of bill positioning information. Therefore structure DG_CCTALK_COPY_BUFFER was introduced to receive variable size information. The structure is defined as follows:

typedef struct _DG_CCTALK_COPY_BUFFER { void *pBufferPtr; unsigned int uiBufferSize; unsigned int uiDataCopied; } DG_CCTALK_COPY_BUFFER, *PDG_CCTALK_COPY_BUFFER;

where pBufferPtr Pointer to user allocated buffer. uiBufferSize Size of the user allocated buffer. uiDataCopied Number of bytes that have been copied into the buffer.

The command implements header 155.

Page 165: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 165 of 226

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 166: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 166 of 226

3.3.83 CCTALK_CMD_ROUTE_BILL: ROUTE BILL (154)

Definition DG_ERROR cctalk_cmd_route_bill(IN int iHandle,

IN unsigned char uchDstAddress,

IN DGT_CCTALK_BILL_ROUTING RouteCmd,

OUT DGT_CCTALK_BILL_ROUTING_ERROR *pReplyCode)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. RouteCmd The variable specifies bill routing command. pReplyCode Pointer to a variable where an error code is returned if the

device could not execute the specified command.

Description The function allows to control routing of a bill held in escrow position. The variable RouteCmd can have the following values: DGT_CCTALK_BR_RETURN Return the bill. DGT_CCTALK_BR_STACK Forward the bill from escrow into the stack. DGT_CCTALK_BR_EXTEND_TIMEOUT Leave the bill in the escrow position and

extend the timeout period.

When the function returns, the pReplyCode variable contains an error code reply from a device. ccTalk library defines the following enums in accordance with ccTalk specification: DGT_CCTALK_BRE_OK The device returned 0 error code or ACK

packet. DGT_CCTALK_BRE_ESCROW_EMPTY Escrow is empty. DGT_CCTALK_BRE_FAILED Leave the bill in the escrow position and

extend the timeout period.

It has to be noted that pReplyCode can be set to any value specified by a manufacturer.

The command implements header 154.

Page 167: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 167 of 226

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 168: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 168 of 226

3.3.84 CCTALK_CMD_MODIFY_BILL_OP_MODE: MODIFY BILL OPERATING MODE (153)

Definition DG_ERROR cctalk_cmd_modify_bill_op_mode(IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchModeMask)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. uchModeMask The variable specifies the mask which enables or disables

various features of a device..

Description The command is used to control various product features such as enabling or disabling stacker or escrow. Please consult manufacture's manual for more information.

The command implements header 153.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 169: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 169 of 226

3.3.85 CCTALK_REQ_BILL_OP_MODE: REQUEST BILL OPERATING MODE (152)

Definition DG_ERROR cctalk_req_bill_op_mode (IN int iHandle,

IN unsigned char uchDstAddress,

OUT unsigned char* puchModeMask)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. puchModeMask Pointer to a variable where bill operating mode mask is

returned.

Description The command is used to request enabled/disabled various product features mask. Please consult manufacture's manual for more information.

The command implements header 152.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 170: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 170 of 226

3.3.86 CCTALK_CMD_TEST_LAMPS: TEST LAMPS (151)

Definition DG_ERROR cctalk_cmd_test_lamps(IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchLampNmb,

IN DGT_CCTALK_LAMP_TEST TestMode)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. uchLampNmb Specifies lamp number to test. TestMode Variable of type DGT_CCTALK_LAMP_TEST, which

specifies the lamp control mode.

Description The command is used as a diagnostic tool for products that support lamps. On bill validators, front-panel lamps are often used to guide the user on the note insertion.

The command implements header 151.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 171: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 171 of 226

3.3.87 CCTALK_REQ_ACCEPT_COUNTER: REQUEST INDIVIDUAL ACCEPT COUNTER (150)

Definition DG_ERROR cctalk_req_accept_counter(

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchBillType,

OUT unsigned int* puiBillCounter)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. uchBillType Variable, which specifies bill type - a value between 1 and 64. puiBillCounter Pointer to a variable where pointer to accept counter is

returned.

Description Some bill validators support the individual counting of different bill types. This command returns the number of bills accepted of a given type. The type is that reported by the ‘Read buffered bill events’ command.

The command implements header 150.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 172: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 172 of 226

3.3.88 CCTALK_REQ_ERROR_COUNTER: REQUEST INDIVIDUAL ERROR COUNTER (149)

Definition DG_ERROR cctalk_req_error_counter(

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchErrorType,

OUT unsigned int* puiErrorCounter)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. uchErrorType Variable, which specifies error type for which to return

information for. puiErrorCounter Pointer to a variables where error counter is returned.

Description The command is used to request individual error types counters and returns the number. Please consult manufacture's manual for more information.

The command implements header 149.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 173: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 173 of 226

3.3.89 CCTALK_REQ_OPTO_VOLTAGES: REQUEST OPTO VOLTAGES (148)

Definition DG_ERROR cctalk_req_opto_voltages(IN int iHandle,

IN unsigned char uchDstAddress,

IN PDG_CCTALK_COPY_BUFFER pVoltages)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pVoltages Pointer to a structure DG_CCTALK_COPY_BUFFER where

raw information is returned. The pBufferPtr member of the structure should point to a user allocated buffer. uiBufferSize should be set to the size of that buffer. When the function returns the uiDataCopied member is set to the number of bytes received from the device.

Description The command returns a series of scaled voltages for a device using optos (e.g. a bill validator) rather than the blocked / clear indication, which would be returned by the 'Read opto states' command. See manufacture’s manual about the format the data is returned in.

The command implements header 148.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 174: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 174 of 226

3.3.90 CCTALK_CMD_STACKER_CYCLE: STACKER CYCLE (147)

Definition DG_ERROR cctalk_cmd_stacker_cycle(

IN int iHandle,

IN unsigned char uchDstAddress,

OUT DGT_CCTALK_STACKER_ERROR *pReplyCode)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pReplyCode Pointer to a variable where an error code is returned if the

device could not execute the specified command.

Description The function sends a command, which executes 1 cycle of the stacker on a bill validator for diagnostic purposes. After completion one of the following error codes could be returned:

typedef enum _DGT_CCTALK_STACKER_ERROR { DGT_CCTALK_SE_OK = 0, DGT_CCTALK_SE_FAULT = 254, DGT_CCTALK_SE_NOT_FITTED, DGT_CCTALK_SE_INVALID, } DGT_CCTALK_STACKER_ERROR;

A device can also return other codes which have not been defined. Please see manufacture’s manual for more information.

The command implements header 147.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle.

Page 175: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 175 of 226

DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 176: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 176 of 226

3.3.91 CCTALK_CMD_OP_MOTORS: OPERATE BI-DIRECTION MOTORS (146)

Definition DG_ERROR cctalk_cmd_op_motors(

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned int uiMotorNmb,

IN DGT_CCTALK_DIRECTION Direction,

IN unsigned char uchSpeed)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. uiMotorNmb The variable is a number from 1 to 8, which specifies which

motor to operate. Consult the device manual for more information..

Direction The variable specifies the direction the motor should be running: forward (DGT_CCTALK_DIR_FORWARD) or backword (DGT_CCTALK_DIR_BACKWORD).

uchSpeed The variable specifies motor speed. 0 – specifies default speed. 1 to 255 - relative speed. 1 is slowest and 255 is the highest.

Description The function sends the command which operates bi-directional motors.

The command implements header 146.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Page 177: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 177 of 226

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 178: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 178 of 226

3.3.92 CCTALK_REQ_CURRENCY_REV: REQUEST CURRENCY REVISION (145)

Definition DG_ERROR cctalk_req_currency_rev(

IN int iHandle,

IN unsigned char uchDstAddress,

IN char* pCountryCode,

IN PDG_CCTALK_COPY_BUFFER pCurrencyRev)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pCountryCode Pointer to a buffer where country code is specified associated

with the returned information. If the parameters is set to NULL then the function returns global revision information.

pCurrencyRev Pointer to DG_CCTALK_COPY_BUFFER type structure which contains user allocated buffer information. When the function returns it stores requested currency information in the provided buffer.

Description The command requests currency revision information. If no currency code is supplied (CountryCode = NULL) then the global table revision is returned as stored in the header of the note table file. If the country code is supplied then the revision of the first note in the note table with the matching country code is returned, which amy be different to other notes within that country. If the revision number of an unsupported country code is requested then the string 'Unknown' is returned.

The command implements header 145.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

Page 179: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 179 of 226

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 180: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 180 of 226

3.3.93 CCTALK_CMD_UPLOAD_BILL_TABLE: UPLOAD BILL-TABLE FROM A FILE

Definition DG_ERROR cctalk_cmd_upload_bill_table(

IN int iHandle,

IN char *filename,

IN DG_CCTALK_PROGRESS_CB pfnCB)

typedef void (*DG_CCTALK_PROGRESS_CB)(int sofar, int total);

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. filename The name of the file to be uploaded to the device. pfnCB The function to be called when progress has been made

uploading the firmware. If NULL, then no progress callback is made.

Description The command allows uploading a new bill table to a bill/note validator.

If pfnCB is non-NULL, then the function it points to is called once at the beginning of the upload and thence for every line and block that is successfully uploaded to the target device. The parameter sofar is the total number of bytes successfully transmitted to the target device, the parameter total is the total number of bytes in the file filename.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Page 181: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 181 of 226

3.3.94 CCTALK_CMD_UPLOAD_BILL_TABLE_DATA: UPLOAD BILL TABLES (144)

Definition DG_ERROR cctalk_cmd_upload_bill_table_data(

IN int iHandle,

IN unsigned char uchDstAddress,

IN PDG_CCTALK_BLOCK_DATA pBillData)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pBillData Pointer of a variable of type DG_CCTALK_BLOCK_DATA,

which contains bill table information. Member pData of the structure should point to a buffer with bill information. Member uchDataLen of the structure should specify the size of the buffer.

Description The command sends new bill table information into a validator in a manufacturer neutral format. The data is split into blocks and lines. There are 128 bytes per line, 256 per block up to maximum 256 blocks. This gives total capacity of 256 x 256 x 128 = 8Mbytes. Lines shorter than 128 bytes can be sent. There is no reference to bill type in the data structure - it is assumed that this is represented internally. All this data is passed to the function using DG_CCTALK_BLOCK_DATA structure, which is defined as follows:

typedef struct _DG_CCTALK_BLOCK_DATA { char* pData; unsigned char uchDataLen; unsigned char uchBlock; unsigned char uchLine; } DG_CCTALK_BLOCK_DATA, *PDG_CCTALK_BLOCK_DATA;

where pData Pointer to a buffer with bill table information. uchDataLen Number of data bytes located in the buffer pData. uchBlock Block number where the information should be stored. uchLine Line number where the information should be stored.

Page 182: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 182 of 226

The command implements header 144.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example None.

Page 183: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 183 of 226

3.3.95 CCTALK_CMD_BEGIN_BILL_UPGRADE: BEGIN BILL TABLE UPGRADE (143)

Definition DG_ERROR cctalk_cmd_begin_bill_upgrade(

IN int iHandle,

IN unsigned char uchDstAddress)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device.

Description The command initiates the bill table upgrade procedure.

The command implements header 143.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example None.

Page 184: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 184 of 226

3.3.96 CCTALK_CMD_FINISH_BILL_UPGRADE: FINISH BILL TABLE UPGRADE (142)

Definition DG_ERROR cctalk_cmd_finish_bill_upgrade(

IN int iHandle,

IN unsigned char uchDstAddress)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device.

Description The command terminates the bill table upgrade procedure. If a device sends NAK reply then the function returns DGERROR_COMMAND_FAILED error.

The command implements header 142.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply. DGERROR_COMMAND_FAILED The device returned NAK reply.

Example None.

Page 185: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 185 of 226

3.3.97 CCTALK_REQ_UPGRADE_CAPABILITY: FIRMWARE UPGRADE CAPABILITY (141)

Definition DG_ERROR cctalk_req_upgrade_capability(

IN int iHandle,

OUT bool *pIsUpgradable)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pIsUpgradable Pointer to a boolean variable which is set to true if the

device's firmware can be upgraded.

Description The command sends a request to a device to determine the upgradability of the device's firmware.

The command implements header 141.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example None.

Page 186: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 186 of 226

3.3.98 CCTALK_CMD_UPLOAD_FIRMWARE: UPLOAD FIRMWARE FROM A FILE

Definition DG_ERROR cctalk_cmd_upload_firmware(

IN int iHandle,

IN char *filename,

IN DG_CCTALK_PROGRESS_CB pfnCB)

typedef void (*DG_CCTALK_PROGRESS_CB)(int sofar, int total);

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. filename The name of the file to be uploaded to the device. pfnCB The function to be called when progress has been made

uploading the firmware. If NULL, then no progress callback is made.

Description The command allows upgrading the firmware in a bill/note validator. The format of the command is the same as 'Upload bill tables'.

If pfnCB is non-NULL, then the function it points to is called once at the beginning of the upload and thence for every line and block that is successfully uploaded to the target device. The parameter sofar is the total number of bytes successfully transmitted to the target device, the parameter total is the total number of bytes in the file filename.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Page 187: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 187 of 226

3.3.99 CCTALK_CMD_UPLOAD_FIRMWARE_DATA: UPLOAD FIRMWARE DATA (140)

Definition DG_ERROR cctalk_cmd_upload_firmware_data(

IN int iHandle,

IN unsigned char uchDstAddress,

IN PDG_CCTALK_BLOCK_DATA pFirmwareData)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pFirmwareData Pointer of a variable of type DG_CCTALK_BLOCK_DATA,

which contains firmware data. Member pData of the structure should point to a buffer with firmware data. Member uchDataLen of the structure should specify the size of the buffer.

Description This command allows upgrading the firmware in a validator. The format of the command is the same as 'Upload bill table data'.

The command implements header 140.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 188: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 188 of 226

3.3.100 CCTALK_CMD_BEGIN_FIRMWARE_UPGRADE: BEGIN FIRMWARE UPGRADE (139)

Definition DG_ERROR cctalk_cmd_begin_firmware_upgrade(

IN int iHandle,

IN unsigned char uchDstAddress)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device.

Description The command initiates firmware upgrade.

The command implements header 139.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 189: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 189 of 226

3.3.101 CCTALK_CMD_FINISH_FIRMWARE_UPGRADE: FINISH FIRMWARE UPGRADE (138)

Definition DG_ERROR cctalk_cmd_finish_firmware_upgrade(

IN int iHandle,

IN unsigned char uchDstAddress)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device.

Description The command terminates firmware upgrade. If the device sends NAK message as reply then the function returns DGERROR_COMMAND_FAILED error code.

The command implements header 138.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply. DGERROR_COMMAND_FAILED The device sent NAK message as reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 190: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 190 of 226

3.3.102 CCTALK_CMD_SWITCH_ENCRYPTION: SWITCH ENCRYPTION CODE (137)

Definition DG_ERROR cctalk_cmd_switch_encryption(

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned int uiEncryptionCode)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. uiEncryptionCode Encryption code value from 0 to 999999.

Description The command allows the encryption key or code to be switched to a new value if ccTalk encryption layer is used. The new code takes affect after this function returns.

The command implements header 137.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 191: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 191 of 226

3.3.103 CCTALK_CMD_STORE_ENCRYPTION: STORE ENCRYPTION CODE (136)

Definition DG_ERROR cctalk_cmd_store_encryption(

IN int iHandle,

IN unsigned char uchDstAddress)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device.

Description The function instructs a device to store the current encryption code in NV memory. At the next power up, this is the encryption code that needs to be used.

The command implements header 136.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 192: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 192 of 226

3.3.104 CCTALK_CMD_SET_ACCEPT_LIMIT: SET ACCEPT LIMIT (135)

Definition DG_ERROR cctalk_cmd_set_accept_limit(

IN int iHandle,

IN unsigned char uchDstAddress,

IN unsigned char uchCoinsNmb)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. uchCoinsNmb Number of coins to be accept before acceptor self inhibits

itself.

Description Some applications such as gaming machines require no more than say 3 or 5 coins to be accepted per game play. For a serial coin acceptor this means sending a command to inhibit coin acceptance after a specified number of coins has been entered. When coin throughput is high there is a chance further coins will be accepted due to the latency of the serial communications itself. New coins can only be detected at the credit polling interval and by that time more coins could have passed the accept gate.

Set accept limit has a parameter ‘no. of coins’ which determines how many coins are accepted before the coin acceptor inhibits itself. After self- inhibit, no further coins can be accepted until another ‘Set accept limit’ command is sent. During self- inhibit, ccTalk event codes ‘Inhibited coin’ will be returned for each coin entered. It is possible to switch off the self-inhibit mechanism by sending ‘no. of coins’ equal to zero.

The command implements header 135.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

Page 193: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 193 of 226

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 194: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 194 of 226

3.3.105 CCTALK_REQ_BARCODE: READ BARCODE DATA (129)

Definition DG_ERROR cctalk_req_barcode(

IN int iHandle,

IN unsigned char uchDstAddress,

OUT PDG_CCTALK_COPY_BUFFER pData)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pData Pointer to a structure of type

DG_CCTALK_COPY_BUFFER. Member pBufferPtr of the structure must be set to the user allocated buffer. Member uiBufferSize must specify the size of the allocated buffer When the function returns member uiDataCopied is set to the number of returned bytes in the buffer.

Description The function returns the last barcode value as ASCII string. If the scanned barcode was invalid then no data is returned.

The command implements header 129.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 195: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 195 of 226

3.3.106 CCTALK_REQ_CURRENCY_SPEC_ID: REQUEST CURRENCY SPECIFICATION ID (91)

Definition DG_ERROR cctalk_req_currency_spec_id(

IN int iHandle,

IN unsigned char uchDstAddress,

OUT PDG_CCTALK_COPY_BUFFER pData)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pData Pointer to a structure of type

DG_CCTALK_COPY_BUFFER. Member pBufferPtr of the structure must be set to the user allocated buffer. Member uiBufferSize must specify the size of the allocated buffer When the function returns member uiDataCopied is set to the number of returned bytes in the buffer.

Description The function returns a 10 character string in the notes table.

The command implements header 91

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 196: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 196 of 226

3.3.107 CCTALK_REQ_CURRENCY_SPEC_ID: REQUEST NOTE IMAGE (90)

Definition DG_ERROR cctalk_req_note_image(

IN int iHandle,

IN unsigned char uchDstAddress,

IN DG_CCTALK_IMG_SEQ ImageSequence,

IN DG_CCTALK_IMG_FMT ImageFormat,

IN PDG_CCTALK_COPY_BUFFER pData)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. ImageSequence The variable specifies which part of the image should be

transfered. DGT_CCTALK_IMG_SEQ_FIRST value is used to initiate the transfer. All the subsequent calls should be made using DGT_CCTALK_IMG_SEQ_NEXT value.

ImageFormat The variable specifies the image format (colour or gray) that should be returned and which side if the note (top or bottom).

pData Pointer to a structure of type DG_CCTALK_COPY_BUFFER. Member pBufferPtr of the structure must be set to the user allocated buffer. Member uiBufferSize must specify the size of the allocated buffer When the function returns member uiDataCopied is set to the number of returned bytes in the buffer.

Description The function requests an image of the last note that passed. through an acceptor. Image data is transferred block by block. Each block consists of 204 bytes. There are 75 blocks for a greyscale image and 225 blocks for a colour image. It is up to the host software to request the correct number of blocks by setting ImageFormat parameter appropriately. ImageFormat variable is of type DGT_CCTALK_IMG_FMT and is defined as follows:

typedef enum _DGT_CCTALK_IMG_FMT { DGT_CCTALK_IMF_GREY_TOP, DGT_CCTALK_IMF_GREY_BOTTOM, DGT_CCTALK_IMF_COLOUR_TOP, DGT_CCTALK_IMF_COLOUR_BOTTOM,

Page 197: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 197 of 226

DGT_CCTALK_IMF_INVALID } DGT_CCTALK_IMG_FMT;

where DGT_CCTALK_IMF_GREY_TOP Get top grayscale image of the bank note. DGT_CCTALK_IMF_GREY_BOTTOM Get bottom grayscale image of the bank note. DGT_CCTALK_IMF_COLOUR_TOP Get top colour image of the bank note. DGT_CCTALK_IMF_COLOUR_BOTTOM Get bottom colour image of the bank note.

Greyscale images are encoded 1 byte per pixel. A value of 0 represents black and 255 white. Colour images are encoded 3 bytes per pixel. Pixels are sent in RGB triples. First a [ Red ] byte then a [ Green ] byte then a [ Blue ] byte. So each block of 204 bytes contains the data for 68 pixels. The image is transferred to the display device from the serial receive buffer column by column. Each column consists of 102 pixels. There are 150 columns in total for both greyscale and colour images.

The command implements header 90.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 198: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 198 of 226

3.3.108 CCTALK_CMD_CLEAR_AUDIT: CLEAR AUDIT DATA (89)

Definition DG_ERROR cctalk_cmd_clear_audit(

IN int iHandle,

IN unsigned char uchDstAddress,

IN PDG_CCTALK_COPY_BUFFER pData)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pData Pointer to a structure of type

DG_CCTALK_COPY_BUFFER. Member pBufferPtr of the structure must be set to the user allocated buffer. Member uiBufferSize must specify the size of the allocated buffer When the function returns member uiDataCopied is set to the number of returned bytes in the buffer.

Description The function clears the reset-able audit data within the acceptor's EEPROM.

The command implements header 89.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 199: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 199 of 226

3.3.109 CCTALK_REQ_COMMS_REVISION: REQUEST COMMS REVISION (4)

Definition DG_ERROR cctalk_req_comms_revision(

IN int iHandle,

IN unsigned char uchDstAddress,

IN PDG_COMMS_REVISION pRevision)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pRevision The pointer to DG_COMMS_REVISION structure where the

function returns the ccTalk level number and the major/minor revision numbers of the communication specification.

Description The function returns the ccTalk level number and the major/minor revision numbers of the communication specification. This is read separately to the main software revision number for the product which can be obtained with a “Request software revision” command. The command implements header 4.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 200: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 200 of 226

3.3.110 CCTALK_CMD_CLEAR_COMMS: CLEAR COMMS STATUS VARIABLES (3)

Definition DG_ERROR cctalk_cmd_clear_comms(

IN int iHandle,

IN unsigned char uchDstAddress)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device.

Description The function clears cumulative comms status variables (Please see “Request Comms status variables” command). The command implements header 3.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 201: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 201 of 226

3.3.111 CCTALK_REQ_COMMS_STATUS: REQUEST COMMS STATUS VARIABLES (2)

Definition DG_ERROR cctalk_req_comms_status(

IN int iHandle,

IN unsigned char uchDstAddress,

IN PDG_COMMS_STATUS pCommsStatus)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device. pCommsStatus The pointer to DG_COMMS_STATUS structure where the

function returns three cumulative single byte event counters.

Description The function returns three cumulative single byte counters. The host can use his information to evaluate the quality of the link with the slave. For the data to be useful, the counters should be cleared first with the “Clear comms status variables” command.

The DG_COMMS_STATUS structure contains three member variables: uchRXTimeouts, uchRXBytesIgnored, uchRXBadChecksum. uchRXTimeouts The number of times the slave device has timed out on

receiving data. This should be 0 for good communication link.

uchRXBytesIgnored If a long message is sent to the slave device, not all of which can be stored in the receive buffer, then the number of bytes lost is added to this counter.

uchRXBadChecksum The counter is incremented each time a receive message is disclosed with an incorrect checksum and a valid slave address.

The command implements header 2.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully.

Page 202: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 202 of 226

DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example Please see dgcctalk_demo.cpp for more information how to use the command.

Page 203: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 203 of 226

3.3.112 CCTALK_CMD_RESET: RESET DEVICE (1)

Definition DG_ERROR cctalk_cmd_reset(

IN int iHandle,

IN unsigned char uchDstAddress)

Parameters iHandle A valid handle value that was returned by cctalk_open_link

function. uchDstAddress The address of the slave device.

Description The function forces a soft reset in the slave device. The command implements header 1.

Errors DGERROR_NORESOURCES Failed to allocate memory to complete the

operation. DGERROR_OK The operation completed successfully. DGERROR_INVALID_PARAMETER One of the specified parameters is invalid. DGERROR_BUFFER_TOO_SMALL The provided buffer is too small to

accommodate all of the received data. DGERROR_LINK_CONFIG Failed to acquire access to the stream specified

by the handle. DGERROR_TIMEOUT The addressed device did not reply.

Example

Please see dgcctalk_demo.cpp for more information how to use the command.

Page 204: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 204 of 226

4 WINDOWS XP EMBEDDED SUPPORT

The Windows XP Embedded Support for the ccTalk SDK incorporates not only Windows XP Embedded components for the ccTalk SDK drivers and run-time software, but also macro components and example configurations to help you get started producing Windows XP Embedded configurations for your Innocore DPX-series single board computer.

4.1 COMPONENT INSTALLATION

The Windows XP Embedded component files are copied to your developer workstation as part of the ccTalk SDK installation. However, the components must still be imported manually into your Windows XP Embedded component database before they can be used.

To import the additional components, close any target or component designer applications you have running and start up the Microsoft Component Database Manager in exclusive mode. The Microsoft Component Database Manager can be found under the Microsoft Windows Embedded Studio program group.

Page 205: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 205 of 226

Now hit the Import button and the Import SLD window should appear

Browse to the DPXConnector.sld file (press …) which can be found under the embedded folder where you installed the ccTalk SDK. For example, on a regular installation, this file can be found as C:\Program Files\Innocore ccTalk SDK\embedded\ccTalk SDK.sld.

Once you have chosen the file, ensure the “Copy repository files to repository root” option is ticked and then press Import:

Page 206: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 206 of 226

The output should resemble the output shown above. You have successfully installed the support for Innocore ccTalk SDK hardware for Microsoft Windows XP embedded. You may now close the Import SLD and Component Database Manager Windows.

Page 207: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 207 of 226

4.2 COMPONENTS

The following components are provided.

• Money Controls ccTalk protocol: provides run-time support for ccTalk communication protocols and application layer.

• Money Controls ccTalk SDK Sample Programs: this component contains binaries compiled from the example code provided with the SDK. There are two variants: one contains dynamically linked executables, the contains statically linked executables.

• Money Controls ccTalk SDK Utility Programs: this component contains the utility programs detail in section 5.

The dependencies have been carefully verified so that you should be able to add these into existing configurations without worrying about missing files or components. All components can be located under the Software: System: Networking & Communications category.

More details are provided in the following sections.

Page 208: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 208 of 226

4.2.1 MONEY CONTROLS CCTALK SDK CCTALK PROTOCOL

The Money Controls ccTalk SDK ccTalk Protocol component provides the ccTalk protocol DLL for binaries dynamically linked with dgccTalk.dll.

You should include this component in your configuration if you want your application to access the ccTalk API using that DLL.

Category Memberships This component is located in these categories:

• Software: System: Networking & Communications

Services There are no services associated with this component

Associated Components There are no components associated.

Settings There are no configurable settings for this component.

File Resources ccTalk.dll (to c:\windows\system32)

Registry Resources There are no registry resources associated with this component

Dependencies There are no dependencies.

Interface Information This component exports the ccTalk SDK ccTalk API.

Page 209: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 209 of 226

4.2.2 MONEY CONTROLS CCTALK SDK SAMPLE PROGRAMS

The Money Controls ccTalk SDK Sample Programs component provides the various sample programs in pre-compiled form.

You should include this component in your configuration if you to be able to debug or test a peripheral from within your embedded configuration.

Category Memberships This component is located in these categories:

• Software: System: Networking & Communications

Services There are no services associated with this component

Associated Components There are no components associated.

Settings There are no configurable settings for this component.

File Resources cctalk_demo.exe (to c:\Program Files\Innocore Gaming ccTalk SDK)

cctalk_app_demo.exe (to c:\Program Files\Innocore Gaming ccTalk SDK)

Registry Resources There are no registry resources associated with this component

Dependencies This component expresses the following dependencies:

• Money Controls ccTalk SDK ccTalk Protocol

Interface Information This component exports no interfaces.

Page 210: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 210 of 226

4.2.3 MONEY CONTROLS CCTALK SDK UTILITY PROGRAMS

The Money Controls ccTalk SDK Utility Programs component provides the ccutil utility program.

You should include this component in your configuration if you to be able to debug or test a peripheral from within your embedded configuration.

Category Memberships This component is located in these categories:

• Software: System: Networking & Communications

Services There are no services associated with this component

Associated Components There are no components associated.

Settings There are no configurable settings for this component.

File Resources Ccutil.exe (to c:\Program Files\Innocore Gaming ccTalk SDK)

Registry Resources There are no registry resources associated with this component

Dependencies This component expresses the following dependencies:

• Money Controls ccTalk SDK ccTalk Protocol

Interface Information This component exports no interfaces.

Page 211: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 211 of 226

5 COMMAND LINE UTILITIES

The ccTalk SDK now includes a command line utility for ccTalk devices which can be used in scripts or for general use. These are installed in /usr/bin on Linux distributions and the installation bin directory on Windows XP installations. The operation is the same under each operating system.

5.1 CCUTIL

Synopsis ccutil –p port [options ...]

ccutil –h | --help

ccutil –-long-help

ccutil –-header-help

ccutil -v

Description The CCutil command allows command-line access to ccTalk devices. The basic synopsis is shown below but many other options are available and these are outlined below.

General command-line options are:

-p port baud-rate

Sets the communications port over which to communicate with a ccTalk multi-drop bus. On Windows port is generally of the form COMx; on Linux port is generally of the form /dev/tty….

The baud-rate for the connection may also be set; if omitted, this defaults to 9600 baud.

The character size is always 8 bits, with no parity and one stop bit.

-h, --help Display a terse usage message.

-v Display the version of the ccutil command.

--long-help Display a full list of options.

--header-help List all ccTalk headers numbers and the ccutil options which implement that header.

Page 212: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 212 of 226

-a N

Set the address of the ccTalk device to which commands will be sent. This address applies only to those command options following it.

-i, --info Display information about the ccTalk device on the specified port and with the specified address.

-d Enable more information to be displayed. This can be used multiple times. It should come before other options on the command line.

Device Addressing Options:

-l

HEADER 253

Display a list of ccTalk device addresses.

--address-clash

HEADER 252

Test to see if a device clash is apparent on the bus.

-A, --address-change N

HEADER 251

Change the address of the device addressed with –a to have the new address N. The device may need a full reset before it starts functioning with the new address.

--random-address

HEADER 250

Change the address of the device addressed with –a to have a new, random address. The device may need a full reset before it starts functioning with the new address. An address probe will have to be performed (option l) to determine the device’s new address.

--address-mode

HEADER 169

Determine and print out the device’s address mode.

-o, --simple-poll

HEADER 254

Perform a simple poll of a device whose address was given by the –a option.

Page 213: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 213 of 226

-r, --reset

HEADER 1

Reset the device.

-C, --clear-comms

HEADER 3

Clear the device’s communications status

Security Options:

-P, --enter-pin [code]

HEADER 218

Set the pin code to be sent to the device for those commands which require one. The code is a 32-bit number transmitted as four bytes in MSB-first order. The PIN code may be expressed in a format acceptable to the strtol() C function, viz. in decimal, in hexadecimal (if preceeded with 0x) or octal (of preceeded with 0).

--change-pin [code]

HEADER 219

Change the PIN code for the device to a new one; if an existing PIN has been set then it must have been sent to the device since the last reset for this command to operate.

--security-level coin#/bill# level

HEADER 181

This command sets the individual acceptance criterion for a given bill or coin on the device.

Consult the device’s manual for further information.

--pump-rnd N

HEADER 161

This option pumps the device’s random number generator. It should be invoked on coin hoppers before requesting a security code used to encrypt a dispense coins operation.

Page 214: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 214 of 226

--cipher-key

HEADER 160

This option obtains and displays the current cipher key from a coin hopper. This key can be used to encrypt the command to dispense a coin on hoppers that support the encrypted form of the dispense-coins command (header 168).

Note: this command is invoked automatically when the –dispense-coins option is used.

--switch-encryption Key

HEADER 137

This option is used on bill acceptors to inform them of the encryption code to use when communicating.

--store-encryption

HEADER 136

This option tells a bill acceptor to write the current encryption code into memory for permament use; the device will then automatically use this setting when it powers up in future.

Coin-hopper options:

--coin-name Sets the communications port over which to communicate with a ccTalk multi-drop bus. On Windows port is generally of the form COMx; on Linux port is generally of the form /dev/tty….

The baud-rate for the connection may also be set; if omitted, this defaults to 9600 baud.

The character size is always 8 bits, with no parity and one stop bit.

--payout-level Display a terse usage message.

-E, --emergency-stop

Page 215: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 215 of 226

-e, --enable-hoppper [on|off]

HEADER 165

When used with no parameter or with the keyword on this option enables a coin opper, thereby allowing it to dispense coins using command header 168.

When used with the keyword off this command disables the hopper, thereby preventing it from dispensing coins.

--disable-hopper

HEADER 165

This option is identical to invoking the option –enable-hopper off.

--dispense-coins [N]

HEADER 168

This option causes a coin hopper to dispense coins. If the hopper has previously been enabled and the correct security settings are supported and in place then the hopper will dispense coins. If the hopper is in single-coin dispense mode then only one coin will be dispensed.

--hopper-status

HEADER 166

This option returns the status of a hopper in terms of the number of coins dispensed and unpaid.

--test-hopper

HEADER 163

This option obtains and displays both test status bytes from the hopper.

Coin-mech & Bill acceptor options:

Page 216: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 216 of 226

--set-inhibit all | none | [/]N …

HEADER 231

Sets the inhibit mask for specific coins or bills on the device.

If the keyword all is supplied then all bills or coins are configured as inhibited.

If the keyword none is supplied then all bills or coins are configured as uninhibited.

If one or more parameters N is supplied then bill/coin number N is inhibited.

If one or more parameters /N is supplied then bill/coin number N is uninhibited.

It is thus possible to set relatively complex patterns of bill/coin inhibitions from a single command:

# ccutil … --set-inhibit all /1 /2 /3

# ccutil … --set-inhibit none 4 5 6

The first invocation inhibits all coins/bills except those in positions 1, 2 and 3. The second invocation clears the inhibition of all notes but numbers 4, 5 and 6.

--master-inhibit [enable|disable]

HEADER 228

This option allows configuration of the device’s master inhibit flag.

If the enable or disable words are used then the device’s master inhibit flag is enabled (no bills are accepted) or disabled (bills are accepted) accordingly.

If no keyword is supplied then the current master inhibit status is reported.

--modify-sorter-override

mask

HEDAER 222

This option specifies the sorter override status.

Page 217: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 217 of 226

--modify-sorter-paths

HEADER 210

This option allows specification of sorter paths for a coin acceptor. Prompts will be given to determine the number of sorter paths (1 or 4) and the sorter numbers for each path.

--default-sorter-path N

HEADER 189

This option allows specification of the default sorter path for coins accepted by a coin acceptor.

--modify-coin-id slot# CCVVVM

HEADER 185

This option allow modification of the coin ID for the coin in slot slot# of a coin acceptor which supports changing coin IDs.

--select-bank [N]

HEADER 179

This option shows or sets the current bank of bill or coin definitions to be used.

If the parameter N is supplied, then the current bank is set to N.

If the parameter N is not supplied then the current bank number is returned.

--modify-inhib inhibit-mask override-mask next-inhibit-mask next-override-mask

HEADER 162

This command allows precise control of the coin acceptance behaviour of a coin acceptor. The two inhibit masks are 16-bit values; the two override masks are 8-bit values. Any of these may be expressed in hexadecimal (with lead 0x characters) or decimal.

Page 218: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 218 of 226

--route-bill reject | stack | wait

HEADER 154

This command deals with a bill just entered into the bill acceptor. Its single parameter operates as follows:

Reject – return the bill from the device;

Stack – accept the bill in the stacker or cash-box;

Wait – defer processing.

--stacker-cycle

HEADER 147

This option attempts to cycle the stacker (if fitted) on a bill/note acceptor.

--accept-limit N

HEADER 135

Configures the maximum number of coins or bills accepted by a device.

--clear-audit

HEADER 89

This option clears any audit data in the device and prints out any data returned by the device.

--show-polling-priority

HEADER 249

This option shows the polling cycle time for a device. The device event buffer must be polled regularly at an interval not exceeding the polling priority or the device may enter an error state and cease operation until the error is acknowledged.

--status

HEADER 248

This option shows the status of a coin or bill acceptor as OK, DECK OPEN or COS ACTIVATED.

--credit-error-codes

HEADER 229

This option shows

Page 219: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 219 of 226

--sorter-status

HEADER 221

This option shows the status of the coin sorted in a coin acceptor.

--option-flag

HEADER 213

This option reads the option flags from the device (if available) and prints them out as a single hexadecimal byte value.

--coin-position-mask credit-code

HEADER 209

This option shows the position mask determine which coin positions for which a particular credit-code is programmed.

--show-sorter-path N

HEADER 209

Shows the sorter path for coin type N on coin acceptors.

--show-counters

HEADERS 225, 226

This option downloads the counter values from the device and displays them.

--default-sorter

HEADER 188

This option obtains and displays the default sorter for a coin acceptor.

--coin-id POS#

HEADER 184

This option shows the coin id for a given slot.

Page 220: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 220 of 226

-b, --show-bills

HEADER 157

This command shows a list of bills programmed into a bill acceptor. It includes columns showing:

* the inhibit status of each bill;

* the position of each bill;

* the name and value of each bill;

* the number accepted for each bill;

* the security setting for each bill (if supported).

--scaling-factor CC

HEADER 156

This command show the scaling factor for the country code CC.

--show-bill-events

--monitor-bill-events

HEADER 159

These two options allow viewing of the events in a bill or coin acceptors event storage buffer.

The events are read and displayed with the oldest first.

The –monitor-bill-events option varies from the –show-bill-events option in that it continues to read new events from the device until the operator explicitly stops the program.

--show-bill-op-mode

HEADER 152

This option reads the operating mode status from the device and displays whether the stacker and escrow options are enabled.

Page 221: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 221 of 226

--set-bill-op-mode [[no]stacker] [[no]escrow]

HEADER 153

This option allows determination of whether the stacker is present and whether escrow mode is enabled.

The keyword stacker determines that a stacker has been fitted. The keyword nostacker determines that a stacker has not been fitted.

The keywords escrow determines that escrow mode should be used. The keyword noescrow determines that escrow mode should not be used.

-show-currency-rev CC

HEADER 145

This option shows the revision of currency specification programmed into the device for the currency with country code CC.

--show-currency-spec

HEADER 91

This option shows which currency is currently programmed into the device.

--request-barcode

HEADER 129

This command returns the code of the last inserted barcode.

--get-note-image top|bottom grey|colour filename

HEADER 90

This option allows downloading an image of the last note inserted into the device. Either the top or bottom sensor’s image can be downloaded and in either grey-scale or colour.

The file is saved in Microsoft™ Windows™ BMP format regardless of any extension to filename.

--table-upload File

HEADER 143

Page 222: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 222 of 226

--teach-mode-control position orientation

HEADER 202

This puts the device into teach mode whereby the features of new notes or coins may be learned. Consult the manual for the specific device on how to use this option.

--teach-status

HEADER 201

This determines and reports the teaching status of the device.

--teach-abort

HEADER 201

This option abandons the current teaching session.

Device Test options:

--self-test

HEADER 232

This option sends a self-test request to the device. The device might or might not implement a full self-test immediately.

The results of the self-test are reported as two decimal numbers; consult the documentation for the device in question on how to interpret the returned data.

--test-solenoids sol#

HEADER 240

Display a terse usage message.

--test-output mask

HEADER 238

This option allows testing of the output lines on devices which have output ports. The mask determines which of up to 8 output lines are pulsed. It is the user’s responsibility to attach other hardware capable of determine whether the pulse was sent correctly.

Page 223: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 223 of 226

--test-lamp lamp# on|off|auto

HEADER 151

This allows specific lamps on the device to be tested. The auto option puts the lamp back under the native control of the device.

--opto-voltages

--operate-motors Motor-mask f|b speed

HEADER 146

This allows direct control of the motors (if any) on a device. For the second parameter supply ‘f’ to operate the motors in the forward direction or ‘b’ to operate the motors in the reverse direction. The speed parameter works as follows:

0 – the default speed

1 – the slowest speed

255 – the fastest speed.

Using setting zero returns control of the motors back to the device.

The command does not determine if the motoros are actually operating; it is up to the operator of the device to determine this manually.

Miscellaneous options:

--database-version

HEADER 243

This command reports the database version programmed into the device.

--input-lines-state

HEADER 237

This command reports the state of any input lines on the device.

--opto-state

HEADER 236

This option reports the state of any optical sensors on the target device.

Page 224: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 224 of 226

--thermistor-read

HEADER 173

This option reports the reading of the device’s thermistor as a single integer.

--latch-output Mask

HEADER 233

This option latches the device’s output lines according to mask.

--memory-storage

HEADER 216

This command reports the amount of storage available on the device and the type of that storage.

--memory-write File [start-block#]

HEADER 214

This command allows write-access to the device’s storage. The data is read from the file called file and written to write-capable storage start at the block start-block#. If the starting block is not specified then writes start at block 0.

An error is reported if this is not sufficient storage in the device to write the entire contents of file.

Page 225: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 225 of 226

--memory-read [start-block# [end-block#]]

HEADER 215

This option allows reading the device’s memory storage. Memory contents are read from the device and output in binary form to the standard output (console). They may be written to a file using the output redirection operator `>’ thus:

C:\> ccutil –p COM4 –a 3 --memory-read >dev3.bin

The output starts at start-block# and end at end-block# - 1. If start-block# is not specified then the read starts from block #0. If end-block# is not specified then the read terminates after the last available block of memory.

A file containing the output of --memory-read may be supplied as the input to the –memory-write option; thus the memory of a given peripheral may be backed up with careful use of these options.

--memory-dump [start-block# [end-block#]]

HEADER 215

This option is identical to the –memory-read option except that the memory contents are output in more human-readable form.

--firmware-upload file

HEADERS 138-140

This option allows an upgrade of the device’s firmware. If the device does not support firmware upgrades then an error is issued.

The device might have to be reset manually after this operation. Consult the operating manual for the device for further information.

Availability Windows XP and Linux: from ccTalk SDK SDK and Run-time release 1.0.1.

Page 226: 200-338_0.2 Money Controls CcTalk User Manual

MoneyControls ccTalk SDK

Software Programmers’ Reference Manual

Doc. ref. 200-338_0.1 DRAFT Page 226 of 226

Appendix 1 INNOCORE GAMING LOCATIONS Innocore Gaming has offices all throughout the world. Major locations are listed below: United Kingdom Innocore Gaming Ltd Innocore House KingFisher Way Silverlink Business Park North Shields NE28 9NX Tel +44 (0) 191 262 4844 Fax +44 (0) 191 263 9287 Email: [email protected] USA Innocore Gaming Ltd., 10400-4 Pioneer Boulevard, Santa Fe Springs, CA 90670 Tel. +1 (562) 941-5000 Fax. +1 (562) 941-5757 Email: [email protected] In addition, Innocore provides product information on the Internet at: www.innocoregaming.com For the latest technical information, please refer to the Innocore gaming Knowledge base at; www.innocoregaming.com/support