GDS Printer Communication Protocol v1.0

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 71

GDS Printer:

Communication Protocol v1.0


Implemented as USB HID Class Device

gsa-p0069.001.01

Gaming Standards Association


Technical Committee

Standard Adopted: 2006/03/23

Document Released: 2006/03/24

www.gamingstandards.com
GDS Printer: Communication Protocol v1.0,
gsa-p0069.001.01
Released on 2006/03/24, by Gaming Standards Association (GSA).

Patents and Intellectual Property


Note: The user's attention is called to the possibility that compliance with this [standard/specification]
may require use of an invention covered by patent rights. By publication of this [standard/
specification], GSA takes no position with respect to the validity of any such patent rights or their
impact on this [standard/specification]. Similarly, GSA takes no position with respect to the terms or
conditions under which such rights may be made available from the holder of any such rights.
Contact GSA for further information.

Trademarks and Copyright


Copyright © 2005 - 2006 Gaming Standards Association (GSA). All rights reserved. All trademarks
used within this document are the property of their respective owners. Gaming Standards Association
and the puzzle-piece GSA logo are registered trademarks and/or trademarks of the Gaming Standards
Association.

GSA Contact Information


GSA – Gaming Standards Association
48377 Fremont Blvd., Suite 117
Fremont, CA 94538
Phone: +1(510) 492-4063
Fax: +1(510) 492-4001
E-mail: sec@gamingstandards.com
WWW: http://www.gamingstandards.com
STANDARD / SPECIFICATION LICENSE AGREEMENT (SSLA)
IMPORTANT - READ CAREFULLY - THIS AGREEMENT DEFINES YOUR RIGHTS TO
USE THE STANDARD AND/OR SPECIFICATION DESCRIBED HEREIN. USING THIS
STANDARD AND/OR SPECIFICATION CONSTITUTES YOUR ACCEPTANCE OF THE
TERMS OF THIS AGREEMENT AND ALL RIGHTS AND CONDITIONS THEREIN.
The standard and/or specification is owned by the GAMING STANDARDS ASSOCIATION
("Licensor"), and licensed to you as a Licensee ("Licensee").

License
Licensor grants to Licensee a non-transferable, non-exclusive license to use the standard and/or
specification (hereinafter referred to as the "Standard"). Requests to reproduce, distribute or modify
the Standard should be directed to the Licensor: Gaming Standards Association, 39355 California
Street, Suite 307, Fremont, CA 94538 – Tel: (510) 744 4007 / Fax (510) 608 5917 / email:
sec@gamingstandards.com. Further licensee agrees that the licensed product will be treated as GSA
“confidential information” and proprietary.

Limited Warranty
THE FOREGOING WARRANTY IS THE SOLE AND EXCLUSIVE WARRANTY AND IS
GIVEN IN LIEU OF ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, INCLUDING,
WITHOUT LIMITATION, THE WARRANTIES OF MERCHANTABILITY OR FITNESS FOR
A PARTICULAR PURPOSE, THE STANDARD IS BEING LICENSED TO YOU "AS IS," AND
LICENSOR DOES NOT WARRANT THAT THE STANDARD WILL MEET YOUR
REQUIREMENTS OR THAT THE OPERATION OF THE STANDARD WILL BE ERROR-
FREE.

Liability
In no event shall Licensor, its employees, agents, suppliers, or contractors be liable for any damages of
any kind or character, including without limitation any compensatory, incidental, direct, indirect,
special, punitive, liquidated or consequential damages, loss of use, loss of data, loss of income or
profit, loss of or damage to property, claims of third parties, or other losses of any kind or character or
attorneys' fees in connection with any claim relating to this Agreement or the performance of the
Standard. In the event that liability is nevertheless imposed on Licensor, its employees, agents,
suppliers or contractors, the liability shall not exceed the annual license fee paid for this Standard.

Termination
This License shall automatically terminate in the event of a breach of any of the terms of this
Agreement. Upon termination, you will be required to cease all use of the Standard and return to
Licensor all materials related to the Standard, all copies of any kind, and any and all accompanying
documentation.

General Terms
This Agreement is not assignable or transferable. The rights under this Agreement, or any License
granted hereunder, may not be assigned, sublicensed or otherwise transferred by Licensee without the
prior written consent of Licensor. This Agreement constitutes the entire Agreement between the
parties relating to the subject matter hereof and may only be modified in writing, signed by each party.
This Agreement supersedes any proposal or prior agreement(s), oral or written, and any other
communications between the parties relating to the subject matter of this Agreement. The laws of the
State of California shall govern this Agreement. Any questions or comments regarding this
Agreement or the Standard should be directed to the Gaming Standards Association, 39355 California
Street, Suite 307, Fremont, CA 94538 – Tel: (510) 744 4007 / Fax (510) 608 5917 / email:
sec@gamingstandards.com.
GDS Printer:
Communication Protocol v1.0 Table of Contents

Table of Contents

About This Document ........................................................................................... iv


About GDS ............................................................................................................................ iv
Acknowledgements ............................................................................................................... iv
Related Documents ............................................................................................................... iv
GSA................................................................................................................................. iv
USB................................................................................................................................. iv
Others .............................................................................................................................. v
Document Conventions .......................................................................................................... v
Document Organization......................................................................................................... vi
Command and Event Detail Organization....................................................................... vi

Revision History ................................................................................................... vii

1 Introduction .......................................................................................................... 1
1.1 Printer Function Overview ................................................................................................ 1
1.2 USB Compliance and Benefits ......................................................................................... 1
1.3 Printers as HID Class Devices ......................................................................................... 2
1.4 Device Firmware Upgrade (DFU) ..................................................................................... 2

2 GDS Peripheral Common Design Characteristics ............................................ 3


2.1 Hardware: Communications ............................................................................................. 3
2.2 Hardware Power-loss and Non-Reproducible Data Recovery ......................................... 3
2.2.1 Non-Volatile Memory............................................................................................... 3
2.2.2 Power Fail Signaling ............................................................................................... 3
2.3 Software: USB Classification ............................................................................................ 3
2.4 Software: Communications Overview............................................................................... 3
2.4.1 Report Delivery and Priority .................................................................................... 4
2.4.2 Command................................................................................................................ 4
2.4.3 Event ....................................................................................................................... 5
2.4.4 Event Acknowledgement......................................................................................... 5
2.4.5 Power Up Sequence ............................................................................................... 6
2.4.6 Device and Host Interaction .................................................................................... 6

3 Command Support ............................................................................................... 8


3.1 Command Execution when Enabled/Disabled ................................................................. 8
3.2 Report 0x01 ACK.............................................................................................................. 9
3.2.1 Transaction ID Rules............................................................................................... 9
3.3 Report 0x02 Enable........................................................................................................ 10
3.4 Report 0x03 Disable ....................................................................................................... 10
3.5 Report 0x04 Self Test..................................................................................................... 10
3.6 Report 0x05 Request GAT Report ................................................................................. 11
3.7 Report 0x08 Calculate CRC ........................................................................................... 11
3.8 Report 0xC0 Define Region............................................................................................ 12
3.9 Report 0xC1 Define Template ........................................................................................ 13

gsa-p0069.001.01 Released: 2006/03/24 Page i


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Table of Contents

3.10 Report 0xC2 Print Ticket .............................................................................................. 14


3.11 Report 0xC3 Form Feed ............................................................................................... 15
3.12 Report 0xC7 Request Printer Metrics ........................................................................... 15
3.13 Report 0xC9 Graphic Transfer Setup ........................................................................... 16
3.14 Report 0xCA File Transfer ............................................................................................ 17

4 Event Support..................................................................................................... 18
4.1 Connection/Disconnection of Communications .............................................................. 18
4.2 Connection/Disconnection of Power............................................................................... 18
4.3 Report 0x06 Power Status.............................................................................................. 19
4.3.1 Rules for Power Status ......................................................................................... 19
4.4 Report 0x07 GAT Data ................................................................................................... 20
4.5 Report 0x09 CRC Data................................................................................................... 21
4.5.1 CRC Rules ............................................................................................................ 21
4.6 Report 0x0A Device State .............................................................................................. 22
4.7 Report 0xC4 Failure Status ............................................................................................ 23
4.7.1 Failure Status Rules............................................................................................. 23
4.8 Report 0xC5 Ticket Print Status ..................................................................................... 24
4.8.1 4.8.1 Ticket Print Status Rules ............................................................................. 24
4.9 Report 0xC6 Transfer Status.......................................................................................... 26
4.9.1 Status Codes ........................................................................................................ 27
4.10 Report 0xC8 Metrics ..................................................................................................... 28
4.11 Report 0xCB Printer Status .......................................................................................... 29

5 Number Allocation and Report Summary ........................................................ 30


5.1 Usage Number Allocation .............................................................................................. 30
5.2 Report ID Allocation........................................................................................................ 31
5.3 Report Summary Table .................................................................................................. 31

6 USB Identification Strings ................................................................................. 35


6.1 idVendor ......................................................................................................................... 35
6.2 idProduct ........................................................................................................................ 35
6.3 iManufacturer.................................................................................................................. 35
6.4 iProduct .......................................................................................................................... 35
6.4.1 Protocol Level - Major ........................................................................................... 36
6.4.2 Protocol Level - Minor ........................................................................................... 36
6.4.3 Product Name ....................................................................................................... 36
6.4.4 Firmware Issue...................................................................................................... 36
6.4.5 Build Version ......................................................................................................... 36
6.4.6 Manufacturing Date............................................................................................... 36
6.5 iSerialNumber................................................................................................................. 37
6.6 Peripheral Class ............................................................................................................. 37

7 Metrics Command Data Format ........................................................................ 38


7.1 Metrics Report Data Structure ........................................................................................ 38
7.2 PR: Report Printer Resolution ........................................................................................ 39
7.2.1 Structure................................................................................................................ 39
7.2.2 PR Attribute........................................................................................................... 39

gsa-p0069.001.01 Released: 2006/03/24 Page ii


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Table of Contents

7.2.3 Example ................................................................................................................ 39


7.3 PS: Report Paper Size ................................................................................................... 40
7.3.1 Structure................................................................................................................ 40
7.3.2 PS Attributes ......................................................................................................... 40
7.3.3 Example ................................................................................................................ 40
7.4 GM: Report Free Graphic Memory ................................................................................. 41
7.4.1 Structure................................................................................................................ 41
7.4.2 GM Attributes ........................................................................................................ 41
7.4.3 Example ................................................................................................................ 41
7.5 RCS: Report International Character Support ................................................................ 41
7.5.1 Structure................................................................................................................ 41
7.5.2 Example ................................................................................................................ 41
7.6 RPT: Report Supported Predefined Templates .............................................................. 42
7.6.1 Structure................................................................................................................ 42
7.6.2 Example ................................................................................................................ 42
7.7 RBS: Report Barcode Support ....................................................................................... 43
7.7.1 Structure................................................................................................................ 43
7.7.2 Barcode Symbology Indexes ................................................................................ 43
7.7.3 Example ................................................................................................................ 43
7.8 FS: Fonts Supported ..................................................................................................... 44
7.8.1 Structure................................................................................................................ 44
7.8.2 FS Element ........................................................................................................... 44
7.8.3 FS Attributes ......................................................................................................... 44
7.8.4 Required Font Support.......................................................................................... 44
7.8.5 Example ................................................................................................................ 45
7.9 CS: Color Support .......................................................................................................... 45
7.9.1 Structure................................................................................................................ 45
7.9.2 CS Element ........................................................................................................... 45
7.9.3 CS Attribute........................................................................................................... 45
7.9.4 Example ................................................................................................................ 45
7.10 Example: Data Structure .............................................................................................. 46

Glossary ................................................................................................................ 47

Appendix A: CRC-32 Checksum Calculation..................................................... 48


A.1 Assembly Example......................................................................................................... 48
A.2 C Language Example..................................................................................................... 56

Appendix B: Printer Report Descriptors ............................................................ 58

Index ...................................................................................................................... 59

gsa-p0069.001.01 Released: 2006/03/24 Page iii


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 About This Document

About This Document


This specification defines the communication protocol of the GSA GDS (Gaming Device
Standards) printer.

About GDS
GSA Gaming Device Standards controls the flow of information between a slot machine and
the array of peripheral devices operating inside it, including bill validators, card readers and
ticket printers using Universal Serial Bus (USB) standards protocol. In essence, one command
set that each peripheral device would use to communicate with its host slot machine. That
information can then be relayed to the casino management system through the machine
message protocol, such as GSA’s BOB Message Protocol.
For more details about GSA, visit the Web site: http://www.gamingstandards.com.

Acknowledgements
The Gaming Standards Association would like to express its appreciation to all members of
the GDS committee, past and present, for their significant contribution and dedication to the
creation of this standard.

Related Documents

GSA
Gaming Standards Association documents referenced (http://www.gamingstandards.com):

Ref Title and Source

DCFRS Device Class FRS, version A3, GSA PN [TBD]


BCTS GDS Bar Coded Ticket Format Specification
GAT3 Requirements for the Game Authentication Terminal Program (GAT3)
GDSPDL GDS Page Definition Language

USB
USB Implementers Forum, Inc., http://www.usb.org, documents referenced:

Ref Title and Source

USB1.1 Universal Serial Bus Specification, v1.1


http://www.usb.org/developers/data/usbspec.zip
DCDHID Device Class Definition for HID, v1.11
http://www.usb.org/developers/data/devclass/HID1_11.pdf
DFU Device Firmware Upgrade, v1.0
http://www.usb.org/developers/data/devclass/usbdfu10.pdf

gsa-p0069.001.01 Released: 2006/03/24 Page iv


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 About This Document

Others

Ref Title and Source

PP0.8 PowerPlus Specification, 0.8


http://www.poweredusb.org/pusbparts/parts.html
ISO 639 International Organization for Standards, http://www.iso.org,
Language Codes.

Document Conventions
Plain text indicates specification text.
Courier New text indicates directory paths, code or pseudo-code.

Blue text indicates an active cross-reference to another section in the document or a


hyperlink to a location on the Internet.
Italic text indicates additional information to either clarify specification text or to inform the
reader of related information.

gsa-p0069.001.01 Released: 2006/03/24 Page v


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 About This Document

Document Organization

Chapter 1 Overview of purpose and benefits of the GDS printerspecification.


Chapter 2 Hardware and software characteristics common to all GDS peripheral
devices. Common reports are listed with references to the appropriate detail
sections in chapters 3 and 4.
Chapter 3, 4 Command and event details, respectively. Both chapters are similarly
organized. See Command and Event Detail Organization below.
Chapter 5 Usage number and report ID allocation for the GDS printer protocol, as well
as high-level allocation for GDS peripheral device protocols in general.
Report summary, in tabular format, printer reports and report items, with
corresponding details such as usage number and/or report ID.
Chapter 6 USB identifier strings, such as vendor codes assigned by USB-IF, as well as
other identifiers, including product and manufacturer identifiers.
Chapter 7 Printer Metrics Data format. Format of data send in the Metrics report.
Glossary Definitions of terms.
Appendix A CRC-32 checksum calculation, with assembly and C code examples, adapted
for calculation time considerations and for space considerations.
Appendix B Report Descriptors (TBD)

Command and Event Detail Organization


Chapters 3 and 4 are similarly organized as follows:
1. Table listing the reports described in the chapter: report ID, usage number, text label,
whether data is sent in the report, and page number where details appear.
2. Overview information, if any.
3. Report detail sections. Reports are listed in numerical order by report ID.
a. Description of report.
b. Usage examples or scenarios, if any.
c. Usage rules, if any.
d. Report structure table.
e. Item description table, if applicable. If the only data sent in the report is the
report ID, this table is not included.

gsa-p0069.001.01 Released: 2006/03/24 Page vi


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Revision History

Revision History
The following table lists the changes made this document.
Revisions

Doc. Rev. Description

v1.0 1. Standard approved by membership.


2006/03/24
v0.8 1. Report Summary Table: Renumbered usage IDs so that identical fields that
2005/12/22 appear in multiple reports use the same usage ID.
v0.7 1. Report Summary Table: Added devices back in, and added usage IDs.
2005/12/21
v0.6 1. Report Summary Table: removed first section rows which list devices.
2005/12/05 Because usage IDs aren’t included in this version, these rows included only
the device names in the comment column.
2. USB ID Strings: added the card reader in the peripheral class section.
v0.5 1. Usage Number Allocation: Added the card reader to the list of allocated
2005/12/02 devices in Chapter 5.
v0.4 1. 0xC9 Graphic File Transfer: corrected value for File Size.
2005/12/02 2. 0xCA File Transfer: corrected value for Index.
v0.3 Most of the following changes address multiple changes described in GDSPP-18.
2005/11/30 Other issues addressed include GDSPP-2, -4, -5, -9, -12, and -14.
1. Brought specification up to date with 1.1 changes.
2. 0x02 Enable: Changed to specify requirement when device has no faults.
3. 0xC0 report, now Define Region: changed function and content.
4. 0xC1 report, now Define Template: changed function and content.
5. 0xC2 Print Ticket: changed function and content.
6. 0xC3 Transfer Status: new event.
7. 0xC4 Failure Status:
• Added NVM, Print Head Damaged, and Temperature Error bit.
• Remove Transaction ID byte, and bits Chassis, Print Head, Ticket
Loaded, and Paper Jam].
8. 0xC5 report, now Ticket Print Status: changed function and content.
9. 0xC7 Request Printer Metrics: new command.
10. 0xC8 Metrics: new event.
11. 0xC9 Graphic Transfer Setup: new command.
12. 0xCA File Transfer: new command.
13. 0xCB Printer Status: new event.
v0.2 Converted into GSA format.
2005/06/13
v0.1 Created.
2005/03/14

gsa-p0069.001.01 Released: 2006/03/24 Page vii


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 1: Introduction

1 Introduction
This is the specification for a USB printer as defined by the GDS within the GSA. The aim of
the GDS is to develop true plug ‘n’ play peripherals for the gaming environment which are
already common place in the computer industry. Rather than use a derivative of RS232 it was
decided to move the technology forward and adopt the USB standard. This document
specifies the high level design of printers that will:
• be used to derive a specific USB based implementation of the Device Class
Functional Requirement Specification (see document reference DCFRS).
• satisfy the set of common functional requirements as specified in the DCFRS.
• satisfy the specific functional requirements for the printer class as specified in the
DCFRS.
This document specifies the complete set of functionality for the GDS printer.

1.1 Printer Function Overview


Commands supported by the printer are defined in chapter 3. Supported events are defined in
Chapter 4. Common commands and events are identified in Chapter 2.
The printer on power-up must be disabled, run a diagnostic test, and report events as
necessary.
The printer stores information about critical ticket fields (for example, Validation and
Barcode), even over power failure intervals, until the acknowledgement of the ticket printing
transaction is received from the host.
The interrupt service period, bInterval, is 100 ms.

1.2 USB Compliance and Benefits


USB is currently available in three speeds:
• low speed: 1.5 Mbits/sec.
• full speed: 12Mbits/sec.
• high speed: 480Mbits/sec.
GDS peripherals must use full speed USB chips.
The device must be compliant to USB issue 1.1 (see document reference USB1.1). The
extensions for high speed devices in USB issue 2.0 are not required but USB 2.0 is backwards
compatible.
Only one master exists on the USB bus and that is the host machine. All peripherals must be
connected through hubs (up to 127 allowed but this is likely to be less than 10). There is no
requirement for OTG (On-The-Go) extensions to allow peripherals to talk directly to one
another. Also, for security reasons, it is undesirable to have a direct peripheral-to-peripheral
communication path. All communication must be via the host.

gsa-p0069.001.01 Released: 2006/03/24 Page 1


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 1: Introduction

1.3 Printers as HID Class Devices


To remove the need for special manufacturer-specific device drivers, the printer is
implemented as an HID—Human Interface Device—class device (see document reference
DCDHID). This is the same class as mice, keyboards and joysticks but is a flexible enough to
be used for general input/output data packets where the data sizes are relatively small and the
transfer rates low. HID implements usage pages and usage numbers to allow access to data in
an abstracted fashion, regardless of the manufacturer or even the exact location within a
report of where the data can be found. For a joystick there is a usage number for button_1,
likewise for a printer there is a usage number for the note identifier.
This document assumes hardware and firmware is in place to support a HID class device
within USB and so need only concern itself with HID commands and data formats for
gaming. Product identification is also discussed.

1.4 Device Firmware Upgrade (DFU)


GDS devices will use the Device Firmware Upgrade (DFU) standard, version 1.1, as defined
by USB-IF, http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf.
The use of the DFU class must not affect the behavior of the HID class.
Upon firmware upgrade the device must clear its internal memory.

gsa-p0069.001.01 Released: 2006/03/24 Page 2


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 2: Common GDS Peripheral Design Details

2 GDS Peripheral Common Design Characteristics


This section describes characteristics shared by all GDS peripheral devices.

2.1 Hardware: Communications


USB 1.1 defines low (1.5Mbits/sec.) and full (12Mbits/sec.) speed communications. GSA
devices must be implemented as full speed devices.
The USB specification defines a reliable means of communication at both hardware and
software levels, including error detection and recovery. See document reference USB1.1.

2.2 Hardware Power-loss and Non-Reproducible Data Recovery

2.2.1 Non-Volatile Memory


For critical function devices only (see document reference DCFRS), devices must implement
non-volatile memory (NVM).
If battery-backup systems are implemented, the device must implement battery level circuitry
to detect when the method of storage is no longer reliable.
If non-volatile memory fails, the non-volatile memory (NVM) failure event must be reported.
See 0xC4 Failure Status event, on page 23.

2.2.2 Power Fail Signaling


Devices must implement power fail detect circuitry and a power reserve capability when
NVM is required.

2.3 Software: USB Classification


Devices must be classified as HID devices unless otherwise indicated.

2.4 Software: Communications Overview


A set of standard device requests are defined by USB and HID defines additional class-specific
requests for managing reports. All device classes are to implement GET/SET REPORT and
GET/SET IDLE HID requests unless otherwise stated.
Under HID, all device communications must be encoded into a reporting structure as defined
by Device Class Definition for Human Interface Devices. See document reference
DCDHID.
The host sends a report to the peripheral to issue a command and where a peripheral wishes
to notify the host of an event, it sends a report on the INTERRUPT IN endpoint as specified
by the devices report descriptor. The report ID indicates the event type and the report data
indicates any event data.

gsa-p0069.001.01 Released: 2006/03/24 Page 3


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 2: Common GDS Peripheral Design Details

2.4.1 Report Delivery and Priority


If the host requires information from the peripheral, it requests a report. The report ID
identifies the information to retrieve. Reports can be scheduled for delivery at regular
intervals if desired. However, note that on power up, devices must handle messages in the
following priority:
1. Power status event
2. Failure status event
3. Pending Transaction ID event
4. Any previously stored Transaction ID events that were in addition to the pending
Transaction ID event
The design that follows, however, focuses on higher level primitives to assist those not
familiar with the USB software layer.
D o n n o t c o n f u s e t h e a ckn o w l e dg m e n t s y s t e m d ef i n e d b y t h e U S B pr o t o c o l l a yer w i t h
t h e e ve n t a ckn o w l e d g m e n t s y s t e m d e f i n e d b e l o w.
The concept of a command, event and event acknowledgment are now defined.

2.4.2 Command
Commands specified in this document are sent from host to device. These commands are
implemented as USB FEATURE reports. See document reference USB1.1. The following
table identifies commands currently implemented as common reports (see sections 5.1 and
5.2). These commands are used by multiple device classes. At the time of this writing, the
commands are implemented by the coin acceptor, coin hopper, printer, and note acceptor
device classes.

Report ID Usage ID Name Data Page

0x01 0x40 ACK No page 9


0x02 0x41 Enable No page 10
0x03 0x42 Disable No page 10
0x04 0x43 Self Test No page 10
0x05 0x44 Request GAT Report No page 11
0x08 0x48 Calculate CRC Yes page 11

gsa-p0069.001.01 Released: 2006/03/24 Page 4


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 2: Common GDS Peripheral Design Details

2.4.3 Event
Events specified in this document are sent from device to host.
USB simulates the concept of an interrupt through regular polling intervals issued by the
host’s USB device driver. The interrupt service period is specified by the device via an
endpoint descriptor. The interrupt interval chosen is based on the function of a device.
Events can be sent at regular intervals, when the device has something to send or when the
host has requested that an event be sent.
An application level acknowledgment is required for some events. These events deal with
currency related activities or fault activities. The Host must make sure that it has acted on
them and not just received them before Acknowledging these events to the device.
The protection is needed such that on power loss, these events are not lost but resent when
power is restored and the host can decide if it had serviced the event prior to power loss or
must do so now.
Status events need to be reported when a fault occurs and when it is cleared.
The following table identifies events currently implemented as common reports (see sections
5.1 and 5.2). These events are used by multiple device classes. At the time of this writing, the
events are implemented by the coin acceptor, coin hopper, printer, and note acceptor device
classes.

Report ID Usage Event Data Page

N/A USB Defined Connection No page 18


N/A USB Defined Disconnection No page 18
0x06 0x45 Power Status Yes page 19
0x07 0x46 GAT Data Yes page 20
0x09 0x48 CRC Data Yes page 21
0x0A 0x4A Device State Yes page 22

2.4.4 Event Acknowledgement


For Transaction ID (TID) events only, an event acknowledgment is required.
Critical events sent from a device and the host’s acknowledgment command contain a
transaction ID.
Transaction IDs are be one (1) byte in length and initially start at zero (0). Transaction IDs
wrap to zero (0) after reaching the upper limit of 255.
The host increment its transaction ID when the transaction ID of the event matches the
host’s copy. The host sends a 0x01 ACK command (see page 9) to the device only after it has
serviced the event.
A device increments its transaction ID when it receives an ACK from the host indicating the
transaction ID of the pending event.

gsa-p0069.001.01 Released: 2006/03/24 Page 5


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 2: Common GDS Peripheral Design Details

If transaction numbers do not match, the host may send an ACK indicating the received TID
after handling this mismatching event; may resynchronize transaction IDs or may take any
other action.
If transaction ID events with TID x are received by the host while the host is busy processing
an event with transaction ID x, the host may choose to ignore these messages as they are
duplicates of the event being processed.
The device re-sends the event when it receives an ACK with a wrong transaction ID.
However, if the device has just recovered from power loss and has detected that an event was
waiting acknowledgement when power was lost, and has resent the event, the device discards
the resent event as soon as the ACK is received. The host either has indicated that it had
already serviced it or did just then. Regardless the transaction ID is incremented and
operation continues.
Transaction ID events can only be sent if there is no pending Transaction ID event. Devices
must queue any un-sent and pending Transaction ID events.
If an event is unrecognized by the host, the host may ignore the event or take some other
action.
If an ACK is not received within one (1) second then the event is resent to the host.

2.4.5 Power Up Sequence


Upon power up and after enumeration, the device stays in the Disabled state. During this
time the device must continuously monitor itself for any failure or fault events. During this
time, only the 0x03 Disable command (see page 10) is accepted by the device. Any other
command will be ignored.
After the device receives its first Disable command from the host, it responds with the
0x0A Device State event (see page 22)and then it reports any event messages in the following
priority.
1. Power Status events, if external power is missing.
2. Any Failure Status events. These are not TID events and are real time status events.
3. Any pending credit or pending status events. These are defined as any printer TID
that was already placed into EndPoint 1 stack for transmission, but was not
completely communicated to the host. A complete communication requires that the
host acknowledge the event and also that the Transaction ID rules have been met
whereby both the host and device Transaction IDs are in sync. These pending events
must be transmitted to the host in their order of occurrence.
4. Any previously stored printer TID events that were in addition to the pending TID
event described in the above item #3.
Note: A device must be ready to accept the Disable command from host within two (2)
seconds after enumeration.

2.4.6 Device and Host Interaction


The device uses the USB Device Layer ACK and NAK handshake protocols to control the
receipt of commands from the host. If the device NAKs a command, the host retries the
transaction until the device responds with an ACK. The host may use any method to
determine if a device has NAKed the host too long.

gsa-p0069.001.01 Released: 2006/03/24 Page 6


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 2: Common GDS Peripheral Design Details

When the device acknowledges a command packet, the device accepts responsibility to
complete the command. Commands must be completed within the allocated time-out
periods. For the 0x08 Calculate CRC (see page 11) and 0x04 Self Test (see page 10)
commands the host allows a maximum time-out of 20 seconds between the receipt of the
ACK and the return of requested data on the Input End Point. This time-out is five (5)
seconds for all other commands that operate during the disabled state and have an associated
response to the host. The 0x03 Disable command (see page 10) is an exception and must
respond to the host within three bIntervals (see Printer Function Overview on page 1).
Care must be taken in the device firmware to ensure that a NAK_OUT is used without
STATUS_IN being included because the host might interpret the ACK of the status packet
as receipt of the command. The device firmware must also ensure that upon returning to an
ACK_OUT state that the device also includes the STATUS_IN instruction to allow the
command from the host to be recognized. To repeat: to stop receipt of commands from the
host, the device must perform a NAK_OUT instruction; and to accept commands from the
host, the device must perform an ACK_OUT_STATUS_IN instruction.
More information is available in section 5.3.2 and section 4.4 of the USB specification (see
document reference USB1.1).

gsa-p0069.001.01 Released: 2006/03/24 Page 7


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 3: Command Support

3 Command Support
The following printer commands are supported and are to be implemented as HID Feature
reports.
Report ID Name Data Page
0x01 ACK No page 9
0x02 Enable No page 10
0x03 Disable No page 10
0x04 Self Test No page 10
0x05 Request GAT Report No page 11
0x08 Calculate CRC Yes page 11
0xC0 Define Region Yes page 12
0xC1 Define Template Yes page 13
0xC2 Print Ticket No page 14
0xC3 Form Feed No page 15
0xC7 Request Printer Metrics No page 15
0xC9 Graphic Transfer Setup Yes page 16
0xCA File Transfer Yes page 17

NOTE: The following reports are diagnostic commands: Report 0x04 Self Test, Report 0x05
Request GAT Report, Report 0x08 Calculate CRC.

3.1 Command Execution when Enabled/Disabled


The following table shows the device state a given command can be performed under. No
action is taken if a command is sent with the printer in the wrong state.
Operation When Operation When
Command Device Enabled Device Disabled
0x02 Enable Yes Yes
0x03 Disable Yes Yes
0x04 Self Test No Yes
0x05 Request GAT Report No Yes
0x08 Calculate CRC No Yes
0xC0 Select Ticket Yes No
0xC1 Field Data Yes No
0xC2 Print Ticket Yes No
0xC3 Form Feed Yes No
0xC7 Request Printer Metrics Yes Yes
0xC9 Graphic Transfer Setup Yes No
0xCA File Transfer Yes No

gsa-p0069.001.01 Released: 2006/03/24 Page 8


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 3: Command Support

3.2 Report 0x01 ACK


This is a pseudo-command as it is sent in response to a Transaction ID event from the printer
as part of the handshake sequence. This command is used to confirm critical events such as
the TID event 0xC5 Ticket Print Status.
A Transaction ID stamp is used to ensure that every printer TID event is properly handled by
the host and only acknowledged events are removed from the printer queue. If the device
does not receive an ACK from the host within one (1) second then the event is resent to the
host.
The Transaction ID protocols are only used with TIDs. If power is removed before all of the
printer TID events have been completely communicated with the host, they are re-issued by
the printer when power is restored and enabled. Therefore any un-sent or pending printer
TIDs must be buffered in NVM.

3.2.1 Transaction ID Rules


1. Transaction IDs increment through the range 0 to 255.
2. Transaction IDs are only cleared from the printer stack after the host has
acknowledged the event and also the Transaction ID rules have been met whereby
both the host and device Transaction IDs are in synch.
3. The current Transaction ID must be stored in the device's NVM so as to provide a
reference number in the event of a power interruption.
4. If the device does not receive an acknowledge from the host within one (1) second
after sending a critical event, the device must retry sending the event every one (1)
second until the host properly acknowledges the event and the Transaction IDs are
in sync.
5. While waiting for an ACK, a device must not NAK, at the USB level, a command
from the host.
Bit 7 6 5 4 3 2 1 0

Byte 0 0x01
Byte 1 - - - - - - - Resync
Byte 2 Transaction ID

0x01 Item Name Value Description

Resync 0 The device must not re-sync its Transaction ID. This
is an acknowledgement.
1 The device MUST re-sync its Transaction ID and re-
send the report.
Transaction ID 0 to 0xFF The confirmed or new Transaction ID. See rules in
section 3.2.1.

gsa-p0069.001.01 Released: 2006/03/24 Page 9


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 3: Command Support

3.3 Report 0x02 Enable


The device activates any inputs and/or enables any outputs. If the device has a fault then it
must stay disabled and report the fault to the host. If the device has no faults, after enabling
itself the device sends the 0x0A Device State event (see page 22) with the enable bit set..

Bit 7 6 5 4 3 2 1 0

Byte 0 0x02

3.4 Report 0x03 Disable


The device deactivates any inputs and/or disable any outputs. The host must send a Disable
command before issuing any diagnostic commands (defined on page 47).
When the device is in the enabled state and receives a Disable command, the device must
immediately disable itself and respond with the 0x0A Device State event (see page 22).

Bit 7 6 5 4 3 2 1 0

Byte 0 0x03

3.5 Report 0x04 Self Test


The device initiates a self-test sequence when instructed by the host. When the host requests
a self-test, the device must respond with a 0xC4 Failure Status event (see page 23). The device
must complete all tests before sending the Failure Status event to the host. Multiple failures
must be presented in the final single Failure Status event, with the exception of multiple
'Other' failures, which must be reported in separate Failure Status events.

Bit 7 6 5 4 3 2 1 0

Byte 0 0x04
Byte 1 - - - - - - - NVM

0x04 Item Name Value Description

NVM 0 Perform self-test.


1 Non-volatile Memory (NVM), previously queued
Transaction ID events and Transaction ID sequence
number, must be cleared before the self-test is
performed.

gsa-p0069.001.01 Released: 2006/03/24 Page 10


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 3: Command Support

3.6 Report 0x05 Request GAT Report


Sending this command requests diagnostic information from the printer via a 0x07 GAT
Data event (see page 20). The device is not required to monitor itself for fault conditions
during the performance of this command. The command must be in ASCII format for
transfer out of the machine GAT port in XML format. The following characters are not to be
used in the GAT data: '<' or '/>'. The printer does not output in XML.
GAT data is manufacturer-specific in terms of length and content. See document reference
GAT3.

Bit 7 6 5 4 3 2 1 0

Byte 0 0x05

3.7 Report 0x08 Calculate CRC


The host can request a 32-bit checksum from the code space within the printer’s ROM
memory, excluding the USB Identification Strings (see page 35). For additional accuracy and
security, a 32 bit seed is sent to the device as a parameter of this command. The host may
choose any seed value and compare the result with a look-up table or a similar calculation
based on an exact reference copy of the code to be verified.
A checksum report is returned in the 0x09 CRC Data event (see page 21) with the result.
While calculating the CRC the device is not required to receive any additional commands.
The device is permitted to NAK_OUT all requests from the host while performing the CRC
calculation. The device is also not required to monitor itself for fault conditions during the
performance of this command.
See Appendix A for details of the CRC algorithm used.

Bit 7 6 5 4 3 2 1 0

Byte 0 0x08
Byte 1 Seed 0
Byte 2 Seed 1
Byte 3 Seed 2
Byte 4 Seed 3

0x08 Item Name Value Description

Seed 0 to 255 The starting seed for the CRC-32 calculation. Seed 0
is the LSB.

gsa-p0069.001.01 Released: 2006/03/24 Page 11


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 3: Command Support

3.8 Report 0xC0 Define Region


The host issues this command to define printable regions for a ticket that will be printed.
Printable regions may be defined to contain text, barcodes or graphic images. Predefined
default content may be specified in this command. Only one printable region may be defined
at a time using this report.
Report 0xC1 Define Template (page 13) is used to associate printable regions defined using
this Define Region command with a specific template. Report 0xC2 Print Ticket (page 14)
instructs the printer to print a content using a specific template.
The format of the data in this command is defined in the DPR command of the GDS Page
Definition Language specification.
If the total Data size exceeds 61 bytes it can be broken into a number of sequential reports.
Data up to 61 bytes in size may be sent in a single report with the Index set to one (1) and the
Size between 0 – 61. If the Data is longer than this, then the data must be split into sequential
packets with all packets having a Size of 61 bytes followed by a terminating packet which
must have a size of less than 61 bytes. In this way the host knows when all data has been
received. If the last data packet fills a 61 byte report exactly then a null packet must be sent as
a terminator. This will have a Size of zero (0). Index numbers start at one (1) and increment
with each packet sent. The printer can stitch all Data packets together in the Index number
sequence to reproduce the complete Data report.
The first report will have Index = 1. If more reports are needed to return all the Field Data
then they are indexed 2, 3, 4…etc.
The Size byte indicates how many bytes are used within the fixed size report structure as the
last report may not need all the available space.
Note: Regions that are not predefined—that is, having identifiers in the range of 100 through
999— are not stored across power cycles.
Bit 7 6 5 4 3 2 1 0

Byte 0 0xC0
Byte 1 Index
Byte 2 Size
Byte 3 Data 1

Byte 63 Data 61

0xC0 Item Name Value Description

Index 1 to 255 Indicates a sequence if this command spans multiple


USB packets. This is modeled after the GAT report.
Size 0 to 61 Number of bytes of data to follow. The last packet
may contain less that 61 characters.
Data ASCII characters as defined in the DPR command
32 to 255 in the GDS Page Description Language
specification.

gsa-p0069.001.01 Released: 2006/03/24 Page 12


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 3: Command Support

3.9 Report 0xC1 Define Template


The host issues this command to define a template for a ticket that will be printed. A template
identifies the printable regions, defined in the 0xC0 Define Region command (page 12) , to be
included on a ticket. Report 0xC2 Print Ticket (page 14) instructs the printer to print a ticket
using a template defined with this Define Template command. The Print Ticket command
may also specify dynamic content to be printed.
The format of the data in this command is defined in the DPT command of the GDS Page
Definition Language specification.
If the total Data size exceeds 61 bytes it can be broken into a number of sequential reports.
Data up to 61 bytes in size may be sent in a single report with the Index set to one (1) and the
Size between 0 – 61. If the Data is longer than this, then it must be split into sequential
packets with all packets having a Size of 61 bytes followed by a terminating packet which
must have a size of less than 61 bytes. In this way the host knows when all data has been
received. If the last data packet fills a 61 byte report exactly then a null packet must be sent as
a terminator. This will have a Size of zero (0). Index numbers start at one (1) and increment
with each packet sent. The printer can stitch all the Data packets together in the Index
number sequence to reproduce the complete Data report.
The first report will have Index = 1. If more reports are needed to return all the Field Data
then they are indexed 2, 3, 4…etc.
The Size byte indicates how many bytes are used within the fixed size report structure as the
last report may not need all the available space.
Note: Templates that are not predefined—that is, having an identifier in the range of 100
through 999— are not stored across power cycles.

Bit 7 6 5 4 3 2 1 0

Byte 0 0xC1
Byte 1 Index
Byte 2 Size
Byte 3 Data 1

Byte 63 Data 61

0xC1 Item Name Value Description

Index 1 to 255 Packet sequence counter for multi-packet reports.


Size Number of bytes of data to follow. Last packet may
0 to 61
contain less than 61 characters.
Data ASCII characters as defined in the DPT command
32 to 255 in the GDS Page Description Language
specification.

gsa-p0069.001.01 Released: 2006/03/24 Page 13


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 3: Command Support

3.10 Report 0xC2 Print Ticket


The host issues this command to print a ticket using a specified template, with either
dynamically defined or predefined content. To print a ticket, the printable regions and a
template must be defined using 0xC0 Define Region (page 12) and 0xC1 Define Template
(page 13).
Dynamically defined regions and templates, assigned identifiers in the range of 100 through
999, are not stored across power cycles. Predefined regions and templates, assigned identifiers
in the range of 000 and 099, are stored in and accessible from the printer’s NVM.
The format of the data in this command is defined in the PT command of the GDS Page
Definition Language specification.
If the total Data size exceeds 61 bytes it can be broken into a number of sequential reports.
Data up to 61 bytes in size may be sent in a single report with the Index set to one (1) and the
Size between 0 – 61. If the Data is longer than this, then it must be split into sequential
packets with all packets having a Size of 61 bytes followed by a terminating packet which
must have a size of less than 61 bytes. In this way the host knows when all data has been
received. If the last data packet fills a 61 byte report exactly then a null packet must be sent as
a terminator. This will have a Size of zero (0). Index numbers start at one (1) and increment
with each packet sent. The printer can stitch all the Data packets together in the Index
number sequence to reproduce the complete Data report.
The first report will have Index = 1. If more reports are needed to return all the Field Data
then they are indexed 2, 3, 4…etc.
The Size byte indicates how many bytes are used within the fixed size report structure as the
last report may not need all the available space.

Bit 7 6 5 4 3 2 1 0

Byte 0 0xC2
Byte 1 Index
Byte 2 Size
Byte 3 Data 1

Byte 63 Data 61

0xC2 Item Name Value Description

Index 1 to 255 Packet sequence counter for multi-packet reports.


Size Number of bytes of data to follow. Last packet may
0 to 61
contain less than 61 characters.
Data 32 to 255 ASCII characters as defined in the PT command in
the GDS Page Description Language specification.

gsa-p0069.001.01 Released: 2006/03/24 Page 14


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 3: Command Support

3.11 Report 0xC3 Form Feed


The host issues this command to instruct the printer to feed a blank ticket.

Bit 7 6 5 4 3 2 1 0

Byte 0 0xC3

3.12 Report 0xC7 Request Printer Metrics


The host issues this command to request the printer’s capabilitiy metrics, such as fonts
supported, whether barcode is supported, and the graphic files-to-index mapping. The printer
sends the 0xC8 Metrics event (page 28) in response.

Bit 7 6 5 4 3 2 1 0

Byte 0 0xC7

gsa-p0069.001.01 Released: 2006/03/24 Page 15


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 3: Command Support

3.13 Report 0xC9 Graphic Transfer Setup


The host issues this command to indicate the type, size, and identifier of the graphic the host
will download to the printer in the following 0xCA File Transfer command (page 17). The
identifier, the Index, is used to identify the graphic as content for a printable region (See the
GDS Page Definition Language specification).
To determine the maximum memory size allocated in RAM to hold graphics, the host uses
the 0xC7 Request Printer Metrics command.

Bit 7 6 5 4 3 2 1 0

Byte 0 0xC9
Byte 1 Type
Byte 2 Index
Byte 3 File Size (LSB)
Byte 4 File Size (MSB)

0xC9 Item Name Value Description

Type 0x01 Bitmap graphic file.


0x02 PCX graphic file.
Index Index into graphic array. After the graphic is
0 to 255 downloaded into the printer, this value can then be
referenced when defining printable regions.
File Size 0 to 65535 Least significant byte and most significant byte,
respectively, of the file size.

gsa-p0069.001.01 Released: 2006/03/24 Page 16


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 3: Command Support

3.14 Report 0xCA File Transfer


The host issues this command to download a graphic file after having issued a 0xC9 Graphic
Transfer Setup command (page 16) that describes the graphic file type size, and identifier.
The printer stores this file in RAM, associating it with the index specified in the 0xC9
command. The host can then later issue 0xC0 Define Region commands that specify the
graphic as the content for a printable region.
After the graphic file has been downloaded, the printer responds with a 0xC6 Transfer Status
event (page 26).
If the total Data size exceeds 60 bytes it can be broken into a number of sequential reports.
Data up to 60 bytes in size may be sent in a single report with the Index set to one (1) and the
Size between 0 – 60. If the Data is longer than this, then it must be split into sequential
packets with all packets having a Size of 60 bytes followed by a terminating packet which
must have a size of less than 60 bytes. In this way the host knows when all data has been
received. If the last data packet fills a 60 byte report exactly then a null packet must be sent as
a terminator. This will have a Size of zero (0). Index numbers start at one (1) and increment
with each packet sent. The printer can stitch all the Data packets together in the Index
number sequence to reproduce the complete Data report.
The first report will have Index = 1. If more reports are needed to return all the Field Data
then they are indexed 2, 3, 4…etc.
The Size byte indicates how many bytes are used within the fixed size report structure as the
last report may not need all the available space.

Bit 7 6 5 4 3 2 1 0

Byte 0 0xCA
Byte 1 Index (LSB)
Byte 2 Index (MSB)
Byte 3 Size
Byte 4 Data 1
...
Byte 63 Data 60

0xCA Item Name Value Description

Index Least significant byte and most significant byte,


0 to 65535 respectively. Indicates report sequence when
multiple reports are required.
Size Number of bytes of data to follow. The last
0 to 60 packet may contain less than 60 characters.
Data 0 to 255 Graphic file data.

gsa-p0069.001.01 Released: 2006/03/24 Page 17


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 4: Event Support

4 Event Support
The following printer events are supported. See section 2.4.1 for message priority.
Report ID Event Data Page

N/A Connection No page 18


N/A Disconnection No page 18
0x06 Power Status Yes page 19
0x07 GAT Data Yes page 20
0x09 CRC Data Yes page 21
0x0A Device State Yes page 22
0xC4 Failure Status Yes page 23
0xC5 Ticket Print Status Yes page 24
0xC6 Transfer Status Yes page 26
0xC8 Metrics Yes page 28
0xCB Printer Status Yes page 29

GDS devices are event driven and therefore detection of an error as well as clearance of it
must be reported. This guarantees that the host is informed of the state of a given device.

4.1 Connection/Disconnection of Communications


The USB specification handles connection/disconnection of a device. See document
reference USB1.1.

4.2 Connection/Disconnection of Power


Devices may require additional power to that supplied by the USB and if so, the standard
USB configuration descriptor is used to inform the host of this requirement.
On connecting the device USB cable to the host, the host detects the device, although the
device may not be fully operational as in the case when the device requires external power and
that power is not connected.
Devices that require external power must report a 0x06 Power Status event (see page 19) per
the rules in section 4.3.1. The host, must be notified whenever a loss or reapplication of
external power occurs. In the case where the USB communications section of the device is
powered by the USB +5 power, the host will be notified by the device sending a Power Status
event with the appropriate status bits set. In the case where the USB communications section
of the device is powered by the external power, the host will be notified by virtue of the fact
that the device will drop out of the addressing scheme when the external power is removed
and will become re-enumerated and re-addressed when the external power is reapplied.

gsa-p0069.001.01 Released: 2006/03/24 Page 18


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 4: Event Support

If the device does not require external power, the power status event need not be sent.
If the device requires external power, and if external power is disconnected, the device must
disable itself. The device remains disabled until enabled by the host.

4.3 Report 0x06 Power Status


The presence or absence of external power supply is reported in this event with the Ext.
Power flag for those peripherals which need external power to operate.
Another flag, Need Reset, in this event is used to indicate whether a device must be reset
explicitly by the host if external power is connected after a disconnection state. Most printers
will be able to generate their own reset on connection of power.

4.3.1 Rules for Power Status


1. In the case where the USB communications section of the device is powered by the
USB +5 power, if device enumerates with external power not present, the device
after receiving 'Disable' command from host will report back, to the host, the Device
State event, followed by the Power Status event. Any subsequent Power Status
events, power connected/disconnected, must also be reported to the host.
2. 2. In the case where the USB communications section of the device is powered by
the USB +5 power, if the device loses power its only response to any command from
the host will be Power Status event with the external power bit set to zero.
3. 3.In the case where the USB communications section of the device is powered by the
USB +5 power, if the device loses power it aborts any diagnostic command and
reports Power Status event with the external power bit set to zero.
4. 4.In the case where the USB communications section of the device is powered by the
USB +5 power, the device is not required to monitor itself for any additional
conditions while external power is not present.

Bit 7 6 5 4 3 2 1 0

Byte 0 0x06
Need Ext.
Byte 1
Reset Power

0x06 Item Name Value Description

Ext. Power 0 External power is NOT connected.


1 External power is connected.
Need Reset 0 The device does not have to be explicitly reset by the host
if external power is connected after a disconnection state.
1 The device must be reset explicitly by the host if external
power is connected after a disconnection state.
Note that Reset is an intrinsic USB function.

gsa-p0069.001.01 Released: 2006/03/24 Page 19


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 4: Event Support

4.4 Report 0x07 GAT Data


A block of data is returned containing various identification, diagnostic and auditing data in a
format specific to each manufacturer and product.
All data must be in ASCII format. New lines are indicated with <carriage return><line feed>
control characters (or decimal values 13 and 10).
XML tags are not included in the data—this is done outside the peripheral. The following
characters are not allowed in the GAT data:
/ (slash), decimal value 47
< (less than), decimal value 60
> (greater than), decimal value 62
If the total GAT Data size exceeds 64 bytes it can be broken into a number of sequential
reports.
GAT data up to 61 bytes in size may be sent in a single report with the Index set to one (1)
and the Size between 0 – 61. If the GAT reply is longer than this then the data must be split
into sequential packets with all packets having a Size of 61 bytes followed by a terminating
packet which must have a size of less than 61 bytes. In this way the host knows when all data
has been received. If the last data packet fills a 61 byte report exactly then a null packet must
be sent as a terminator. This will have a Size of zero (0). Index numbers start at one (1) and
increment with each packet sent. The host can stitch all the GAT packets together in the
Index number sequence to reproduce the complete GAT report.
Request GAT Report GAT Data
TX: <none> RX: [ Index ]
[ Size ]
[ Byte 1 ]

[ Byte N ]

The first report will have Index = 1.


If more reports are needed to return all the GAT data then they are indexed 2, 3, 4…etc.
The Size byte indicates how many bytes are used within the fixed size report structure as the
last report may not need all the available space.

Bit 7 6 5 4 3 2 1 0

Byte 0 0x07
Byte 1 Index
Byte 2 Size
Byte 3 Data 1
...
Byte 63 Data 61

gsa-p0069.001.01 Released: 2006/03/24 Page 20


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 4: Event Support

0x07 Item Name Value Description

Index 1 to 255 Packet sequence counter for multi-packet reports.


Size 0 to 61 Last packet may contain less than 61 characters.
Data 32 to 126 ASCII characters (manufacturer specific), except the
following which are not allowed:
/ (slash), decimal value 47
< (less than), decimal value 60
> (greater than), decimal value 62

4.5 Report 0x09 CRC Data


The CRC checksum is calculated using a seed value provided in the 0x08 Calculate CRC
command (see page 11).

Calculate CRC CRC Data


TX: [ Seed 0 - LSB ] RX: [ Result 0 - LSB ]
[ Seed 1 ] [ Result 1 ]
[ Seed 2 ] [ Result 2 ]
[ Seed 3 - MSB ] [ Result 3 - MSB ]

4.5.1 CRC Rules


1. When a CRC request is acknowledged by the device, the CRC Data event containing
the 32 bit CRC checksum result must be available on the Input End Point within 20
seconds.
2. The checksum address range is pre-determined by the device firmware and must
cover all re-programmable areas of memory, except for USB Identification Strings.

Bit 7 6 5 4 3 2 1 0

Byte 0 0x09
Byte 1 Result 0
Byte 2 Result 1
Byte 3 Result 2
Byte 4 Result 3

0x09 Item Name Value Description

Result 0 to 255 Result of the CRC-32 calculation. Result 0 is the LSB.

gsa-p0069.001.01 Released: 2006/03/24 Page 21


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 4: Event Support

4.6 Report 0x0A Device State


This event is sent in response to 0x02 Enable (see page 10) and 0x03 Disable (see page 10)
commands from the host, and indicates whether the device is enabled or disabled. A device
must not report both Enabled and Disabled. The following scenarios A through C are
examples of how this event is implemented.
Scenario A:
1. Host issues Enable.
2. Device enables itself and thus, also sends Device State Event.
Scenario B:
1. Device has fault.
2. Device disables itself.
3. Host issues Enable command.
4. Device stays disabled.
5. Since there is an active fault/failure, the Device must send fault/failure report. There
is no need to send the Device State Event.
Scenario C, Special situation at Boot, after enumeration:
1. Device boots in Disabled State.
2. Device has Credits Pending, no faults or failures.
3. Host issues Disable command.
4. Device responds with DeviceState event with Disable bit set.
5. Device communicates all pending credits to the host.
6. Device remains disabled.

Bit 7 6 5 4 3 2 1 0

Byte 0 0x0A
Byte 1 - - - - - - Disable Enable

0x0A Item Name Value Description

Disable 0 --
1 Device disabled.
Enable 0 --
1 Device enabled.

gsa-p0069.001.01 Released: 2006/03/24 Page 22


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 4: Event Support

4.7 Report 0xC4 Failure Status


A Failure Status reports back any faults with the peripheral device as a bit mask. If no bits are
set in Byte 1, the device is working properly and no faults have been found. The flags are
meant to be generic enough to be used by any manufacturer of printer equipment.
Manufacturers may use Byte 2 to provide a more specific fault code (as specified by GSA).
When instructed by the host, the device must perform a diagnostic test. If any fault condition
is detected, this event is sent to the host unless otherwise specified. During normal operation,
the device must also continually check components that may lead to faulty operation.

4.7.1 Failure Status Rules


1. If any of the bits are set in this register, there is a fault with the printer.
2. The device must self-disable until re-enabled by host.
3. If a fault clears, it must be reported back to the host as being cleared.
4. A failure status report must be sent to the host after receiving a 0x04 Self Test
command (page 10), after receiving a 0x02 Enable command (page 10), if a fault
exists, and as soon as a new fault condition is detected.
5. If the Other bit is set, a manufacturer-specific diagnostic code is provided. If this
code is zero (0) then no further information is available.
6. The Failure Status event assumes the highest priority for event transmission to the
host. All Transaction ID events must wait until the failure is cleared and device is
enabled.

Bit 7 6 5 4 3 2 1 0

Byte 0 0xC4
Byte 1 Print
Temperature
Other - - - Head NVM Firmware
Error
Damaged
Byte 2 Diagnostic

0xC4 Value Description

Firmware 0 Firmware is OK.


1 Firmware has failed.
NVM 0 NVM is OK.
1 A fault has been detected in the non-volatile memory.
Print Head 0 Print head is OK.
Damaged
1 Print head is damaged. Replacement may be required.
Temperature 0 No error.
Error
1 Temperature is too high at the print head.

gsa-p0069.001.01 Released: 2006/03/24 Page 23


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 4: Event Support

0xC4 Value Description

Other 0 No manufacturer-specific faults. Byte 3 will be


ignored.
1 Manufacturer-specific fault code. See Diagnostic
Byte.
Diagnostic 0 No fault information.
1 to 255 Manufacturer-specific diagnostic code specified by
GSA.

4.8 Report 0xC5 Ticket Print Status


The Ticket Print Status event is sent when the printer: 1) starts printing, 2) prints a field of
interest, and 3) finishes printing a ticket.

4.8.1 4.8.1 Ticket Print Status Rules


1. A Ticket Print Status event is sent in response to a 0xC2 Print Ticket command
(page 14). When the host acknowledges this event, the relevant bits will be cleared in
NVM. If a failure occurs during this operation, a 0xC4 Failure Status event (page 23)
will take priority over a Ticket Print Status event.
2. A Ticket Print Status event is sent in response to a 0xC3 Form Feed command
(page 15) after the paper feeding cycle has started and after completed. If a failure
occurs during this operation, a Failure Status event will take priority over a Ticket
Print Status event.
3. When “Print In Progress” is reported for the first time in the Ticket Print Status
event after a 0xC2 Print Ticket command, all other bits must be set to zero (0).
4. When “Print Complete” is reported in the Ticket Print Status event, “Print In
Progress” must be set to zero (0).
5. F1, F2 and F3 will only be reported in the Ticket Print Status event, set to one (1),
when the corresponding “Fields of Interest” has completed.
6. If Ticket Jam condition is detected while printing a ticket, the printer report the jam
condition and aborts the print process.
7. Across power cycle, the printer will report all outstanding TID Ticket Print Status.

Bit 7 6 5 4 3 2 1 0

Byte 0 0xC5
Byte 1 Transaction ID
Byte 2 Print Print in
- - - F3 F2 F1
Complete Progress

gsa-p0069.001.01 Released: 2006/03/24 Page 24


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 4: Event Support

0xC5 Item Name Value Description

Transaction Id Unique identifier assigned to a communication


transaction between host and peripheral device.
Print in 0 -
Progress
1 Printer is busy printing ticket.
F1 0 -
1 Field of Interest 1 is printed.
F2 0 -
1 Field of Interest 2 is printed.
F3 0 -
1 Field of Interest 3 is printed.
Print Complete 0 -
1 Print job is complete.

gsa-p0069.001.01 Released: 2006/03/24 Page 25


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 4: Event Support

4.9 Report 0xC6 Transfer Status


This report is sent for every completely transferred command, which may span multiple
reports.

Bit 7 6 5 4 3 2 1 0

Byte 0 0xC6
Byte 1
0 0 0 0 Graphic Region Template Print

Byte 2 Status Code

0xC6 Item Name Value Description

Print 0 -

1 Transfer status event for a Print Ticket command.


See Status Code.
Template 0 -
Transfer status event fora Define Template
1 command. See Status Code.
Region 0 -
Transfer status event for a Define Region
1
command. See Status Code.
Graphic 0 -

1 Transfer status event for a Grapic Transfer Setup


command. See Status Code.
Status Code Indicates the status of the transferred command.
0 to 255 See section 4.9.1.

gsa-p0069.001.01 Released: 2006/03/24 Page 26


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 4: Event Support

4.9.1 Status Codes

0xC6 Status Type Code Description

Region 0x01 OK
0x02 Syntax Error
0x03 Wrong ID Range
0x04 Region Overflow
0x05 Data type Mismatch
0x06 Region Truncation error
0x07 Undefined Font
0x08 Undefined Graphic
0x09 Undefined Bar Code
0x0A Undefined Justification
0x0B Incorrect Multiplier Value
Template 0x01 OK
0x02 Syntax Error
0x03 Wrong ID Range
0x04 Undefined Region ID
PrintData 0x01 OK
0x02 Syntax Error
0x03 Region Overflow
0x04 Data type Mismatch
0x05 Too many fields of Interest
0x06 Already defined field of Interest
0x07 Number of regions does not match template definition
0x08 Undefined Template
Graphic 0x01 OK
0x02 File Size too large
(This condition is sent in response to Graphic
Transfer Setup Report.)
0x03 Corrupted file
(Printer will clear transferred data.)

gsa-p0069.001.01 Released: 2006/03/24 Page 27


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 4: Event Support

4.10 Report 0xC8 Metrics


The printer sends this report in response to the 0xC7 Request Printer Metrics command, to
inform the host of the printer capabilities, such as the supported fonts, barcode, and graphic
files-to-index mapping.
The format of the data in this command is defined in Chapter 7 (page 38).
If the total Data size exceeds 61 bytes it can be broken into a number of sequential reports.
Data up to 61 bytes in size may be sent in a single report with the Index set to one (1) and the
Size between 0 – 61. If the Data is longer than this, then it must be split into sequential
packets with all packets having a Size of 61 bytes followed by a terminating packet which
must have a size of less than 61 bytes. In this way the host knows when all data has been
received. If the last data packet fills a 61 byte report exactly then a null packet must be sent as
a terminator. This will have a Size of zero (0). Index numbers start at one (1) and increment
with each packet sent. The printer can stitch all the Data packets together in the Index
number sequence to reproduce the complete Data report.
The first report will have Index = 1. If more reports are needed to return all the Field Data
then they are indexed 2, 3, 4…etc.
The Size byte indicates how many bytes are used within the fixed size report structure as the
last report may not need all the available space.

Bit 7 6 5 4 3 2 1 0

Byte 0 0xC8
Byte 1 Index
Byte 2 Size
Byte 3 Data 1

Byte 63 Data 61

0xC8 Item Name Value Description

Index 1 to 255 Packet sequence counter for multi-packet reports.


Size 0 to 61 Number of bytes of data to follow. Last packet may
contain less than 61 characters.
Data ASCII characters as defined in the Metrics data. See
32 to 255 page 38.

gsa-p0069.001.01 Released: 2006/03/24 Page 28


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 4: Event Support

4.11 Report 0xCB Printer Status


The printer sends this event whenever any of the conditions are detected or cleared.

Bit 7 6 5 4 3 2 1 0

Byte 0 0xCB
Byte 1 Transaction ID
Byte 2 Paper Paper Paper Top of Print
- - Chassis
Empty Low Jam Form Head

0xCB Item Name Value Description

Transaction Id Unique identifier assigned to a communication


transaction between host and peripheral device.
Chassis 0 Printer chassis is closed.
1 Printer chassis is open.
Print Head 0 Print head is closed.
1 Print head is open.
Top of Form 0 Paper is not at Top of Form mark.
1 Paper is at Top of Form mark.
Paper Jam 0 Paper is not jammed.

1 Paper is jammed. This bit is cleared when jammed


paper is removed.
Paper Low 0 Paper supply is not low.
Paper supply is low. This is cleared when paper
1 supply is loaded.
Paper Empty 0 Paper supply is not empty.
Paper supply is empty. This is cleared when paper
1
supply is loaded.

gsa-p0069.001.01 Released: 2006/03/24 Page 29


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer: Chapter 5:
Communication Protocol v1.0 Number Allocation and Report Summary

5 Number Allocation and Report Summary


The following sections, 5.1 and 5.2, identify the usage number and report ID allocation in the
printer message protocol, as well as high-level allocation in GDS peripheral device message
protocols in general.
Section 5.3 describes the report summary table that begins on page 31 and identifies the
specific usage number and report ID assignment to each unique type of data in the printer
message protocol.

5.1 Usage Number Allocation


All values in hex.
92 GSA Gaming Device

00 to 3F Top-level device classes


40 to FF Common reports

0100 to 01FF Coin Acceptors


0200 to 02FF Bill Validators
0300 to 03FF Hoppers
0400 to 04FF Printers
0500 to 05FF Touch Screens
0600 to 068F Card Readers

Allocated Devices
00 – 0F Unused
11 Coin Acceptor
12 Bill Acceptor
13 Hopper
14 Printer
15 Touch Screen
16 Card Reader
17 – 3F Reserved

Common report convention… Printer convention…


40 to 5F Report usage 0400 to 040F Unused
60 to 8F Byte data 0410 to 042F Report usage
90 to AF Bit data 0430 to 045F Byte data
B0 to CF Miscellaneous data 0460 to 047F Bit data
D0 to FF Reserved 0480 to 048F Miscellaneous data
0490 to 04FF Reserved

gsa-p0069.001.01 Released: 2006/03/24 Page 30


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer: Chapter 5:
Communication Protocol v1.0 Number Allocation and Report Summary

5.2 Report ID Allocation


All Values in Hex
Report ID are in the range of 00 – FF
00 unused
01 – 4F Common Report IDs
50 – FF Device specific IDs

5.3 Report Summary Table


The first six rows of the Report Summary table, on the following page, list the high-level
usage numbers identifying all peripheral devices (92) and each of the five types of peripheral
devices (11 - 15).
The remaining rows present printer report data organized by report ID, and then by field
order within a report. Column descriptions:
Item: Incrementing row identifier, listed only in rows that contain a report ID.
Host Command/Device Events: Report name of command or report. Using two
columns provides a visual clue to allow quicker searches.
Report ID: Hexadecimal value of the identifier assigned to the command or event.
Label: Data field name. Used only for data packets other than the command or event
report ID.
Usage: Hexadecimal value assigned to a data packet. All unique data packets are assigned
a usage number.
NOTE: The alignment of the usage number (left, middle, right) provides a
visual clue as to the category of data:
• left aligned: Report identifier
• middle aligned: one or more bytes.
• right aligned: one or more bits
Size: Size of the data packet in bytes, unless otherwise specified.
Comments: Comments.

Report Summary (Sheet 1 of 4)

Host Device Report ID Usage Size


Command Event ( Hex ) Label ( Hex ) ( Bytes ) Comments

- - - - 92 - GSA Gaming Device

- - - - 11 - Coin Acceptor

- - - - 12 - Bill Validator

- - - - 13 - Hopper

gsa-p0069.001.01 Released: 2006/03/24 Page 31


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer: Chapter 5:
Communication Protocol v1.0 Number Allocation and Report Summary

Report Summary (Sheet 2 of 4)

Host Device Report ID Usage Size


Command Event ( Hex ) Label ( Hex ) ( Bytes ) Comments

- - - - 14 - Printer

- - - - 15 - Touch Screen

- - - - 16 - Card Reader
ACK - 01 - 40 - -
- - - Resync 90 1 bit -
- - - Trans ID 60 1 -
Enable - 02 - 41 - -
Disable - 03 - 42 - -
Self Test - 04 - 43 - -

- - - NVM 93 1 bit -

Request GAT
- 05 44 -
Report
Power
- 06 - 45 - -
Status
- - - Ext. Power 91 1 bit -
- - - Need Reset 92 1 bit -
- GAT Data 07 46 -
- - - Index 61 1 -

Size of valid data in


- - - Size 62 1
the data dump.

- - - Data B0 61 Specific Data


Calculate CRC - 08 - 47 - -
- - - Seed 63 4 -
- CRC Data 09 - 48 - -
- - - Result 64 4 -
Device
- 0A - 49 - -
State
- - - Enable 94 1 bit -
- - - Disable 95 1 bit -
Define Region - 0xC0 - 0410 - -
- - - Index 0430 1 -
- - - Size 0431 1 -
- - - Data 0480 61 -

gsa-p0069.001.01 Released: 2006/03/24 Page 32


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer: Chapter 5:
Communication Protocol v1.0 Number Allocation and Report Summary

Report Summary (Sheet 3 of 4)

Host Device Report ID Usage Size


Command Event ( Hex ) Label ( Hex ) ( Bytes ) Comments
Define
0xC1 - 0411 - -
Template
- - - Index 0430 1 -
- - - Size 0431 1 -
- - - Data 0480 61 -
Print Ticket - 0xC2 - 0412 - -
- - - Index 0430 1 -
- - - Size 0431 1 -
- - - Data 0480 61 -
Form Feed - 0xC3 - 0413 - -
Failure
- 0xC4 - 0414 - -
Status
- - - Firmware 0460 1 bit -
- - - NVM 0461 1 bit -
Print Head
- - - 0462 1 bit -
Damaged
Temperature
- - - 0463 1 bit -
Error
- - - Other 0464 1 bit -
- - - Diagnostic 0432 1 -
Ticket Print
- 0xC5 - 0415 - -
Status
- - - Transaction ID 0433 1 -
- - - Print in Progress 0465 1 bit -
- - - F1 0466 1 bit -
- - - F2 0467 1 bit -
- - - F3 0468 1 bit -
- - - Print Complete 0469 1 bit -
Transfer
- 0xC6 - 0416 - -
Status
- - - Print 046A 1 bit -
- - - Template 046B 1 bit -
- - - Region 046C 1 bit -
- - - Graphic 046D 1 bit -
- - - Status Code 0434 1 -

gsa-p0069.001.01 Released: 2006/03/24 Page 33


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer: Chapter 5:
Communication Protocol v1.0 Number Allocation and Report Summary

Report Summary (Sheet 4 of 4)

Host Device Report ID Usage Size


Command Event ( Hex ) Label ( Hex ) ( Bytes ) Comments
Request Printer
- 0xC7 - 0417 - -
Metrics
- Metrics 0xC8 - 0418 - -
- - - Index 0430 1 -
- - - Size 0431 1 -
- - - Data 0480 61 -
Graphic
- 0xC9 - 0419 - -
Transfer Setup
- - - Type 0435 1 -
- - - Index 0430 1 -
- - - File Size 0436 2 -
File Transfer - 0xCA - 041A - -
- - - Index 0437 2 -
- - - Size 0431 1 -
- - - Data 0481 60 -
Printer
- 0xCB - 041B - -
Status
- - - Transaction ID 0433 1 -
- - - Chassis 046E 1 bit -
- - - Print Head 046F 1 bit -
- - - Top of Form 0470 1 bit -
- - - Paper Jam 0471 1 bit -
- - - Paper Low 0472 1 bit -
- - - Paper Empty 0473 1 bit -

gsa-p0069.001.01 Released: 2006/03/24 Page 34


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 6: USB Identification Strings

6 USB Identification Strings


USB provides certain information as part of the base protocol (Non-HID devices as well).
idVendor 2 bytes
idProduct 2 bytes
iManufacturer index of string descriptor
iProduct index of string descriptor
iSerialNumber index of string descriptor

Unicode UTF-16LE is used for all strings, limiting strings to 126 characters:
int((255-2)/2) = 126

6.1 idVendor
Unique code supplied to USB member companies. If you do not yet have a code then you
need to subscribe to the USB Implementers Forum.
Visit http://www.usb.org.

6.2 idProduct
Each type of product supplied by a manufacturer must have a unique ID code (126 character
limit).
Windows drivers are loaded on the basis of a unique idVendor (see section 6.1), idProduct
and iSerialNumber (see section 6.5).

6.3 iManufacturer
May be used to give an ASCII representation of the idVendor (126 character limit). This is
assigned by each manufacturer and kept consistent with regards to case and spelling.
For example:
GSA Member Company Name

6.4 iProduct
A string must be returned in this format:
<Protocol Level>,<Product Name>,<Firmware Issue>,<Build
Version>,<Manufacturing Date>
Each item above is described in further detail on the following page.
ASCII string, comma delimited.
Redundant trailing commas may be omitted.
For example:
1.1,ProductName,A,1.01,01/01/2004
Only the first three items are compulsory. At a minimum we could have...
1.1,ProductName, 1A2B3C

gsa-p0069.001.01 Released: 2006/03/24 Page 35


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 6: USB Identification Strings

6.4.1 Protocol Level - Major


Compulsory field, along with the Protocol Level - Minor field (see section 6.4.2)
This field represents the first value in the GDS device protocol version, of the format X.x.
This begins at 1 for the initial version of the protocol, and thereafter increments for major
revisions of the protocol. A future version of the protocol may include additional commands
or events but must be a superset of previous versions allowing full machine compatibility.

6.4.2 Protocol Level - Minor


Compulsory field, along with the Protocol Level - Major field (see section 6.4.1)
This field represents the second value in the GDS device protocol version, of the format
X.x. This begins at 0 for the initial version of the protocol, and thereafter increments for
future minor revisions of the protocol. A future version of the protocol may include
additional commands or events but must be a superset of previous versions allowing full
machine compatibility.

6.4.3 Product Name


Compulsory field.
Any manufacturer-specific ASCII string, without commas.
This is in effect an ASCII representation of idProduct.

6.4.4 Firmware Issue


Compulsory field.
Any manufacturer-specific ASCII string, without commas.

6.4.5 Build Version


Optional field.
Any manufacturer-specific ASCII string, without commas.
The build version is any option within the product name. A standard build could be indicated
as STD for example.

6.4.6 Manufacturing Date


Optional field.
Conforming to DD/MM/YYYY.
The manufacturing date can be defined in a number of different ways. It may or may not
relate to product warranty. Some manufacturers find it usefu.

gsa-p0069.001.01 Released: 2006/03/24 Page 36


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 6: USB Identification Strings

6.5 iSerialNumber
Compulsory field.
Serial numbers must be returned as an ASCII string (126 character limit), such as 12345678.
Leading zeros are acceptable, for example 00000123.
For every manufacturer, this value must be unique for each of the manufacturer’s products.
This means that two products, each from a different manufacturer, may have the same serial
number, but no two products from the same manufacturer may have the same serial number.

6.6 Peripheral Class


For HID devices, the reporting structure identifies the peripheral class
92 GSA Gaming Device

11 Coin Acceptor
12 Bill Validator
13 Hopper
14 Printer
15 Touch Screen
16 Printer

The host machine therefore knows what type of equipment it is dealing with and can
interrogate the corresponding usage numbers.

gsa-p0069.001.01 Released: 2006/03/24 Page 37


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 7: Metrics Command Data Format

7 Metrics Command Data Format


This chapter details the format of the data included in the 0xC8 Metrics report, which the
printer sends in response to a 0xC7 Request Printer Metrics report sent by the host. It
describes the printer information—that is, printer metrics—that the EGM must know in
order to properly understand the printer’s capability.
Downloadable fonts are not supported as this is viewed as manufacture specific.

7.1 Metrics Report Data Structure


Printer metrics information is tag-based, using the same conventions in the data transmitted
in the commands for defining regions and templates.
All printer metrics data is encased inside the <Metrics></Metrics> start and end tags. At
least one instance of each child element is required. These are listed below and described in
more detail in the following sections:
Child Element Printer Metric Page

PR Printer resolution page 39


PS Paper size page 40
GM Graphic memory size page 41
RCS International character support page 41
RPT Predefined template support page 42
RBS Barcode symbologies (standards) support page 43
FS Font support page 44
CS Color support page 45

A complete example of the Metrics element is provided in section 7.10.

gsa-p0069.001.01 Released: 2006/03/24 Page 38


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 7: Metrics Command Data Format

7.2 PR: Report Printer Resolution


The printer uses the PR element to indicate resolution in dots per inch (dpi).

7.2.1 Structure

<PR r="value"/>

7.2.2 PR Attribute

Attribute Value Description

r 0 200dpi
1 300dpi
2 600dpi
3 1200dpi
4 2400dpi

7.2.3 Example

<PR r="0"/>

gsa-p0069.001.01 Released: 2006/03/24 Page 39


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 7: Metrics Command Data Format

7.3 PS: Report Paper Size


The attributes of the PS element indicates the size of the printer’s paper, the size of the area
on the paper where the printer can print, and the X and Y offset on the paper where the
printer starts printing.

7.3.1 Structure
The following is the structure of the PS element:

<PS xPaSz="value" yPaSz="value" xPrSz="value" yPrSz="value"


xOff="value" yOff="value" />

7.3.2 PS Attributes
The figure below this table shows the paper’s (0,0) coordinates, as a ticket is being printed.
Attribute Value Description

xPaSz 0000 – 65536 Dot axis (X-axis) paper size in dots. See figure
yPaSz 0000 – 65536 Paper axis (Y-axis) paper size in dots.
xPrSz 0000 – 65536 Dot axis (X-axis) printable paper size in dots.
yPrSz 0000 – 65536 Paper axis (Y-axis) printable paper size in dots.
xOff 0000 – 65536 Distance in dots between xPaSz and xPrSz.
yOff 0000 – 65536 Distance in dots between yPaSz and yPrSz.

Printer device

Ticket in progress

Figure 7.1 Paper’s Coordinates (0,0) on Ticket being Printed

7.3.3 Example

<PS xPaSz="00528" yPaSz="01200" xPrSz="00496" yPrSz="01200"


xOff="00000" yOff="00000" />

gsa-p0069.001.01 Released: 2006/03/24 Page 40


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 7: Metrics Command Data Format

7.4 GM: Report Free Graphic Memory


The printer uses the GM element to indicate the size of free graphic memory space available on
the printer.

7.4.1 Structure
The following is the structure of the GM element:

<GM s="size"/>

7.4.2 GM Attributes

Attribute Value Description

s 0000 – 99999 Number of KB of memory available.

7.4.3 Example

<GM s="00128" />

7.5 RCS: Report International Character Support


The printer uses the RCS element to indicate the international characters it supports, using the
three-character language codes defined in ISO 639.

7.5.1 Structure
The following is the structure of the RCS element, where each idvalue is a three-character
language code in ISO 639:

<RCS>idvalue1 idvalue2 … idvaluen</RCS>

7.5.2 Example

<RCS> abk ace ach </RCS>

gsa-p0069.001.01 Released: 2006/03/24 Page 41


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 7: Metrics Command Data Format

7.6 RPT: Report Supported Predefined Templates


The printer uses the RPT element to indicate the predefined GDS printer templates that it
supports and maintains in non-volatile memory.
Each GDS predefined template is identified by a three-digit ASCII number in the range of
000 – 099.
ONLY the predefined templates reported are supported by the printer.

7.6.1 Structure

The following is the structure of the RPT element, where each idvalue is a three-digit ASCII
identifier for one predefined template:
<RPT>idvalue1 idvalue2 … idvaluen </RPT>

7.6.2 Example

<RPT> 000 001 002 003 005 </RPT>

gsa-p0069.001.01 Released: 2006/03/24 Page 42


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 7: Metrics Command Data Format

7.7 RBS: Report Barcode Support


The printer uses the RBS element to indicate the barcode symbologies (standards) the printer
supports.

7.7.1 Structure
The following is the structure of the RBS element, where each idvalue is a two-digit ASCII
identifier for one barcode symbology (see section 7.7.2):

<RBS>idvalue1 idvalue2 … idvaluen</RBS>

7.7.2 Barcode Symbology Indexes


Table of indexes to barcode symbologies:

Code Barcode Symbology Code Barcode Symbology


00 Interleaved 2 of 5 (ITF) Required 13 EAN-13 + 5
01 Code-128 A Required 14 UPC-A
02 Code 39 15 UPC-A + 2
03 Code 39 Check 16 UPC-A + 5
04 2 of 5 17 UPC-E
05 Code 93 18 UPC-E + 2
06 Codabar 19 UPC-E + 5
07 POSTNET 20 Code-128 B
08 EAN-8 21 Code-128 C
09 EAN-8 + 2 22 EAN-128 A
10 EAN-8 + 5 23 EAN-128 B
11 EAN-13 24 EAN-128 C
12 EAN-13 + 2

7.7.3 Example

<RBS> 00 01 </RBS>

gsa-p0069.001.01 Released: 2006/03/24 Page 43


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 7: Metrics Command Data Format

7.8 FS: Fonts Supported


The printer uses the FS element to indicate the fonts it supports in terms of size and pitch.

7.8.1 Structure
The following is the structure of the FS element, which includes an F child element for each
font supported. In place of each value would be values for the index, font size, and pitch
respectively, as described in section 7.8.3.

<FS>
<F i="value" s="value" p="value" />
</FS>

7.8.2 FS Element

Element Value Description

F Description of one font supported. At least one F


See section 7.8.3 element must be included in the FS element.

7.8.3 FS Attributes

Attribute Value Description

i
(integer value) Index of font. Required font support is listed in
section 7.8.4.
s Size of font in points. One point is approximately
(decimal value) 1/72 inch.
p (decimal value) Pitch, or characters per inch, of font.

7.8.4 Required Font Support


At minimum, a GDS printer must support the following fonts:
Index Point Size Pitch Font Type

0 29.5 2.5 Bold Sans Serif


1 25.8 3.3 Bold Sans Serif
2 13.8 5.5 Bold Sans Serif
3 21.3 4.0 Bold Sans Serif
4 10.6 7.3 Bold Sans Serif
5 8.5 20.3 Bold Sans Serif
6 9.2 10.1 Bold Sans Serif
7 8.5 20.5 Bold Sans Serif

gsa-p0069.001.01 Released: 2006/03/24 Page 44


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 7: Metrics Command Data Format

7.8.5 Example

<FS>
<F i="0" s="29.5" p="2.5" />
<F i="1" s="25.8" p="3.3" />
<F i="2" s="13.8" p="5.5" />
<F i="3" s="21.3" p="4.0" />
<F i="4" s="10.6" p="7.3" />
<F i="5" s="8.5" p="20.3" />
<F i="6" s="9.2" p="10.1" />
<F i="7" s="8.5" p="20.5" />
</FS>

7.9 CS: Color Support


The printer uses the CS element to indicate the colors it supports. GDS does not define
colors, or required color support due to the nature of printing paper technology currently in
use in the gaming industry. The colors in a printer’s output depends on the chemistry of the
paper in use and the temperature of heat applied.

7.9.1 Structure
The following is the structure of the CS element, which includes a CLR child element for each
color supported. In the structure shown below, name would be replaced by the text name of
a color, such as "black" or "red".
<CS>
<CLR n="name"/>
</CS>

7.9.2 CS Element
For each color the printer supports, it includes one CLR child element inside the CS element.
Element Value Description

CLR
See section 7.9.3 One color the printer supports, included in the n
attribute (see 7.9.3)

7.9.3 CS Attribute

Attribute Value Description

n Color name, such as "black", "blue", "red", and


(variable) "yellow".

7.9.4 Example

<CS>
<CLR n="black" />
<CLR n="red" />
</CS>

gsa-p0069.001.01 Released: 2006/03/24 Page 45


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Chapter 7: Metrics Command Data Format

7.10 Example: Data Structure


The following is an example of the structure of the tag-based printer metrics data included in
the 0xC8 report.
The structure follows the conventions used in XML tags.
<Metrics>

// Printer resolution
<PR r="0"/>

// Paper size information


<PS xPaSz="00528" yPaSz="01200" xPrSz="00496" yPrSz="01200"
xOff="00000" yOff="00000" />

// Number of KB available in memory


<GM s="00128" />

// International character support


<RCS> abk ace ach </RCS>

// Predefined templates supported


<RPT> 000 001 002 003 005 </RPT>

// Barcode support. ITF and Code 128 are minimum required support.
<RBS> 00 01 </RBS>

// Fonts supported
<FS>
<F i="0" s="29.5" p="2.5" />
<F i="1" s="25.8" p="3.3" />
<F i="2" s="13.8" p="5.5" />
<F i="3" s="21.3" p="4.0" />
<F i="4" s="10.6" p="7.3" />
<F i="5" s="8.5" p="20.3" />
<F i="6" s="9.2" p="10.1" />
<F i="7" s="8.5" p="20.5" />
</FS>

//Colors supported.
<CS>
<CLR n="black" />
<CLR n="red" />
</CS>
</Metrics>

gsa-p0069.001.01 Released: 2006/03/24 Page 46


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Glossary

Glossary
Diagnostic Commands The following reports are diagnostic commands:
Report 0x04 Self Test
Report 0x05 Request GAT Report
Report 0x08 Calculate CRC
Disabled Condition of a peripheral device imposed by its host in which the
device does not perform operations other than diagnostic functions
and communications in response to host requests. A device that is
disabled by the host must be re-enabled by the host. See also Self-
disabled.
Dot Axis Axis on which the dots are printed. See also Paper Axis.
GAT Game Authentication Terminal. An application, installed on a personal
computer or laptop, which uses serial communication to authenticate
game program components on a gaming machine.
Host A machine that gathers data from, and sends directives to, its
peripheral devices.
NVM Non-volatile memory.
Report ID A unique identifier assigned by GSA to GDS device commands and
events.
Page Description A method to describe the output of a page, such as a gaming voucher,
Language (PDL) to a printer. In this document, the PDL referred to is defined by GDS.
Paper Axis Axis on which the paper moves. See also Dot Axis.
Print Job The instruction to print given data with a specified printable template.
Printable Region An area (content block) on the printed output that is self described by
the syntax of the PDL and takes on the printed form of text, barcodes
or graphics.
Printable Template A defined page format for printer output, consisting of associations of
(template) one or more defined printable regions.

Self-Disabled Identical to Disabled, except the peripheral device imposes the


condition on itself in response to detecting a fault within itself; and if
the fault is corrected, the device must remain disabled until enabled by
the host.
TID event Any event that contains a transaction ID number in its report format.
A pending TID event is a TID event that is sent to the host but has
not yet been acknowledged by the host. See also Transaction ID.
Transaction ID A unique identifier assigned to a communication transaction between a
host and a peripheral device. See also TID event.

gsa-p0069.001.01 Released: 2006/03/24 Page 47


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Appendix A: CRC-32 Checksum Calculation

Appendix A: CRC-32 Checksum Calculation


Procedure for CRC calculations:
1. The method shall conform to Autodin 2, also known as CRC-32;
2. The polynomial shall be
x 32 +x 2 6 + x 23 +x 2 2 +x 16 + x 12 +x 1 1 + x 10 +x 8 +x 7 +x 5 +x 4 +x 2 +x+ 1;
3. The calculation shall be performed least significant bit first;
4. The 32 bit seed, or initial remainder, is variable and may be specified by the host, but
its default value shall be 0xFFFFFFFF;
5. The CRC or final remainder shall be returned in 1’s complement, that is, XORed with
0xFFFFFFFF prior to reporting.

A.1 Assembly Example


; ============================================================= ;
; Autodin-II CRC algorithms for various CPUs ;
; ============================================================= ;
; Offered to GSA GDS committee by Peter Hand, JCM American Corp ;
; June 2004 ;
; ;
; DISCLAIMER: ;
; This code is offered for example only. It is the user’s ;
; responsibility to verify correct operation in a particular ;
; application. ;
; ;
; ============================================================= ;

; ============================================================= ;
; Algorithms for 8051 family CPUs ;
; ============================================================= ;
; ;
; Routines are written in standard 8051 Assembly Language ;
; without any special function optimization (dual DPTR, etc) ;
; ;
; ============================================================= ;

; ============================================================= ;
; 8751 TABLE LOOKUP ROUTINE ;
; ============================================================= ;
; ;
; This is the fastest way to calculate the CRC by a huge ;
; margin, but it consumes more than 1k of code memory ;
; ;
; ============================================================= ;

; Enter with R7:R6:R5:R4 initial CRC or seed (R7.7 MSB), DPTR pointer to data
; Exit with R7:R6:R5:R4 new CRC, DPTR advanced by 1, A trashed
; Stack: 2
; 34 instruction cycles per byte
.....
CLR A
MOVC A,@A+DPTR ; get next data byte

INC DPTR
PUSH DPL ; save source data pointer
PUSH DPH
XRL A,R4 ; XOR data with low CRC
MOV R4,A ; save pointer
MOV DPTR,#crc_tab_lo ; point to low byte table
MOVC A,@A+DPTR ; get low byte from table
XRL A,R5 ; XOR with next byte from CRC
XCH A,R4 ; becomes new low CRC, get pointer back

gsa-p0069.001.01 Released: 2006/03/24 Page 48


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Appendix A: CRC-32 Checksum Calculation

INC DPH ; point to next byte table


MOV R5,A ; save pointer
MOVC A,@A+DPTR ; get next byte
XCH A,R5 ; becomes new CRC
INC DPH ; next byte table
MOV R6,A ; save pointer
MOVC A,@A+DPTR ; same again etc
XCH A,R6
INC DPH
MOVC A,@A+DPTR
MOV R7,A
POP DPH ; recover source pointer
POP DPL
.....

; Optimization note:
; Since “INC DPH” takes one instruction cycle whereas “INC DPTR” takes three,
; the 32-bit table is presented in four blocks, one for each significant byte.
; One byte from each block (at the same index) makes up the 32 bit DWORD

crc_tab_lo: ; least significant byte (bits 0..7)


db 000h,096h,02ch,0bah,019h,08fh,035h,0a3h
db 032h,0a4h,01eh,088h,02bh,0bdh,007h,091h
db 064h,0f2h,048h,0deh,07dh,0ebh,051h,0c7h
db 056h,0c0h,07ah,0ech,04fh,0d9h,063h,0f5h
db 0c8h,05eh,0e4h,072h,0d1h,047h,0fdh,06bh
db 0fah,06ch,0d6h,040h,0e3h,075h,0cfh,059h
db 0ach,03ah,080h,016h,0b5h,023h,099h,00fh
db 09eh,008h,0b2h,024h,087h,011h,0abh,03dh
db 090h,006h,0bch,02ah,089h,01fh,0a5h,033h
db 0a2h,034h,08eh,018h,0bbh,02dh,097h,001h
db 0f4h,062h,0d8h,04eh,0edh,07bh,0c1h,057h
db 0c6h,050h,0eah,07ch,0dfh,049h,0f3h,065h
db 058h,0ceh,074h,0e2h,041h,0d7h,06dh,0fbh
db 06ah,0fch,046h,0d0h,073h,0e5h,05fh,0c9h
db 03ch,0aah,010h,086h,025h,0b3h,009h,09fh
db 00eh,098h,022h,0b4h,017h,081h,03bh,0adh
db 020h,0b6h,00ch,09ah,039h,0afh,015h,083h
db 012h,084h,03eh,0a8h,00bh,09dh,027h,0b1h
db 044h,0d2h,068h,0feh,05dh,0cbh,071h,0e7h
db 076h,0e0h,05ah,0cch,06fh,0f9h,043h,0d5h
db 0e8h,07eh,0c4h,052h,0f1h,067h,0ddh,04bh
db 0dah,04ch,0f6h,060h,0c3h,055h,0efh,079h
db 08ch,01ah,0a0h,036h,095h,003h,0b9h,02fh
db 0beh,028h,092h,004h,0a7h,031h,08bh,01dh
db 0b0h,026h,09ch,00ah,0a9h,03fh,085h,013h
db 082h,014h,0aeh,038h,09bh,00dh,0b7h,021h
db 0d4h,042h,0f8h,06eh,0cdh,05bh,0e1h,077h
db 0e6h,070h,0cah,05ch,0ffh,069h,0d3h,045h
db 078h,0eeh,054h,0c2h,061h,0f7h,04dh,0dbh
db 04ah,0dch,066h,0f0h,053h,0c5h,07fh,0e9h
db 01ch,08ah,030h,0a6h,005h,093h,029h,0bfh
db 02eh,0b8h,002h,094h,037h,0a1h,01bh,08dh
; second byte (bits 8..15)
db 000h,030h,061h,051h,0c4h,0f4h,0a5h,095h
db 088h,0b8h,0e9h,0d9h,04ch,07ch,02dh,01dh
db 010h,020h,071h,041h,0d4h,0e4h,0b5h,085h
db 098h,0a8h,0f9h,0c9h,05ch,06ch,03dh,00dh
db 020h,010h,041h,071h,0e4h,0d4h,085h,0b5h
db 0a8h,098h,0c9h,0f9h,06ch,05ch,00dh,03dh
db 030h,000h,051h,061h,0f4h,0c4h,095h,0a5h
db 0b8h,088h,0d9h,0e9h,07ch,04ch,01dh,02dh
db 041h,071h,020h,010h,085h,0b5h,0e4h,0d4h
db 0c9h,0f9h,0a8h,098h,00dh,03dh,06ch,05ch
db 051h,061h,030h,000h,095h,0a5h,0f4h,0c4h
db 0d9h,0e9h,0b8h,088h,01dh,02dh,07ch,04ch
db 061h,051h,000h,030h,0a5h,095h,0c4h,0f4h
db 0e9h,0d9h,088h,0b8h,02dh,01dh,04ch,07ch
db 071h,041h,010h,020h,0b5h,085h,0d4h,0e4h
db 0f9h,0c9h,098h,0a8h,03dh,00dh,05ch,06ch
db 083h,0b3h,0e2h,0d2h,047h,077h,026h,016h
db 00bh,03bh,06ah,05ah,0cfh,0ffh,0aeh,09eh
db 093h,0a3h,0f2h,0c2h,057h,067h,036h,006h
db 01bh,02bh,07ah,04ah,0dfh,0efh,0beh,08eh

gsa-p0069.001.01 Released: 2006/03/24 Page 49


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Appendix A: CRC-32 Checksum Calculation

db 0a3h,093h,0c2h,0f2h,067h,057h,006h,036h
db 02bh,01bh,04ah,07ah,0efh,0dfh,08eh,0beh
db 0b3h,083h,0d2h,0e2h,077h,047h,016h,026h
db 03bh,00bh,05ah,06ah,0ffh,0cfh,09eh,0aeh
db 0c2h,0f2h,0a3h,093h,006h,036h,067h,057h
db 04ah,07ah,02bh,01bh,08eh,0beh,0efh,0dfh
db 0d2h,0e2h,0b3h,083h,016h,026h,077h,047h
db 05ah,06ah,03bh,00bh,09eh,0aeh,0ffh,0cfh
db 0e2h,0d2h,083h,0b3h,026h,016h,047h,077h
db 06ah,05ah,00bh,03bh,0aeh,09eh,0cfh,0ffh
db 0f2h,0c2h,093h,0a3h,036h,006h,057h,067h
db 07ah,04ah,01bh,02bh,0beh,08eh,0dfh,0efh
; third byte (bits 16..23)
db 000h,007h,00eh,009h,06dh,06ah,063h,064h
db 0dbh,0dch,0d5h,0d2h,0b6h,0b1h,0b8h,0bfh
db 0b7h,0b0h,0b9h,0beh,0dah,0ddh,0d4h,0d3h
db 06ch,06bh,062h,065h,001h,006h,00fh,008h
db 06eh,069h,060h,067h,003h,004h,00dh,00ah
db 0b5h,0b2h,0bbh,0bch,0d8h,0dfh,0d6h,0d1h
db 0d9h,0deh,0d7h,0d0h,0b4h,0b3h,0bah,0bdh
db 002h,005h,00ch,00bh,06fh,068h,061h,066h
db 0dch,0dbh,0d2h,0d5h,0b1h,0b6h,0bfh,0b8h
db 007h,000h,009h,00eh,06ah,06dh,064h,063h
db 06bh,06ch,065h,062h,006h,001h,008h,00fh
db 0b0h,0b7h,0beh,0b9h,0ddh,0dah,0d3h,0d4h
db 0b2h,0b5h,0bch,0bbh,0dfh,0d8h,0d1h,0d6h
db 069h,06eh,067h,060h,004h,003h,00ah,00dh
db 005h,002h,00bh,00ch,068h,06fh,066h,061h
db 0deh,0d9h,0d0h,0d7h,0b3h,0b4h,0bdh,0bah
db 0b8h,0bfh,0b6h,0b1h,0d5h,0d2h,0dbh,0dch
db 063h,064h,06dh,06ah,00eh,009h,000h,007h
db 00fh,008h,001h,006h,062h,065h,06ch,06bh
db 0d4h,0d3h,0dah,0ddh,0b9h,0beh,0b7h,0b0h
db 0d6h,0d1h,0d8h,0dfh,0bbh,0bch,0b5h,0b2h
db 00dh,00ah,003h,004h,060h,067h,06eh,069h
db 061h,066h,06fh,068h,00ch,00bh,002h,005h
db 0bah,0bdh,0b4h,0b3h,0d7h,0d0h,0d9h,0deh
db 064h,063h,06ah,06dh,009h,00eh,007h,000h
db 0bfh,0b8h,0b1h,0b6h,0d2h,0d5h,0dch,0dbh
db 0d3h,0d4h,0ddh,0dah,0beh,0b9h,0b0h,0b7h
db 008h,00fh,006h,001h,065h,062h,06bh,06ch
db 00ah,00dh,004h,003h,067h,060h,069h,06eh
db 0d1h,0d6h,0dfh,0d8h,0bch,0bbh,0b2h,0b5h
db 0bdh,0bah,0b3h,0b4h,0d0h,0d7h,0deh,0d9h
db 066h,061h,068h,06fh,00bh,00ch,005h,002h
; most significant byte (bits 24..31)
db 000h,077h,0eeh,099h,007h,070h,0e9h,09eh
db 00eh,079h,0e0h,097h,009h,07eh,0e7h,090h
db 01dh,06ah,0f3h,084h,01ah,06dh,0f4h,083h
db 013h,064h,0fdh,08ah,014h,063h,0fah,08dh
db 03bh,04ch,0d5h,0a2h,03ch,04bh,0d2h,0a5h
db 035h,042h,0dbh,0ach,032h,045h,0dch,0abh
db 026h,051h,0c8h,0bfh,021h,056h,0cfh,0b8h
db 028h,05fh,0c6h,0b1h,02fh,058h,0c1h,0b6h
db 076h,001h,098h,0efh,071h,006h,09fh,0e8h
db 078h,00fh,096h,0e1h,07fh,008h,091h,0e6h
db 06bh,01ch,085h,0f2h,06ch,01bh,082h,0f5h
db 065h,012h,08bh,0fch,062h,015h,08ch,0fbh
db 04dh,03ah,0a3h,0d4h,04ah,03dh,0a4h,0d3h
db 043h,034h,0adh,0dah,044h,033h,0aah,0ddh
db 050h,027h,0beh,0c9h,057h,020h,0b9h,0ceh
db 05eh,029h,0b0h,0c7h,059h,02eh,0b7h,0c0h
db 0edh,09ah,003h,074h,0eah,09dh,004h,073h
db 0e3h,094h,00dh,07ah,0e4h,093h,00ah,07dh
db 0f0h,087h,01eh,069h,0f7h,080h,019h,06eh
db 0feh,089h,010h,067h,0f9h,08eh,017h,060h
db 0d6h,0a1h,038h,04fh,0d1h,0a6h,03fh,048h
db 0d8h,0afh,036h,041h,0dfh,0a8h,031h,046h
db 0cbh,0bch,025h,052h,0cch,0bbh,022h,055h
db 0c5h,0b2h,02bh,05ch,0c2h,0b5h,02ch,05bh
db 09bh,0ech,075h,002h,09ch,0ebh,072h,005h
db 095h,0e2h,07bh,00ch,092h,0e5h,07ch,00bh
db 086h,0f1h,068h,01fh,081h,0f6h,06fh,018h

gsa-p0069.001.01 Released: 2006/03/24 Page 50


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Appendix A: CRC-32 Checksum Calculation

db 088h,0ffh,066h,011h,08fh,0f8h,061h,016h
db 0a0h,0d7h,04eh,039h,0a7h,0d0h,049h,03eh
db 0aeh,0d9h,040h,037h,0a9h,0deh,047h,030h
db 0bdh,0cah,053h,024h,0bah,0cdh,054h,023h
db 0b3h,0c4h,05dh,02ah,0b4h,0c3h,05ah,02dh
; End of lookup version

; ============================================================= ;
; 8751 HARD-WAY SHIFT REGISTER ROUTINE ;
; ============================================================= ;
; ;
; This is 5.5 times slower than the lookup table routine, but ;
; it takes up less than 4% of the code space. ;
; ;
; You can use this routine to generate the lookup table, by ;
; feeding it with successive byte values 00..FF with a seed ;
; of 0 each time. ;
; ;
; ============================================================= ;

; Enter with R7:R6:R5:R4 initial CRC or seed (R7.7 MSB), DPTR pointer to data
; Exit with R7:R6:R5:R4 new CRC, DPTR advanced by 1, A trashed, R2 zero
; Stack: none
; Average 187 instruction cycles per byte

.....
CLR A
MOVC A,@A+DPTR ; get next data byte
INC DPTR
XRL A,R4 ; XOR data with low byte CRC
MOV R4,A ; save result

MOV R2,#008H ; bit counter

next_bit:
; Test the (next) LSB of the combined CRC/DATA
; (however we get here, A and R4 are the same)
CLR C ; clear C before shift
JNB ACC.0,shift_no_xor ; bit is 0

MOV A,R7 ; shift CRC one place right


RRC A
XRL A,#0EDH ; XOR with magic number
MOV R7,A
MOV A,R6
RRC A
XRL A,#0B8H
MOV R6,A
MOV A,R5
RRC A
XRL A,#083H
MOV R5,A
MOV A,R4 ; LS 8
RRC A
XRL A,#020H
AJMP shift_done

shift_no_xor:
MOV A,R7 ; shift CRC one place right
RRC A ; without XORing
MOV R7,A
MOV A,R6 ; next 8
RRC A
MOV R6,A
MOV A,R5 ; next 8
RRC A
MOV R5,A
MOV A,R4 ; LS 8
RRC A

shift_done:
MOV R4,A ; replace final CRC byte

gsa-p0069.001.01 Released: 2006/03/24 Page 51


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Appendix A: CRC-32 Checksum Calculation

DJNZ R2,next_bit
.....

; ============================================================= ;
; Algorithms for other family CPUs ;
; ============================================================= ;
; ;
; Routines for 80x86 and MIPS are included below. It is fairly ;
; simple to translate these for other CPUs (Z80, etc). ;
; ;
; ============================================================= ;

; ============================================================= ;
; 32-bit x86 LOOKUP TABLE ROUTINE ;
; ============================================================= ;
; ;
; For 80386 or better - uses 32 bit registers ;
; ;
; ============================================================= ;

; CRC calculation by lookup table


; 80x86 Assembly Language Version (32 bit)
; Enter with CRC or seed in EDX, (E)DS:(E)SI pointer to data, ECX count
; Return CRC in EDX, EAX trashed, ECX zero

calc_CRC proc
xor eax,eax ; start with EAX=0
lodsb ; AL=[SI]; SI=SI+1
; Though we would like to take the data in larger chunks, the combining table
; becomes unfeasibly large for anything more than 8 bits.
xor al,dl ; XOR low CRC byte with data
shl ax,2 ; shift to make dword pointer
mov bx,ax ; use to make pointer into
mov eax,cs:dword ptr combine_table[bx] ; combining table and get value
; If (as is probably the case) DS is pointing to the code segment, you can omit
; the CS override to save a few cycles. But in this case put an “assume ds:CODE”
; directive ahead of the routine, or the assembler will use the wrong offset.
shr edx,8 ; shift CRC 8 bits right
xor edx,eax ; XOR result with table value
dec ecx ; count this byte
jnz calc_CRC ; do until done
ret ; final CRC in EDX
calc_CRC endp

align 4
combine_table label dword
dd 000000000h,077073096h,0ee0e612ch,0990951bah,0076dc419h,0706af48fh,0e963a535h,09e6495a3h
dd 00edb8832h,079dcb8a4h,0e0d5e91eh,097d2d988h,009b64c2bh,07eb17cbdh,0e7b82d07h,090bf1d91h
dd 01db71064h,06ab020f2h,0f3b97148h,084be41deh,01adad47dh,06ddde4ebh,0f4d4b551h,083d385c7h
dd 0136c9856h,0646ba8c0h,0fd62f97ah,08a65c9ech,014015c4fh,063066cd9h,0fa0f3d63h,08d080df5h
dd 03b6e20c8h,04c69105eh,0d56041e4h,0a2677172h,03c03e4d1h,04b04d447h,0d20d85fdh,0a50ab56bh
dd 035b5a8fah,042b2986ch,0dbbbc9d6h,0acbcf940h,032d86ce3h,045df5c75h,0dcd60dcfh,0abd13d59h
dd 026d930ach,051de003ah,0c8d75180h,0bfd06116h,021b4f4b5h,056b3c423h,0cfba9599h,0b8bda50fh
dd 02802b89eh,05f058808h,0c60cd9b2h,0b10be924h,02f6f7c87h,058684c11h,0c1611dabh,0b6662d3dh
dd 076dc4190h,001db7106h,098d220bch,0efd5102ah,071b18589h,006b6b51fh,09fbfe4a5h,0e8b8d433h
dd 07807c9a2h,00f00f934h,09609a88eh,0e10e9818h,07f6a0dbbh,0086d3d2dh,091646c97h,0e6635c01h
dd 06b6b51f4h,01c6c6162h,0856530d8h,0f262004eh,06c0695edh,01b01a57bh,08208f4c1h,0f50fc457h
dd 065b0d9c6h,012b7e950h,08bbeb8eah,0fcb9887ch,062dd1ddfh,015da2d49h,08cd37cf3h,0fbd44c65h
dd 04db26158h,03ab551ceh,0a3bc0074h,0d4bb30e2h,04adfa541h,03dd895d7h,0a4d1c46dh,0d3d6f4fbh
dd 04369e96ah,0346ed9fch,0ad678846h,0da60b8d0h,044042d73h,033031de5h,0aa0a4c5fh,0dd0d7cc9h
dd 05005713ch,0270241aah,0be0b1010h,0c90c2086h,05768b525h,0206f85b3h,0b966d409h,0ce61e49fh
dd 05edef90eh,029d9c998h,0b0d09822h,0c7d7a8b4h,059b33d17h,02eb40d81h,0b7bd5c3bh,0c0ba6cadh
dd 0edb88320h,09abfb3b6h,003b6e20ch,074b1d29ah,0ead54739h,09dd277afh,004db2615h,073dc1683h
dd 0e3630b12h,094643b84h,00d6d6a3eh,07a6a5aa8h,0e40ecf0bh,09309ff9dh,00a00ae27h,07d079eb1h
dd 0f00f9344h,08708a3d2h,01e01f268h,06906c2feh,0f762575dh,0806567cbh,0196c3671h,06e6b06e7h
dd 0fed41b76h,089d32be0h,010da7a5ah,067dd4acch,0f9b9df6fh,08ebeeff9h,017b7be43h,060b08ed5h

gsa-p0069.001.01 Released: 2006/03/24 Page 52


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Appendix A: CRC-32 Checksum Calculation

dd 0d6d6a3e8h,0a1d1937eh,038d8c2c4h,04fdff252h,0d1bb67f1h,0a6bc5767h,03fb506ddh,048b2364bh
dd 0d80d2bdah,0af0a1b4ch,036034af6h,041047a60h,0df60efc3h,0a867df55h,0316e8eefh,04669be79h
dd 0cb61b38ch,0bc66831ah,0256fd2a0h,05268e236h,0cc0c7795h,0bb0b4703h,0220216b9h,05505262fh
dd 0c5ba3bbeh,0b2bd0b28h,02bb45a92h,05cb36a04h,0c2d7ffa7h,0b5d0cf31h,02cd99e8bh,05bdeae1dh
dd 09b64c2b0h,0ec63f226h,0756aa39ch,0026d930ah,09c0906a9h,0eb0e363fh,072076785h,005005713h
dd 095bf4a82h,0e2b87a14h,07bb12baeh,00cb61b38h,092d28e9bh,0e5d5be0dh,07cdcefb7h,00bdbdf21h
dd 086d3d2d4h,0f1d4e242h,068ddb3f8h,01fda836eh,081be16cdh,0f6b9265bh,06fb077e1h,018b74777h
dd 088085ae6h,0ff0f6a70h,066063bcah,011010b5ch,08f659effh,0f862ae69h,0616bffd3h,0166ccf45h
dd 0a00ae278h,0d70dd2eeh,04e048354h,03903b3c2h,0a7672661h,0d06016f7h,04969474dh,03e6e77dbh
dd 0aed16a4ah,0d9d65adch,040df0b66h,037d83bf0h,0a9bcae53h,0debb9ec5h,047b2cf7fh,030b5ffe9h
dd 0bdbdf21ch,0cabac28ah,053b39330h,024b4a3a6h,0bad03605h,0cdd70693h,054de5729h,023d967bfh
dd 0b3667a2eh,0c4614ab8h,05d681b02h,02a6f2b94h,0b40bbe37h,0c30c8ea1h,05a05df1bh,02d02ef8dh

; ============================================================= ;
; 16-bit x86 LOOKUP TABLE ROUTINE ;
; ============================================================= ;
; ;
; For 8088, 8086, 80186, 80286 - uses 16 bit registers ;
; Note: not optimal code for 386 and better CPUs ;
; ;
; ============================================================= ;

; CRC calculation by lookup table


; 8086 Assembly Language Version (16 bit)
; Enter with CRC or seed in DI:DX, DS:SI pointer to data, CX count
; Return CRC in DI:DX, AX, BX trashed, CX zero

calc_CRC proc
push cx
xor ax,ax ; start with EAX=0
lodsb ; AL=[SI]; SI=SI+1

xor al,dl ; XOR low CRC byte with data


mov cx,4
shl ax,cl ; shift to make dword pointer
mov bx,ax
mov cx,ds ; get upper CRC word into cx
; where we can manipulate each half

mov ax,cs:word ptr combine_table[bx] ; get table low word


xor al,dh ; xor bits 15..8 of CRC with 0..7 of table
mov dl,al ; becomes bits 0..7 of new CRC
xor ah,cl ; xor bits 23..16 of CRC with 15..8 of table
mov dh,ah ; becomes bits 15..8 of new CRC
mov al,cs:word ptr combine_table[bx].2 ; get table high word
xor al,ch ; xor bits 31..24 of CRC with 23..16 of table
; becomes bits 23..16 of new CRC
; 31..24 of table becomes 31..24 of new CRC
mov di,ax ; replace upper CRC word in DI
pop cx
loop calc_CRC ; do until done
ret ; final CRC in DI:DX
calc_CRC endp

align 4
combine_table label dword
dd 000000000h,077073096h,0ee0e612ch,0990951bah,0076dc419h,0706af48fh,0e963a535h,09e6495a3h
dd 00edb8832h,079dcb8a4h,0e0d5e91eh,097d2d988h,009b64c2bh,07eb17cbdh,0e7b82d07h,090bf1d91h
dd 01db71064h,06ab020f2h,0f3b97148h,084be41deh,01adad47dh,06ddde4ebh,0f4d4b551h,083d385c7h
dd 0136c9856h,0646ba8c0h,0fd62f97ah,08a65c9ech,014015c4fh,063066cd9h,0fa0f3d63h,08d080df5h
dd 03b6e20c8h,04c69105eh,0d56041e4h,0a2677172h,03c03e4d1h,04b04d447h,0d20d85fdh,0a50ab56bh
dd 035b5a8fah,042b2986ch,0dbbbc9d6h,0acbcf940h,032d86ce3h,045df5c75h,0dcd60dcfh,0abd13d59h
dd 026d930ach,051de003ah,0c8d75180h,0bfd06116h,021b4f4b5h,056b3c423h,0cfba9599h,0b8bda50fh
dd 02802b89eh,05f058808h,0c60cd9b2h,0b10be924h,02f6f7c87h,058684c11h,0c1611dabh,0b6662d3dh
dd 076dc4190h,001db7106h,098d220bch,0efd5102ah,071b18589h,006b6b51fh,09fbfe4a5h,0e8b8d433h
dd 07807c9a2h,00f00f934h,09609a88eh,0e10e9818h,07f6a0dbbh,0086d3d2dh,091646c97h,0e6635c01h
dd 06b6b51f4h,01c6c6162h,0856530d8h,0f262004eh,06c0695edh,01b01a57bh,08208f4c1h,0f50fc457h
dd 065b0d9c6h,012b7e950h,08bbeb8eah,0fcb9887ch,062dd1ddfh,015da2d49h,08cd37cf3h,0fbd44c65h
dd 04db26158h,03ab551ceh,0a3bc0074h,0d4bb30e2h,04adfa541h,03dd895d7h,0a4d1c46dh,0d3d6f4fbh
dd 04369e96ah,0346ed9fch,0ad678846h,0da60b8d0h,044042d73h,033031de5h,0aa0a4c5fh,0dd0d7cc9h
dd 05005713ch,0270241aah,0be0b1010h,0c90c2086h,05768b525h,0206f85b3h,0b966d409h,0ce61e49fh
dd 05edef90eh,029d9c998h,0b0d09822h,0c7d7a8b4h,059b33d17h,02eb40d81h,0b7bd5c3bh,0c0ba6cadh
dd 0edb88320h,09abfb3b6h,003b6e20ch,074b1d29ah,0ead54739h,09dd277afh,004db2615h,073dc1683h
dd 0e3630b12h,094643b84h,00d6d6a3eh,07a6a5aa8h,0e40ecf0bh,09309ff9dh,00a00ae27h,07d079eb1h

gsa-p0069.001.01 Released: 2006/03/24 Page 53


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Appendix A: CRC-32 Checksum Calculation

dd 0f00f9344h,08708a3d2h,01e01f268h,06906c2feh,0f762575dh,0806567cbh,0196c3671h,06e6b06e7h
dd 0fed41b76h,089d32be0h,010da7a5ah,067dd4acch,0f9b9df6fh,08ebeeff9h,017b7be43h,060b08ed5h
dd 0d6d6a3e8h,0a1d1937eh,038d8c2c4h,04fdff252h,0d1bb67f1h,0a6bc5767h,03fb506ddh,048b2364bh
dd 0d80d2bdah,0af0a1b4ch,036034af6h,041047a60h,0df60efc3h,0a867df55h,0316e8eefh,04669be79h
dd 0cb61b38ch,0bc66831ah,0256fd2a0h,05268e236h,0cc0c7795h,0bb0b4703h,0220216b9h,05505262fh
dd 0c5ba3bbeh,0b2bd0b28h,02bb45a92h,05cb36a04h,0c2d7ffa7h,0b5d0cf31h,02cd99e8bh,05bdeae1dh
dd 09b64c2b0h,0ec63f226h,0756aa39ch,0026d930ah,09c0906a9h,0eb0e363fh,072076785h,005005713h
dd 095bf4a82h,0e2b87a14h,07bb12baeh,00cb61b38h,092d28e9bh,0e5d5be0dh,07cdcefb7h,00bdbdf21h
dd 086d3d2d4h,0f1d4e242h,068ddb3f8h,01fda836eh,081be16cdh,0f6b9265bh,06fb077e1h,018b74777h
dd 088085ae6h,0ff0f6a70h,066063bcah,011010b5ch,08f659effh,0f862ae69h,0616bffd3h,0166ccf45h
dd 0a00ae278h,0d70dd2eeh,04e048354h,03903b3c2h,0a7672661h,0d06016f7h,04969474dh,03e6e77dbh
dd 0aed16a4ah,0d9d65adch,040df0b66h,037d83bf0h,0a9bcae53h,0debb9ec5h,047b2cf7fh,030b5ffe9h
dd 0bdbdf21ch,0cabac28ah,053b39330h,024b4a3a6h,0bad03605h,0cdd70693h,054de5729h,023d967bfh
dd 0b3667a2eh,0c4614ab8h,05d681b02h,02a6f2b94h,0b40bbe37h,0c30c8ea1h,05a05df1bh,02d02ef8dh
; ============================================================= ;
; 16 BIT x86 SHIFT REGISTER ROUTINE ;
; ============================================================= ;
; ;
; If you don’t have space for the lookup table, you’re ;
; probably not running a 32 bit CPU. Here’s a 16 bit shift ;
; register routine suitable for 88, 86, 186 and 286. ;
; ;
; ============================================================= ;

; Enter with CRC or seed in DI:DX, DS:SI pointer to data, CX count


; Data should be word aligned
; Return CRC in DI:DX, AX trashed, CX zero

calc_CRC proc
push bx

next_word:
lodsw ; get next byte, inc SI
xor dx,ax ; XOR data into CRC
mov bl,16 ; bit counter

; To do it in single bytes, replace the above three lines with:


; lodsb
; xor dl,al
; mov bl,8

next_bit:
shr di,1 ; next LS bit to carry
rcr dx,1
jnb no_xor

; If carry is set, XOR the magic number


xor di,0EDB8h
xor dx,08320h

no_xor:
dec bl
jne next_bit

sub cx,2 ; For single bytes, use “dec cx”


jne next_dword

pop bx
ret
calc_CRC endp

; ============================================================= ;
; 32 BIT x86 SHIFT REGISTER ROUTINE ;
; ============================================================= ;
; ;
; The shift loop is so compact that fetching the data becomes ;
; a significant overhead. Make sure the data is dword aligned, ;
; if necessary by running the CRC on bytes until it is. ;
; ;
; ============================================================= ;

; Enter with CRC or seed in EDX, EDS:ESI pointer to data, ECX count
; Return CRC in EDX, EAX trashed, ECX zero

gsa-p0069.001.01 Released: 2006/03/24 Page 54


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Appendix A: CRC-32 Checksum Calculation

calc_CRC proc
push ebx
next_dword:
lodsd ; get next data, inc SI
xor edx,eax ; XOR data into CRC
mov bl,32 ; bit counter
next_bit:
shr edx,1 ; next LS bit to carry
jnb no_xor

; If carry is set, XOR the magic number


xor edx,0EDB88320h

no_xor:
dec bl
jne next_bit

sub ecx,4
jne next_dword

pop ebx
ret
calc_CRC endp

# ============================================================= #
# MIPS ASSEMBLER SHIFT REGISTER ROUTINE #
# ============================================================= #
# #
# A similar program flow should work for MIPS. I am #
# inexperienced with MIPS, so the following should be #
# regarded as a guideline only. #
# #
# ============================================================= #

# registers used:
# R8, CRC magic number (constant)
# R9, pointer to data
# R10, counter for data
# R11, enter with CRC or seed, exit with new CRC
# R12, temporary scratch data
# R13, temporary scratch data
# Assume data is DWORD aligned

...
LUI $8,0xEDB8 # get the magic number
ORI $8,$8,0x8320 # assembled in R8

next_dword:
LW $12,0x0($9) # get next data dword
ADDIU $9,$0,4 # bump pointer
XOR $11,$11,$12 # XOR data into CRC

ADDIU $12,$0,32 # set up bit counter


next_bit:
ANDI $13,$11,0x01 # test LSB
SRL $11,$11,0x01 # shift the CRC
BEQ $0,$13,next_loop# skip the XOR if bit 0 = 0

XOR $11,$11,$8 # else XOR the magic number


next_loop:
ADDIU $12,$12,-1 # decrement bit counter
BNE $0,$12,next_bit# do 32 bits

ADDIU $10,$10,-4 # decrement data counter


BNE $0,$10,next_dword# which must be divisible by 4
...

gsa-p0069.001.01 Released: 2006/03/24 Page 55


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Appendix A: CRC-32 Checksum Calculation

A.2 C Language Example


/***********************************************************/
/* C LANGUAGE VERSIONS */
/***********************************************************/
/* */
/* Compiler optimization is getting better but probably */
/* won’t do as well as hand-coded ASM. Some careful */
/* examination of the compiled code may be required to */
/* get acceptable performance, particularly with the */
/* shift register method. */
/* */
/***********************************************************/

/*******************************************/
/* */
/* Example CRC algorithm with lookup table */
/* */
/*******************************************/

unsigned long CalcCRC (unsigned long crc, char *buffer, int length)
{
int I;
for (I=0; I<length; I++)
{
crc = (crc >> 8) ^ crc_table[*buffer++ ^ (crc & 0xFF)];
}
return crc;
}

const unsigned long crc_table[] = {


0x00000000,0x77073096,0xee0e612c,0x990951ba,0x076dc419,0x706af48f,0xe963a535,0x9e6495a3
0x0edb8832,0x79dcb8a4,0xe0d5e91e,0x97d2d988,0x09b64c2b,0x7eb17cbd,0xe7b82d07,0x90bf1d91
0x1db71064,0x6ab020f2,0xf3b97148,0x84be41de,0x1adad47d,0x6ddde4eb,0xf4d4b551,0x83d385c7
0x136c9856,0x646ba8c0,0xfd62f97a,0x8a65c9ec,0x14015c4f,0x63066cd9,0xfa0f3d63,0x8d080df5
0x3b6e20c8,0x4c69105e,0xd56041e4,0xa2677172,0x3c03e4d1,0x4b04d447,0xd20d85fd,0xa50ab56b
0x35b5a8fa,0x42b2986c,0xdbbbc9d6,0xacbcf940,0x32d86ce3,0x45df5c75,0xdcd60dcf,0xabd13d59
0x26d930ac,0x51de003a,0xc8d75180,0xbfd06116,0x21b4f4b5,0x56b3c423,0xcfba9599,0xb8bda50f
0x2802b89e,0x5f058808,0xc60cd9b2,0xb10be924,0x2f6f7c87,0x58684c11,0xc1611dab,0xb6662d3d
0x76dc4190,0x01db7106,0x98d220bc,0xefd5102a,0x71b18589,0x06b6b51f,0x9fbfe4a5,0xe8b8d433
0x7807c9a2,0x0f00f934,0x9609a88e,0xe10e9818,0x7f6a0dbb,0x086d3d2d,0x91646c97,0xe6635c01
0x6b6b51f4,0x1c6c6162,0x856530d8,0xf262004e,0x6c0695ed,0x1b01a57b,0x8208f4c1,0xf50fc457
0x65b0d9c6,0x12b7e950,0x8bbeb8ea,0xfcb9887c,0x62dd1ddf,0x15da2d49,0x8cd37cf3,0xfbd44c65
0x4db26158,0x3ab551ce,0xa3bc0074,0xd4bb30e2,0x4adfa541,0x3dd895d7,0xa4d1c46d,0xd3d6f4fb
0x4369e96a,0x346ed9fc,0xad678846,0xda60b8d0,0x44042d73,0x33031de5,0xaa0a4c5f,0xdd0d7cc9
0x5005713c,0x270241aa,0xbe0b1010,0xc90c2086,0x5768b525,0x206f85b3,0xb966d409,0xce61e49f
0x5edef90e,0x29d9c998,0xb0d09822,0xc7d7a8b4,0x59b33d17,0x2eb40d81,0xb7bd5c3b,0xc0ba6cad
0xedb88320,0x9abfb3b6,0x03b6e20c,0x74b1d29a,0xead54739,0x9dd277af,0x04db2615,0x73dc1683
0xe3630b12,0x94643b84,0x0d6d6a3e,0x7a6a5aa8,0xe40ecf0b,0x9309ff9d,0x0a00ae27,0x7d079eb1
0xf00f9344,0x8708a3d2,0x1e01f268,0x6906c2fe,0xf762575d,0x806567cb,0x196c3671,0x6e6b06e7
0xfed41b76,0x89d32be0,0x10da7a5a,0x67dd4acc,0xf9b9df6f,0x8ebeeff9,0x17b7be43,0x60b08ed5
0xd6d6a3e8,0xa1d1937e,0x38d8c2c4,0x4fdff252,0xd1bb67f1,0xa6bc5767,0x3fb506dd,0x48b2364b
0xd80d2bda,0xaf0a1b4c,0x36034af6,0x41047a60,0xdf60efc3,0xa867df55,0x316e8eef,0x4669be79
0xcb61b38c,0xbc66831a,0x256fd2a0,0x5268e236,0xcc0c7795,0xbb0b4703,0x220216b9,0x5505262f
0xc5ba3bbe,0xb2bd0b28,0x2bb45a92,0x5cb36a04,0xc2d7ffa7,0xb5d0cf31,0x2cd99e8b,0x5bdeae1d
0x9b64c2b0,0xec63f226,0x756aa39c,0x026d930a,0x9c0906a9,0xeb0e363f,0x72076785,0x05005713
0x95bf4a82,0xe2b87a14,0x7bb12bae,0x0cb61b38,0x92d28e9b,0xe5d5be0d,0x7cdcefb7,0x0bdbdf21
0x86d3d2d4,0xf1d4e242,0x68ddb3f8,0x1fda836e,0x81be16cd,0xf6b9265b,0x6fb077e1,0x18b74777
0x88085ae6,0xff0f6a70,0x66063bca,0x11010b5c,0x8f659eff,0xf862ae69,0x616bffd3,0x166ccf45
0xa00ae278,0xd70dd2ee,0x4e048354,0x3903b3c2,0xa7672661,0xd06016f7,0x4969474d,0x3e6e77db
0xaed16a4a,0xd9d65adc,0x40df0b66,0x37d83bf0,0xa9bcae53,0xdebb9ec5,0x47b2cf7f,0x30b5ffe9
0xbdbdf21c,0xcabac28a,0x53b39330,0x24b4a3a6,0xbad03605,0xcdd70693,0x54de5729,0x23d967bf
0xb3667a2e,0xc4614ab8,0x5d681b02,0x2a6f2b94,0xb40bbe37,0xc30c8ea1,0x5a05df1b,0x2d02ef8d
};

/*************************************************/
/* */
/* A compact but slower version using shifts ... */
/* */
/*************************************************/

gsa-p0069.001.01 Released: 2006/03/24 Page 56


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Appendix A: CRC-32 Checksum Calculation

unsigned long CalcCRC (unsigned long crc, char *buffer, int length)
{
int i,j ;
for (i=0; i<length; i++)
{
crc = crc ^ *buffer++ ;
for (j=0; j<8; j++)
{
if (crc & 1)
crc = (crc>>1) ^ 0xEDB88320 ;
else
crc = crc >>1 ;
}
}
return crc ;
}

; End Of File

gsa-p0069.001.01 Released: 2006/03/24 Page 57


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Appendix B: Printer Report Descriptors

Appendix B: Printer Report Descriptors


The following verbose report descriptors have been created to show an implementation of
each device class interface as specified in this document.
While these descriptors can be used ‘as is’ in a device, it should be noted they can be
optimized to reduce the storage . An understanding of the HID report structure is required to
undertake this activity.
The following report descriptors can be compiled and used by any 8051 compatible micro-
controller. For non-compatible 8051 micro-controllers, extract the data bytes and encode as
appropriate.
These descriptors were created with the USB-IF HID Report Descriptor tool.

[TBD]

gsa-p0069.001.01 Released: 2006/03/24 Page 58


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Index

Index
Index
Numerics connect
0x01 ACK .......................................................5, 9 communication .......................................... 18
0x02 Enable ...................................................... 10 power ......................................................... 18
and 0x0A Device State .............................. 22
0x03 Disable ..................................................... 10 D
and 0x0A Device State .............................. 22 Data
0x04 Self Test ................................................... 10 0xC0 Define Region .................................. 12
0x05 Request GAT Report ............................... 11 0xC1 Define Template .............................. 13
0x06 Power Status ......................................18, 19 0xC2 Print Ticket ...................................... 14
priority ......................................................... 4 0xC8 Metrics ............................................. 28
0x07 GAT Data ................................................. 20 0xCA File Transfer .................................... 17
0x08 Calculate CRC ......................................... 11 Data, 0x07 GAT Data ....................................... 21
and 0x09 CRC Data ................................... 21 DFU standard ...................................................... 2
0x09 CRC Data Diagnostic
and 0x08 Calculate CRC ........................... 11 0xC4 Failure Status ................................... 24
0x09 CRC Data ................................................. 21 diagnostics
0x0A Device State ............................................ 22 data, GAT .................................................. 20
device disabled .......................................... 10 diagnostic commands ..........................10, 47
0x85 Failure Status Disable
and 0x04 Self Test ..................................... 10 0x0A Device State ..................................... 22
priority ......................................................... 4 disable device ................................................... 10
0xA0 Pay Coin(s) .......................... 12, 13, 14, 15 disconnect
0xA1 Failure Status .......................................... 23 communication .......................................... 18
0xC0 Define Region ......................................... 12 power ......................................................... 18
0xC1 Define Template ...................................... 13
E
0xC3 Form Feed ............................................... 15
enable device .................................................... 10
0xC4 Failure Status
events
and NVM ..................................................... 3
0xC5 Ticket Print Status ................................... 24 common ....................................................... 5
definition ..................................................... 5
0xC7 Request Printer Metrics ........................... 15
list .............................................................. 18
0xC8 Metrics .................................................... 28
Ext. Power, 0x06 Power Status ........................ 19
0xC9 Graphic Transfer Setup ........................... 16
external power ............................................18, 19
0xCA File Transfer ........................................... 17
0xCB Printer Status .......................................... 29 F
F1, 0xC5 Ticket Print Status ............................. 25
A
F2, 0xC5 Ticket Print Status ............................. 25
ACK, see 0x01 ACK or acknowledgement
F3, 0xC5 Ticket Print Status ............................. 25
auditing data ...................................................... 20
File Size, 0xC9 Graphic Transfer Setup ........... 16
B Firmware, 0xC4 Failure Status ......................... 23
battery-backup .................................................... 3 form feed ........................................................... 15

C G
Chassis, 0xCB Printer Status ............................ 29 GAT .................................................................. 11
commands GET/SET features ............................................... 3
common ....................................................... 4 Graphic, 0xC6 Transfer Status ......................... 26
definition ...................................................... 4 graphics
execution ...................................................... 8 file transfer ................................................ 17
listing ........................................................... 8 transfer setup ............................................. 16

gsa-p0069.001.01 Released: 2006/03/24 Page 59


© 2005 - 2006 Gaming Standards Association (GSA)
GDS Printer:
Communication Protocol v1.0 Index

H summary list .............................................. 31


Human Interface Device, HID ........................2, 3 Result, 0x09 CRC Data .................................... 21
Resync, 0x01 ACK ............................................. 9
I
Index S
0xC0 Define Region .................................. 12 Seed, 0x08 Calculate CRC ............................... 11
0xC1 Define Template .............................. 13 Size
0xC2 Print Ticket ...................................... 14 0xC0 Define Region .................................. 12
0xC8 Metrics ............................................. 28 0xC1 Define Template .............................. 13
0xC9 Graphic Transfer Setup .................... 16 0xC2 Print Ticket ...................................... 14
0xCA File Transfer .................................... 17 0xC8 Metrics ............................................. 28
Index, 0x07 GAT Data ..................................... 21 0xCA File Transfer .................................... 17
INTERRUPT IN ................................................. 3 Size, 0x07 GAT Data ........................................ 21
Status Code, 0xC6 Transfer Status ................... 26
L status codes for 0xC6 Transfer Status .............. 27
LSB ................................................................... 11
T
N Temperature Error, 0xC4 Failure Status ........... 23
NAK .................................................................... 9 Template, 0xC6 Transfer Status ....................... 26
Need Reset, 0x06 Power Status ........................ 19 templates, define ............................................... 13
non-volatile memory ........................................... 3 TID ...................................................................... 4
NVM ................................................................... 3 events and power up .................................... 6
0x04 Self-Test ........................................... 10 pending ........................................................ 4
0xC4 Failure Status ................................... 23 rules ............................................................. 9
Top of Form, 0xCB Printer Status .................... 29
O
On-The-Go .......................................................... 1 Transaction ID
Other 0x01 ACK .................................................... 9
0xC5 Ticket Print Status ............................ 25
0xC4 Failure Status ................................... 24
see also TID
P Transaction Id
Paper Empty, 0xCB Printer Status .................... 29 0xC5 Ticket Status .................................... 29
Paper Jam, 0xCB Printer Status ........................ 29 0xCB Printer Status ................................... 29
Paper Low, 0xCB Printer Status ....................... 29 Type, 0xC9 Graphic Transfer Setup ................. 16
power
U
failures ......................................................... 3
upload ................................................................. 2
loss and acknowledgements ........................ 6
usage number ...................................................... 2
power up sequence ...................................... 6
allocation ................................................... 30
Print Complete, 0xC5 Ticket Print Status ........ 25
summary list .............................................. 31
Print Head Damage, 0xC4 Failure Status ......... 23
usage page ........................................................... 2
Print Head, 0xCB Printer Status ....................... 29
USB
Print in Progress, 0xC5 Ticket Print Status ...... 25
identification strings ............................35–37
Print, 0xC6 Transfer Status ............................... 26
versions, speeds .......................................1, 3
printer metrics, request ..................................... 15
priority, message ................................................. 4 X
XML and GAT ...........................................11, 20
R
real time events ................................................... 6
Region, 0xC6 Transfer Status ........................... 26
regions, define ................................................... 12
report ID
allocation ................................................... 31

gsa-p0069.001.01 Released: 2006/03/24 Page 60


© 2005 - 2006 Gaming Standards Association (GSA)
END OF DOCUMENT

gsa-p0069.001.01
Released: 2006/03/24

Page 61
© 2005 - 2006 Gaming Standards Association (GSA)

You might also like