Anda di halaman 1dari 83

GDS® Printer:

Communication Protocol v1.0.3


(Includes Errata Sheet 1)
Implemented as USB HID Class Device
Document ID: gsa-p0069.001.03

Gaming Standards Association


GDS Technical Committee

v1.0 Standard Adopted: 2006/03/23

Document Released: 2008/01/22

This version includes changes defined in Errata Sheet 1, which is included in the
package with this document. Errata Sheet 1 describes changes that are
recommended to be made to GDS Printer: Communication Protocol v1.0, which
was released March 23, 2006. These changes have been recommended by the
GDS Technical Committee and will be scheduled for submission to the GSA
membership for approval.

www.gamingstandards.com
GDS® Printer: Communication Protocol v1.0.3, gsa-p0069.001.03
Released on 2008/01/22, 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 - 2008 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.
This document may be copied in part or in full provided that ALL copies retain the copyright and any
other proprietary notices contained on the materials. NO material may be modified, edited or taken
out of context such that its use creates a false or misleading statement or impression as to the
positions, statements or actions of GSA.

GSA Contact Information


GSA – Gaming Standards Association
E-mail: sec@gamingstandards.com
WWW: http://www.gamingstandards.com
GDS® Printer:
Communication Protocol v1.0.3 Table of Contents

Table of Contents

I About This Document ........................................................................................... v


I.I GDS (Gaming Device Standards) ....................................................................................... v
I.II Acknowledgements ............................................................................................................ v
I.III Related Documents ........................................................................................................... v
I.III.I GSA........................................................................................................................... v
I.III.II USB......................................................................................................................... vi
I.III.III ISO ......................................................................................................................... vi
I.III.IV Other References .................................................................................................. vi
I.IV Document Conventions................................................................................................... vii
I.V Document Organization ................................................................................................... vii
I.V.I Command and Event Detail Organization .............................................................. viii

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 ....................................................................................................................... 4
2.4.4 Event Acknowledgement......................................................................................... 5
2.4.5 Power Up Sequence ............................................................................................... 6
2.4.6 Device and Host Interaction .................................................................................... 6

3 Command Support ............................................................................................... 7


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..................................................................................................... 11
3.6 Report 0x05 Request GAT Report ................................................................................. 11
3.7 Report 0x08 Calculate CRC ........................................................................................... 12
3.8 Report 0xC0 Define Region............................................................................................ 13
3.8.1 Define Region Rules ............................................................................................. 13
3.9 Report 0xC1 Define Template ........................................................................................ 14

gsa-p0069.001.03 Released: 2008/01/22 Page i


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer:
Communication Protocol v1.0.3 Table of Contents

3.9.1 Define Template Rules.......................................................................................... 14


3.10 Report 0xC2 Print Ticket .............................................................................................. 15
3.10.1 Print Ticket Rules ................................................................................................ 16
3.11 Report 0xC3 Form Feed ............................................................................................... 16
3.12 Report 0xC7 Request Printer Metrics ........................................................................... 17
3.13 Report 0xC9 Graphic Transfer Setup ........................................................................... 17
3.13.1 Graphic Transfer Setup Rules............................................................................. 17
3.14 Report 0xCA File Transfer ............................................................................................ 18

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

5 Number Allocation and Report Summary ........................................................ 34


5.1 Usage Number Allocation .............................................................................................. 34
5.2 Report ID Allocation........................................................................................................ 35
5.3 Report Summary Table .................................................................................................. 35

6 USB Identification Strings ................................................................................. 39


6.1 idVendor ......................................................................................................................... 39
6.2 idProduct ........................................................................................................................ 39
6.3 iManufacturer.................................................................................................................. 39
6.4 iInterface......................................................................................................................... 40
6.4.1 Protocol Level - Major ........................................................................................... 40
6.4.2 Protocol Level - Minor ........................................................................................... 40
6.4.3 Protocol Level - Errata Number............................................................................. 40
6.4.4 Product Name ....................................................................................................... 40
6.4.5 Firmware Issue...................................................................................................... 40
6.4.6 Build Version ......................................................................................................... 41
6.4.7 Manufacturing Date............................................................................................... 41
6.5 iSerialNumber................................................................................................................. 41
6.6 Peripheral Class ............................................................................................................. 41

gsa-p0069.001.03 Released: 2008/01/22 Page ii


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer:
Communication Protocol v1.0.3 Table of Contents

7 Metrics Command Data Format ........................................................................ 42


7.1 Metrics Report Data Structure ........................................................................................ 42
7.2 PR: Report Printer Resolution ........................................................................................ 43
7.2.1 Structure................................................................................................................ 43
7.2.2 PR Attribute........................................................................................................... 43
7.2.3 Example ................................................................................................................ 43
7.3 PS: Report Paper Size ................................................................................................... 43
7.3.1 Structure................................................................................................................ 43
7.3.2 PS Attributes ......................................................................................................... 43
7.3.3 Example ................................................................................................................ 44
7.4 GM: Report Free Graphic Memory ................................................................................. 44
7.4.1 Structure................................................................................................................ 44
7.4.2 GM Attributes ........................................................................................................ 44
7.4.3 Example ................................................................................................................ 44
7.5 RCS: Report International Character Support ................................................................ 45
7.5.1 Structure................................................................................................................ 45
7.5.2 Example ................................................................................................................ 45
7.6 RPT: Report Supported Predefined Templates .............................................................. 45
7.6.1 Structure................................................................................................................ 45
7.6.2 Example ................................................................................................................ 45
7.7 RBS: Report Barcode Support ....................................................................................... 45
7.7.1 Structure................................................................................................................ 45
7.7.2 Barcode Symbology Indexes ................................................................................ 46
7.7.3 Example ................................................................................................................ 46
7.8 FS: Fonts Supported ..................................................................................................... 46
7.8.1 Structure................................................................................................................ 46
7.8.2 FS Element ........................................................................................................... 46
7.8.3 FS Attributes ......................................................................................................... 47
7.8.4 Required Font Support.......................................................................................... 47
7.8.5 Example ................................................................................................................ 48
7.9 CS: Color Support .......................................................................................................... 48
7.9.1 Structure................................................................................................................ 48
7.9.2 CS Element ........................................................................................................... 48
7.9.3 CS Attribute........................................................................................................... 48
7.9.4 Example ................................................................................................................ 48
7.10 GS: Graphic Support .................................................................................................... 49
7.10.1 Structure.............................................................................................................. 49
7.10.2 Example .............................................................................................................. 49
7.11 LS: Line Support........................................................................................................... 49
7.11.1 Structure.............................................................................................................. 49
7.11.2 Example .............................................................................................................. 49
7.12 OS: Box Support........................................................................................................... 49
7.12.1 Structure.............................................................................................................. 50
7.12.2 Example .............................................................................................................. 50
7.13 Example: Data Structure .............................................................................................. 50

Glossary ................................................................................................................ 51

gsa-p0069.001.03 Released: 2008/01/22 Page iii


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer:
Communication Protocol v1.0.3 Table of Contents

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


A.1 Assembly Example......................................................................................................... 52
A.2 C Language Example..................................................................................................... 60

Appendix B: Printer Report Descriptors ............................................................ 63

Index ...................................................................................................................... 71

gsa-p0069.001.03 Released: 2008/01/22 Page iv


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer:
Communication Protocol v1.0.3 About This Document

I About This Document


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

I.I GDS (Gaming Device Standards)


GSA Gaming Device Standards controls the flow of information between an electronic gaming
machine (EGM) and the array of peripheral devices operating inside it, such as bill validators, card
readers and ticket printers using Universal Serial Bus (USB) standards protocol. In essence, each
peripheral uses one command set to communicate with its host machine. That information can then
be relayed to the casino management system through the machine message protocol, such as GSA’s
G2S™ (Game-to-System) Message Protocol.
For more details about GSA, visit the Web site: http://www.gamingstandards.com.

I.II 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.

I.III Related Documents

I.III.I GSA
Gaming Standards Association documents referenced (http://www.gamingstandards.com):
Table I.1 Referenced GSA Documents

Ref Title

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

gsa-p0069.001.03 Released: 2008/01/22 Page v


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer:
Communication Protocol v1.0.3 About This Document

I.III.II USB
USB Implementers Forum, Inc., http://www.usb.org, documents referenced:
Table I.2 Referenced USB Documents

Ref Title

USB 2.0 Universal Serial Bus Specification, v2.0


http://www.usb.org/developers/docs/
DCDHID Device Class Definition for HID, v1.11
http://www.usb.org/developers/hidpage/
DFU Device Firmware Upgrade, v1.1
http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf.
UnicodeECN USB Engineering Change Notice – UNICODE UTF-16LE for String
Descriptors
http://www.usb.org/developers/docs

I.III.III ISO
International Organization for Standardization, http://www.iso.org documents referenced:
Table I.3 Referenced ISO Documents

Reference Title and Source

ISO/IEC 10646 Universal Character Set Encoding Specification

I.III.IV Other References

Table I.4 Referenced Miscellaneous Documents

Reference Title and Source

PP0.8 PlusPower Specification v0.8


http://www.poweredusb.org/pdf/PoweredUSB_v08g.pdf.
ISO 639 International Organization for Standards, http://www.iso.org,
Language Codes.
RFC 2781 UTF-16 Unofficial Specification
Unicode Standard Unicode Standard Version 3.0
http://www.unicode.org

gsa-p0069.001.03 Released: 2008/01/22 Page vi


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer:
Communication Protocol v1.0.3 About This Document

I.IV Document Conventions


Plain text indicates specification text.
Blue text indicates an internal link or an external hyperlink to a URL.
Bold (other than in headings) or underlined text is used for emphasis, unless specifically indicated
otherwise.
Italicized text (other than in headings) is used for terms being defined, unless specifically indicated
otherwise.
Courier New font is used to indicate code or psuedo code.

I.V 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)

gsa-p0069.001.03 Released: 2008/01/22 Page vii


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer:
Communication Protocol v1.0.3 About This Document

I.V.I 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.03 Released: 2008/01/22 Page viii


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer: Chapter 1:
Communication Protocol v1.0.3 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: 12 Mbits/sec.
• high speed: 480 Mbits/sec.
GDS peripherals must, at a minimum, support full speed and must comply with all USB
requirements.
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.03 Released: 2008/01/22 Page 1


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer: Chapter 1:
Communication Protocol v1.0.3 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.03 Released: 2008/01/22 Page 2


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer: Chapter 2:
Communication Protocol v1.0.3 GDS Peripheral Common Design Characteristics

2 GDS Peripheral Common Design Characteristics


This section describes characteristics shared by all GDS peripheral devices.

2.1 Hardware: Communications


USB 2.0 defines low (1.5Mbits/sec.), full (12Mbits/sec.) and high (480Mbits/sec.) speed
communications. GSA devices must at a minimum, support full speed and must comply with all USB
requirements.
The USB specification defines a reliable means of communication at both hardware and software
levels, including error detection and recovery. See document reference USB 2.0.

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 25.

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.03 Released: 2008/01/22 Page 3


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer: Chapter 2:
Communication Protocol v1.0.3 GDS Peripheral Common Design Characteristics

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.
Do not confuse the acknowledgment system defined by the USB protocol layer with the event
acknowledgment system defined below.
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 Set_Report (Feature) requests. See document reference USB 2.0. 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.
Table 2.1 Common Commands

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 11
0x05 0x44 Request GAT Report No page 11
0x08 0x48 Calculate CRC Yes page 12

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.

gsa-p0069.001.03 Released: 2008/01/22 Page 4


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer: Chapter 2:
Communication Protocol v1.0.3 GDS Peripheral Common Design Characteristics

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.
Table 2.2 Common Events

Report ID Usage Event Data Page

N/A USB Defined Connection No page 20


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

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 increments 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.
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 resends 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.

gsa-p0069.001.03 Released: 2008/01/22 Page 5


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer: Chapter 2:
Communication Protocol v1.0.3 GDS Peripheral Common Design Characteristics

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 24)and then it reports any event messages in the following priority.
1. Power Status events, if external power is missing.
2. Perform self-test and report failure status before generating any other reports. While
performing a self-test a device may NAK, at the USB level, any host commands.
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.
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 12) and 0x04 Self Test (see page 11) 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 USB 2.0).

gsa-p0069.001.03 Released: 2008/01/22 Page 6


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

3 Command Support
The following printer commands are supported and are to be implemented as HID Feature reports.
Table 3.1 Supported Printer Commands

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 11
0x05 Request GAT Report No page 11
0x08 Calculate CRC Yes page 12
0xC0 Define Region Yes page 13
0xC1 Define Template Yes page 14
0xC2 Print Ticket No page 15
0xC3 Form Feed No page 16
0xC7 Request Printer Metrics No page 17
0xC9 Graphic Transfer Setup Yes page 17
0xCA File Transfer Yes page 18

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

gsa-p0069.001.03 Released: 2008/01/22 Page 7


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

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.
Table 3.2 Command Execution When Enabled/Disabled

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 Define Region Yes Yes
0xC1 Define Template Yes Yes
0xC2 Print Ticket Yes No
0xC3 Form Feed Yes Yes
0xC7 Request Printer Metrics Yes Yes
0xC9 Graphic Transfer Setup Yes Yes
0xCA File Transfer Yes Yes

gsa-p0069.001.03 Released: 2008/01/22 Page 8


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer: Chapter 3:
Communication Protocol v1.0.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.
Ticket Print and Printer Status share the same Transaction ID, and are referred to as printer
Transaction ID (or TID) events.
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.
Table 3.3 0x01 ACK Structure

Bit 7 6 5 4 3 2 1 0

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

Table 3.4 0x01 ACK Field Descriptions

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 resend the
pending report.
Transaction ID 0 to 0xFF The confirmed or new Transaction ID. See rules in section 3.2.1.

gsa-p0069.001.03 Released: 2008/01/22 Page 9


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer: Chapter 3:
Communication Protocol v1.0.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 24) with the enable bit set.
Table 3.5 0x02 Enable Structure

Bit 7 6 5 4 3 2 1 0

Byte 0 0x02

3.4 Report 0x03 Disable


The device deactivates the 0xC2 Print Ticket capability (see page 15). Functions such as Form Feed,
File Transfer and other functions consistent with section 3.1 may be issued while the device is
disabled. The host must send a Disable command before issuing any diagnostic commands (defined
on page 51).
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 24).
If Disable is received while printing a ticket, the device disables itself and sends the 0x0A Device State
event (see page 24) but continues to print the current print job.
Table 3.6 0x03 Disable Structure

Bit 7 6 5 4 3 2 1 0

Byte 0 0x03

gsa-p0069.001.03 Released: 2008/01/22 Page 10


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

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 25). 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.
Table 3.7 0x04 Self Test Structure

Bit 7 6 5 4 3 2 1 0

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

Table 3.8 0x04 Self Test Field Descriptions

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.

3.6 Report 0x05 Request GAT Report


The host sends this command to request diagnostic information from the printer via a 0x07 GAT
Data event (see page 22). 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.
Table 3.9 0x05 Request GAT Report Structure

Bit 7 6 5 4 3 2 1 0

Byte 0 0x05

gsa-p0069.001.03 Released: 2008/01/22 Page 11


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

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 39). 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 23) 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.
Table 3.10 0x08 Calculate CRC Structure

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

Table 3.11 0x08 Calculate CRC Field Descriptions

Name Value Description

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

gsa-p0069.001.03 Released: 2008/01/22 Page 12


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer: Chapter 3:
Communication Protocol v1.0.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 14) is used to associate printable regions defined using this
Define Region command with a specific template. Report 0xC2 Print Ticket (page 15) 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.

3.8.1 Define Region Rules


1. Only downloadable regions, DPR identifier range 100 to 999, can be defined.
2. If a region identifier already exists in the printer, the new region definition will replace the
current region definition.
3. All downloaded regions are not stored across power cycles.
Table 3.12 0xC0 Define Region Structure

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

gsa-p0069.001.03 Released: 2008/01/22 Page 13


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

Table 3.13 0xC0 Define Region Field Definitions

Name Value Description

Index Indicates a sequence if this command spans multiple


1 to 255
USB packets. This is modeled after the GAT report.
Size Number of bytes of data to follow. The last packet
0 to 61
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.

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 13) , to be
included on a ticket. Report 0xC2 Print Ticket (page 15) 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.

3.9.1 Define Template Rules


1. Only downloadable templates, DPT identifier range 100 to 999, can be defined.
2. If a template identifier already exists in the printer, the new template definition will replace
the current template definition.
3. Downloaded templates are not stored across power cycles.

gsa-p0069.001.03 Released: 2008/01/22 Page 14


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

Table 3.14 0xC1 Define Template Structure

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

Table 3.15 0xC1 Define Template Field Descriptions

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.

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 13) and 0xC1 Define Template (page 14).
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.

gsa-p0069.001.03 Released: 2008/01/22 Page 15


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

3.10.1 Print Ticket Rules


1. If device is in a disabled mode (disabled by host), the device ignores any print ticket
commands received.
2. The printer will ignore the Print Ticket command if any of the following conditions are
present:
• Print Head Open
• Paper Jam
• Paper Empty
• Top of Form
Table 3.16 0xC2 Print Ticket Structure

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

Table 3.17 0xC2 Print Ticket Field Descriptions

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 PT command in
32 to 255 the GDS Page Description Language specification.

3.11 Report 0xC3 Form Feed


The host issues this command to instruct the printer to feed a blank ticket.
Table 3.18 0xC3 Form Feed Structure

Bit 7 6 5 4 3 2 1 0

Byte 0 0xC3

gsa-p0069.001.03 Released: 2008/01/22 Page 16


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

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 31) in response.
Table 3.19 0xC7 Request Printer Metrics Structure

Bit 7 6 5 4 3 2 1 0

Byte 0 0xC7

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 18). The identifier,
Index, is used to identify the graphic as content for a printable region (See the GDS Page Definition
Language specification).

3.13.1 Graphic Transfer Setup Rules


1. If the Index already exists in the printer, the new index will replace the current index and
associate it with the new graphic when it is downloaded using 0xCA File Transfer command
(page 18).
2. If the Index being replaced is for a predefined graphic, the Index will be associated with the
new device-specific graphic and the original predefined graphic will be restored when the
printer performs a power cycle reset.
3. To determine the maximum memory size allocated in RAM to hold graphics, the host uses
the 0xC7 Request Printer Metrics command (page 17).
4. The Graphic Transfer Setup command must always precede 0xCA File Transfer command
(page 18).
Note: Downloadable device-specific graphics are not predefined and are not stored across power
cycles.
Table 3.20 0xC9 Graphic Transfer Setup Structure

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)

gsa-p0069.001.03 Released: 2008/01/22 Page 17


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

Table 3.21 0xC9 Graphic Transfer Setup Field Descriptions

Name Value Description

Type 0x01 Bitmap graphic file.


0x02 PCX graphic file.
Index Index into graphic array. After the graphic is
downloaded into the printer, this value can then be
1 to 255 referenced when defining printable regions.
1 – 99: Reserved for predefined graphic.
100 – 255: Downloadable, device-specific graphic.
File Size Least significant byte and most significant byte,
0 to 65535
respectively, of the file size.

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 17) 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 28).
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.

gsa-p0069.001.03 Released: 2008/01/22 Page 18


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

Table 3.22 0xCA File Transfer Structure

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

Table 3.23 0xCA File Transfer Field Descriptions

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.03 Released: 2008/01/22 Page 19


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

4 Event Support
The following printer events are supported. See section 2.4.1 for message priority.
Table 4.1 Supported Printer Events

Report ID Event Data Page

N/A Connection No page 20


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

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 USB
2.0.

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 21) 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.03 Released: 2008/01/22 Page 20


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer: Chapter 4:
Communication Protocol v1.0.3 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. If the USB communications section of the device is powered by the USB +5 power and if the
device enumerates with external power not present, after receiving 'Disable' command from
host, the device will report the Device State event to the host, followed by the Power Status
event. Any subsequent Power Status events, power connected/disconnected events 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.
Table 4.2 0x06 Power Status Structure

Bit 7 6 5 4 3 2 1 0

Byte 0 0x06
Need Ext.
Byte 1
Reset Power

Table 4.3 0x06 Power Status Field Descriptions

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.03 Released: 2008/01/22 Page 21


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

4.4 Report 0x07 GAT Data


This event is sent in response to the 0x05 Request GAT Data Report, on page 11. 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 Size set to 61 bytes followed by a terminating packet which must have
Size set to less than 61 bytes. In this way the host knows when all data has been received. If the last
data packet fills a 64-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 61 ]

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.
Table 4.4 0x07 GAT Data Structure

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.03 Released: 2008/01/22 Page 22


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

Table 4.5 0x07 GAT Data Field Descriptions

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


This event is sent in response to the 0x08 Calculate CRC command (see page 12). The CRC checksum
is calculated using a seed value provided in the 0x08 Calculate CRC command (see page 12).

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.
Table 4.6 0x09 CRC Data Structure

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

Table 4.7 0x09 CRC Data Field Descriptions

Name Value Description

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

gsa-p0069.001.03 Released: 2008/01/22 Page 23


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer: Chapter 4:
Communication Protocol v1.0.3 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 Device State event with Disable bit set.
5. Device communicates all pending credits to the host.
6. Device remains disabled.
Table 4.8 0x0A Device State Structure

Bit 7 6 5 4 3 2 1 0

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

Table 4.9 0x0A Device State Field Descriptions

Name Value Description

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

gsa-p0069.001.03 Released: 2008/01/22 Page 24


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

4.7 Report 0xC4 Failure Status


A Failure Status reports any faults with the peripheral device.
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 defined 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 0xC4 Failure Status event must be sent to the host after receiving a 0x04 Self Test
command (page 11), 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 diagnostic code is provided.
6. The 0xC4 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.
If The NVM fault self clears then the NVM Failure event is sent to the host with this bit
cleared. This could occur, for example, if the NVM fault was caused by static or RFI (Radio
Frequency Interference).
7. A 0xC4 Failure Status report with all bits set to 0, including the Diagnostics field, indicates
that there are no more active failures and that the device is ready to report events and/or
accept commands
Table 4.10 0xC4 Failure Status Structure

Bit 7 6 5 4 3 2 1 0

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

gsa-p0069.001.03 Released: 2008/01/22 Page 25


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

Table 4.11 0xC4 Failure Status Field Descriptions

Name 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.
Other 0 Indicates that the Diagnostic code in the
Diagnostics byte is cleared.
If, however, the Diagnostic code is set to 0 (zero),
this indicates that all failures are cleared.
1 A Diagnostic code is provided in the Diagnostics
byte.
Diagnostics 0 No fault information.
1 to 255 See Table 4.12.

Table 4.12 0xC4 Failure Status Diagnostic Codes

Diagnostic Code Description

2-254 Reserved for future use.


255 Unknown Error.

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 Ticket Print Status Rules


1. A Ticket Print Status event is sent in response to a 0xC2 Print Ticket command (page 15).
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 25) 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 16) 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).

gsa-p0069.001.03 Released: 2008/01/22 Page 26


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

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 either a Paper Jam or Print Head (open) 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.
8. If a 0x03 Disable command (page 10) is received while printing, the printer enters the disable
mode and sends the 0x0A Device State event (page 24), but also completes the current print
job.
Table 4.13 0xC5 Ticket Print Status Structure

Bit 7 6 5 4 3 2 1 0

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

Table 4.14 0xC5 Ticket Print Status Field Descriptions

Name Value Description

Transaction Id Unique identifier assigned to a communication


transaction between host and peripheral device.
Print in Progress 0 -

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.


Print Incomplete 0 -

1 Print job was not fully printed.

gsa-p0069.001.03 Released: 2008/01/22 Page 27


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

4.9 Report 0xC6 Transfer Status


This report is sent for every completely transferred command, which may span multiple reports.
Table 4.15 0xC6 Transsfer Status Structure

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

Table 4.16 0xC6 Transfer Status Field Descriptions

Name Value Description

Print 0 -
Transfer status event for a Print Ticket command.
1 See Status Code.
Template 0 -
Transfer status event for a Define Template
1 command. See Status Code.
Region 0 -
Transfer status event for a Define Region
1 command. See Status Code.
Graphic 0 -
Transfer status event for a Graphic Transfer Setup
1 command. See Status Code.
Status Code Indicates the status of the transferred command.
0 to 255 See section 4.9.1.

gsa-p0069.001.03 Released: 2008/01/22 Page 28


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

4.9.1 Status Codes


Code value 0x00 is not used.
Code range 0x01-0x20 is common to all transfer types.
Code range 0x21 – 0xFF is allocated to the individual transfer type.
Table 4.17 0xC6 Transfer Status - Status Codes (Sheet 1 of 2)

Type Code Description

Region 0x01 OK
0x02 Syntax Error
0x03 Incorrect Index
0x04 Out of Memory
0x05 Wrong ID Range
0x06 – Reserved
0x20
0x21 Region Overflow
0x22 Data Type Mismatch
0x23 Region Truncation Error
0x24 Undefined Font
0x25 Undefined Graphic
0x26 Undefined Barcode
0x27 Undefined Line
0x28 Undefined Box
0x29 Undefined Justification
0x2A Incorrect Multiplier Value
Template 0x01 OK
0x02 Syntax Error
0x03 Incorrect Index
0x04 Out of Memory
0x05 Wrong ID Range
0x06 – Reserved
0x20
0x21 Undefined Region ID

gsa-p0069.001.03 Released: 2008/01/22 Page 29


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

Table 4.17 0xC6 Transfer Status - Status Codes (Sheet 2 of 2)

Type Code Description

PrintData 0x01 OK
0x02 Syntax Error
0x03 Incorrect Index
0x04 Out of Memory
0x05 Wrong ID Range (not applicable in this transfer type)
0x06 – Reserved
0x20
0x21 Region Overflow
0x22 Data Type Mismatch
0x23 Too Many Fields of Interest
0x24 Already Defined Field of Interest
0x25 Number of Regions Does Not Match Template
Definition
0x26 Undefined Dynamic Graphics
0x27 Undefined Template
0x28 Unsupported Color Feature
Graphic 0x01 OK
0x02 Syntax Error
0x03 Incorrect Index
0x04 Out of Memory
0x05 Wrong ID Range
0x06 – Reserved
0x20
0x21 File Size Too Large
(This condition is sent in response to Graphic Transfer
Setup Report.)
0x22 Corrupted File
(Printer will clear transferred data.)
0x23 Unsupported Graphics

gsa-p0069.001.03 Released: 2008/01/22 Page 30


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer: Chapter 4:
Communication Protocol v1.0.3 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 42).
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.
Table 4.18 0xC8 Metrics Structure

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

Table 4.19 0xC8 Metrics Field Descriptions

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 Metrics data. See
32 to 255
page 42.

gsa-p0069.001.03 Released: 2008/01/22 Page 31


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

4.11 Report 0xCB Printer Status


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

4.11.1 Printer Status Rules


1. If the printer chassis opens while printing a ticket, the printer will continue printing until the
print job is completed.
2. If the print head opens while printing, the printer stops the print job. The device must self-
disable and report the event. The host must determine whether what has been printed
constitutes a redeemable ticket. The device remains disabled until enabled by the host. The
host should not attempt any further print jobs until the Print Head error is corrected.
3. If a paper jam occurs while printing, the printer stops the print job. The device must self-
disable and report the event. The host must determine whether what has been printed
constitutes a redeemable ticket. The device remains disabled until enabled by the host. The
host should not attempt any further print jobs until the Paper Jam error is corrected.
4. If a Paper Empty error occurs while printing, the printer completes the print job. The device
must self-disable and report the event. The device remains disabled until enabled by the host.
The host should not attempt any further print jobs until the Paper Empty error is corrected
and device is enabled.
5. 0xCB Printer Status will be resent to host upon receiving a 0x02 Enable (page 10), or 0xC3
Form Feed (page 16) command with any of the following conditions being present:
• Print Head open
• Paper Jam
• Paper Empty
6. The printer will ignore 0xC2 Print Ticket (page 15) command and report 0xCB Printer Status
if any of the following conditions are present:
• Print Head Open
• Paper Jam
• Paper Empty
• Top of Form
Table 4.20 0xCB Printer Status Structure

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

gsa-p0069.001.03 Released: 2008/01/22 Page 32


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

Table 4.21 0xCB Printer Status Field Descriptions

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.
Paper is jammed. This bit is cleared when jammed
1 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.03 Released: 2008/01/22 Page 33


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer: Chapter 5:
Communication Protocol v1.0.3 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 36 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.03 Released: 2008/01/22 Page 34


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

5.2 Report ID Allocation


All Values in Hexadecimal format.
Report IDs 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 initial rows of the report summary table (Table 5.1) list the high-level usage numbers identifying
all peripheral devices (92) and each of the peripheral device types.
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.

gsa-p0069.001.03 Released: 2008/01/22 Page 35


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

Table 5.1 Report Summary (Sheet 1 of 3)

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

- - - - 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 -
gsa-p0069.001.03 Released: 2008/01/22 Page 36
© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer: Chapter 5:
Communication Protocol v1.0.3 Number Allocation and Report Summary

Table 5.1 Report Summary (Sheet 2 of 3)

Host Device Report ID Usage Size


Command Event ( Hex ) Label ( Hex ) ( Bytes ) Comments
Define Region - 0xC0 - 0410 - -
- - - Index 0430 1 -
- - - Size 0431 1 -
- - - Data 0480 61 -
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 -
- - - Diagnostics 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 -
Print
- - - 0474 1 bit -
Incomplete
Transfer
- 0xC6 - 0416 - -
Status

gsa-p0069.001.03 Released: 2008/01/22 Page 37


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

Table 5.1 Report Summary (Sheet 3 of 3)

Host Device Report ID Usage Size


Command Event ( Hex ) Label ( Hex ) ( Bytes ) Comments
- - - Print 046A 1 bit -
- - - Template 046B 1 bit -
- - - Region 046C 1 bit -
- - - Graphic 046D 1 bit -
- - - Status Code 0434 1 -
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.03 Released: 2008/01/22 Page 38


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer: Chapter 6:
Communication Protocol v1.0.3 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
iInterface index of string descriptor
iSerialNumber index of string descriptor

Unicode is used for all strings, limiting strings to 126 characters:


int((255-2)/2) = 126

The two bytes subtracted in the above calculation (-2) are used as follows:
1 byte = string length, in bytes not characters
1 byte = USB DESCRIPTOR constant

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 (2 bytes).
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 a Unicode representation of the idVendor. This is assigned by each manufacturer
and kept consistent with regards to case and spelling.
For example:
GSA Member Company Name

gsa-p0069.001.03 Released: 2008/01/22 Page 39


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

6.4 iInterface
A string must be returned in this format:
<Protocol Level>,<Product Name>,<Firmware Issue>,<Build Version>,<Manufacturing
Date>
Unicode string made up of several comma-delimited sub-strings. Redundant, trailing commas may be
omitted. Leading and trailing spaces within sub-strings will be ignored.
For example:
1.1.1,ProductName,A,1.01,2004-01-01
Only the first three items are compulsory. At a minimum we could have...
1.1.1,ProductName, 1A2B3C, 1.01

6.4.1 Protocol Level - Major


Compulsory field, along with the Protocol Level - Minor field (see section 6.4.2) and Errata Number
(see section 6.4.3).
This field represents the first value in the GDS device protocol version, of the format X.y.z. 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) and Errata Number
(see section 6.4.3).
This field represents the second value in the GDS device protocol version, of the format X.y.z. 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 Protocol Level - Errata Number


Compulsory field, along with the Protocol Level - Major field (see section 6.4.1) and Protocol Level -
Minor field (see section 6.4.2).
This field represents the third value in the GDS device protocol version, of the format X.y.z. This
begins at 0 for the initial version of the protocol, and thereafter increments for future errata changes
of the protocol.

6.4.4 Product Name


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

6.4.5 Firmware Issue


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

gsa-p0069.001.03 Released: 2008/01/22 Page 40


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

6.4.6 Build Version


Compulsory field.
Any manufacturer-specific Unicode string, without commas.
A standard build could be indicated as STD or 1.01 for example.
Note that the combination <Firmware Issue>, <Build Version> MUST be unique per manufacturer
per product per firmware release.

6.4.7 Manufacturing Date


Optional field.
Conforming to the ISO 8601 standard: ccyy-mm-dd.
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 useful.

6.5 iSerialNumber
Compulsory field.
Serial numbers must be returned as a Unicode 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 Card Reader

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

gsa-p0069.001.03 Released: 2008/01/22 Page 41


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer: Chapter 7:
Communication Protocol v1.0.3 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:
Table 7.1 Metrics Report Data Structure

Child Element Printer Metric Page

PR Printer resolution page 43


PS Paper size page 43
GM Graphic memory size page 44
RCS International character support page 45
RPT Predefined template support page 45
RBS Barcode symbologies (standards) support page 45
FS Font support page 46
CS Color support page 48
GS Graphic support page 49
LS Line support page 49
OS Box support page 49

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

gsa-p0069.001.03 Released: 2008/01/22 Page 42


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer: Chapter 7:
Communication Protocol v1.0.3 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

Table 7.2 Report Printer Resolution Attribute

Attribute Value Description


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

7.2.3 Example

<PR r="0"/>

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.
Table 7.3 Report Paper Size Coordinates

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.

gsa-p0069.001.03 Released: 2008/01/22 Page 43


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

Table 7.3 Report Paper Size Coordinates

Attribute Value Description


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" />

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

Table 7.4 Report Free Graphic Memory Available

Attribute Value Description


s 0000 – 99999 Number of KB of memory available.

7.4.3 Example

<GM s="00128" />

gsa-p0069.001.03 Released: 2008/01/22 Page 44


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

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>

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>

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>

gsa-p0069.001.03 Released: 2008/01/22 Page 45


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

7.7.2 Barcode Symbology Indexes


Table of indexes to barcode symbologies:
Table 7.5 Report Barcode Support Indexes

Code Barcode Symbology Code Barcode Symbology

01 Interleaved 2 of 5 (ITF) Required 14 EAN-13 + 5


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

7.7.3 Example

<RBS> 01 02 </RBS>

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

Table 7.6 Fonts Supported 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.
gsa-p0069.001.03 Released: 2008/01/22 Page 46
© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer: Chapter 7:
Communication Protocol v1.0.3 Metrics Command Data Format

7.8.3 FS Attributes

Table 7.7 Fonts Supported Attribute Descriptions

Attribute Value Description


i Index of font. Required font support is listed in
(integer value) section 7.8.4.
s Size of font in points. One point is approximately
1/72 inch; a leading "+" character indicates
(decimal value)
scalable points, with the value indicating the
maximum font point size.
p (decimal value) Pitch, or characters per inch, of font.
u "y" or "n" Unicode support.

7.8.4 Required Font Support


At minimum, a GDS printer must support the following fonts:
Table 7.8 Required Font Support

Index Point Size Pitch Font Type

1 29.5 2.5 Bold Sans Serif


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

gsa-p0069.001.03 Released: 2008/01/22 Page 47


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

7.8.5 Example

<FS>
<F i="1" s="29.5" p="2.5" u="n" />
<F i="2" s="25.8" p="3.3" u="n" />
<F i="3" s="13.8" p="5.5" u="n" />
<F i="4" s="21.3" p="4.0" u="n" />
<F i="5" s="10.6" p="7.3" u="n" />
<F i="6" s="8.5" p="20.3" u="n" />
<F i="7" s="9.2" p="10.1" u="n" />
<F i="8" s="12.7" p="5.7" u="n" />
</FS>
<FS>
<F i="1" s="45.0" p="30.0" u="y" />
</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.
Table 7.9 Color Support Element

Element Value Description


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

7.9.3 CS Attribute

Table 7.10 Color Support Attribute Descriptions

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.03 Released: 2008/01/22 Page 48


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

7.10 GS: Graphic Support


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

7.10.1 Structure
The following is the structure of the GS element, where each idvalue is a three-digit ASCII identifier for
one predefined graphic.

<GS> idvalue1 idvalue2 … idvaluen </GS>

7.10.2 Example

<GS> 001 002 003 004 005 006 007 008 </GS>

7.11 LS: Line Support


The printer uses the LS element to indicate the predefined GDS line properties that it supports.
Each GDS predefined line property is identified by a three-digit ASCII number in the range of 000 –
099.
ONLY the predefined line properties reported are supported by the printer.

7.11.1 Structure
The following is the structure of the LS element, where each idvalue is a three-digit ASCII identifier for
one predefined line property.

<LS> idvalue1 idvalue2 … idvaluen </LS>

7.11.2 Example

<LS> 001 </LS>

7.12 OS: Box Support


The printer uses the OS element to indicate the predefined GDS box properties that it supports.
Each GDS predefined box property is identified by a three-digit ASCII number in the range of 000 –
099.
ONLY the predefined box properties reported are supported by the printer.

gsa-p0069.001.03 Released: 2008/01/22 Page 49


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

7.12.1 Structure
The following is the structure of the OS element, where each idvalue is a three-digit ASCII identifier for
one predefined graphic.

<OS> idvalue1 idvalue2 … idvaluen </OS>

7.12.2 Example

<OS> 001 </OS>

7.13 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="1"/>

// 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 template supported


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

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

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

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

//Graphic supported.
<GS> 001 002 003 004 005 006 007 008 </GS>

//Line supported
<LS> 001 </LS>

//Box supported
<OS> 001 </OS>

</Metrics>

gsa-p0069.001.03 Released: 2008/01/22 Page 50


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer:
Communication Protocol v1.0.3 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.03 Released: 2008/01/22 Page 51


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer:
Communication Protocol v1.0.3 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

gsa-p0069.001.03 Released: 2008/01/22 Page 52


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

XRL A,R5 ; XOR with next byte from CRC


XCH A,R4 ; becomes new low CRC, get pointer back
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

gsa-p0069.001.03 Released: 2008/01/22 Page 53


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

db 093h,0a3h,0f2h,0c2h,057h,067h,036h,006h
db 01bh,02bh,07ah,04ah,0dfh,0efh,0beh,08eh
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

gsa-p0069.001.03 Released: 2008/01/22 Page 54


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

db 095h,0e2h,07bh,00ch,092h,0e5h,07ch,00bh
db 086h,0f1h,068h,01fh,081h,0f6h,06fh,018h
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:

gsa-p0069.001.03 Released: 2008/01/22 Page 55


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

MOV R4,A ; replace final CRC byte

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_tablelabeldword
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

gsa-p0069.001.03 Released: 2008/01/22 Page 56


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

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
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

gsa-p0069.001.03 Released: 2008/01/22 Page 57


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

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
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

gsa-p0069.001.03 Released: 2008/01/22 Page 58


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

0aed16a4ah,0d9d65adch,040df0b66h,037d83bf0h,0a9bcae53h,0debb9ec5h,047b2cf7fh,030b
5ffe9h
dd
0bdbdf21ch,0cabac28ah,053b39330h,024b4a3a6h,0bad03605h,0cdd70693h,054de5729h,023d
967bfh
dd
0b3667a2eh,0c4614ab8h,05d681b02h,02a6f2b94h,0b40bbe37h,0c30c8ea1h,05a05df1bh,02d0
2ef8dh
; ============================================================= ;
; 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

calc_CRC proc
push ebx

gsa-p0069.001.03 Released: 2008/01/22 Page 59


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

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
...

A.2 C Language Example


/***********************************************************/

gsa-p0069.001.03 Released: 2008/01/22 Page 60


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

/* 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,0x9e
6495a3
0x0edb8832,0x79dcb8a4,0xe0d5e91e,0x97d2d988,0x09b64c2b,0x7eb17cbd,0xe7b82d07,0x90
bf1d91
0x1db71064,0x6ab020f2,0xf3b97148,0x84be41de,0x1adad47d,0x6ddde4eb,0xf4d4b551,0x83
d385c7
0x136c9856,0x646ba8c0,0xfd62f97a,0x8a65c9ec,0x14015c4f,0x63066cd9,0xfa0f3d63,0x8d
080df5
0x3b6e20c8,0x4c69105e,0xd56041e4,0xa2677172,0x3c03e4d1,0x4b04d447,0xd20d85fd,0xa5
0ab56b
0x35b5a8fa,0x42b2986c,0xdbbbc9d6,0xacbcf940,0x32d86ce3,0x45df5c75,0xdcd60dcf,0xab
d13d59
0x26d930ac,0x51de003a,0xc8d75180,0xbfd06116,0x21b4f4b5,0x56b3c423,0xcfba9599,0xb8
bda50f
0x2802b89e,0x5f058808,0xc60cd9b2,0xb10be924,0x2f6f7c87,0x58684c11,0xc1611dab,0xb6
662d3d
0x76dc4190,0x01db7106,0x98d220bc,0xefd5102a,0x71b18589,0x06b6b51f,0x9fbfe4a5,0xe8
b8d433
0x7807c9a2,0x0f00f934,0x9609a88e,0xe10e9818,0x7f6a0dbb,0x086d3d2d,0x91646c97,0xe6
635c01
0x6b6b51f4,0x1c6c6162,0x856530d8,0xf262004e,0x6c0695ed,0x1b01a57b,0x8208f4c1,0xf5
0fc457
0x65b0d9c6,0x12b7e950,0x8bbeb8ea,0xfcb9887c,0x62dd1ddf,0x15da2d49,0x8cd37cf3,0xfb
d44c65
0x4db26158,0x3ab551ce,0xa3bc0074,0xd4bb30e2,0x4adfa541,0x3dd895d7,0xa4d1c46d,0xd3
d6f4fb
0x4369e96a,0x346ed9fc,0xad678846,0xda60b8d0,0x44042d73,0x33031de5,0xaa0a4c5f,0xdd
0d7cc9
0x5005713c,0x270241aa,0xbe0b1010,0xc90c2086,0x5768b525,0x206f85b3,0xb966d409,0xce
61e49f
0x5edef90e,0x29d9c998,0xb0d09822,0xc7d7a8b4,0x59b33d17,0x2eb40d81,0xb7bd5c3b,0xc0
ba6cad
0xedb88320,0x9abfb3b6,0x03b6e20c,0x74b1d29a,0xead54739,0x9dd277af,0x04db2615,0x73
dc1683
0xe3630b12,0x94643b84,0x0d6d6a3e,0x7a6a5aa8,0xe40ecf0b,0x9309ff9d,0x0a00ae27,0x7d
079eb1
0xf00f9344,0x8708a3d2,0x1e01f268,0x6906c2fe,0xf762575d,0x806567cb,0x196c3671,0x6e
6b06e7
0xfed41b76,0x89d32be0,0x10da7a5a,0x67dd4acc,0xf9b9df6f,0x8ebeeff9,0x17b7be43,0x60
b08ed5
0xd6d6a3e8,0xa1d1937e,0x38d8c2c4,0x4fdff252,0xd1bb67f1,0xa6bc5767,0x3fb506dd,0x48
b2364b

gsa-p0069.001.03 Released: 2008/01/22 Page 61


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

0xd80d2bda,0xaf0a1b4c,0x36034af6,0x41047a60,0xdf60efc3,0xa867df55,0x316e8eef,0x46
69be79
0xcb61b38c,0xbc66831a,0x256fd2a0,0x5268e236,0xcc0c7795,0xbb0b4703,0x220216b9,0x55
05262f
0xc5ba3bbe,0xb2bd0b28,0x2bb45a92,0x5cb36a04,0xc2d7ffa7,0xb5d0cf31,0x2cd99e8b,0x5b
deae1d
0x9b64c2b0,0xec63f226,0x756aa39c,0x026d930a,0x9c0906a9,0xeb0e363f,0x72076785,0x05
005713
0x95bf4a82,0xe2b87a14,0x7bb12bae,0x0cb61b38,0x92d28e9b,0xe5d5be0d,0x7cdcefb7,0x0b
dbdf21
0x86d3d2d4,0xf1d4e242,0x68ddb3f8,0x1fda836e,0x81be16cd,0xf6b9265b,0x6fb077e1,0x18
b74777
0x88085ae6,0xff0f6a70,0x66063bca,0x11010b5c,0x8f659eff,0xf862ae69,0x616bffd3,0x16
6ccf45
0xa00ae278,0xd70dd2ee,0x4e048354,0x3903b3c2,0xa7672661,0xd06016f7,0x4969474d,0x3e
6e77db
0xaed16a4a,0xd9d65adc,0x40df0b66,0x37d83bf0,0xa9bcae53,0xdebb9ec5,0x47b2cf7f,0x30
b5ffe9
0xbdbdf21c,0xcabac28a,0x53b39330,0x24b4a3a6,0xbad03605,0xcdd70693,0x54de5729,0x23
d967bf
0xb3667a2e,0xc4614ab8,0x5d681b02,0x2a6f2b94,0xb40bbe37,0xc30c8ea1,0x5a05df1b,0x2d
02ef8d
};

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

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.03 Released: 2008/01/22 Page 62


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer:
Communication Protocol v1.0.3 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.

const unsigned char HIDReportDescriptor[] = {


0x05, 0x92, // UsagePage(Reserved)
0x09, 0x14, // Usage(Printer)
0xA1, 0x01, // Collection(Application)
0x15, 0x00, // LogicalMin(0)
0x26, 0xFF, 0x00, // LogicalMax(255)
0x75, 0x08, // ReportSize(8)

0x85, 0xC0, // ReportID(0xC0)


0x0A, 0x10, 0x04, // Usage(DefineRegion, 0x0410)
0xA1, 0x03, // Collection(Report)
0x0A, 0x30, 0x04, // Usage(Index, 0x0430)
0x0A, 0x31, 0x04, // Usage(Size, 0x0431)
0x95, 0x02, // ReportCount(2)
0xB1, 0x02, // Feature(Data, Variable, Absolute)
0x0A, 0x80, 0x04, // Usage(Data, 0x0480)
0x95, 0x3D, // ReportCount(61)
0xB1, 0x02, // Feature(Data, Variable, Absolute)
0xC0, // EndCollection

0x85, 0xC1, // ReportID(0xC1)


0x0A, 0x11, 0x04, // Usage(DefineTemplate, 0x0411)
0xA1, 0x03, // Collection(Report)
0x0A, 0x30, 0x04, // Usage(Index, 0x0430)
0x0A, 0x31, 0x04, // Usage(Size, 0x0431)
0x95, 0x02, // ReportCount(2)
0xB1, 0x02, // Feature(Data, Variable, Absolute)
0x0A, 0x80, 0x04, // Usage(Data, 0x0480)
0x95, 0x3D, // ReportCount(61)
0xB1, 0x02, // Feature(Data, Variable, Absolute)
0xC0, // EndCollection

0x85, 0xC2, // ReportID(0xC2)


0x0A, 0x12, 0x04, // Usage(PrintTicket, 0x0412)
0xA1, 0x03, // Collection(Report)
0x0A, 0x30, 0x04, // Usage(Index, 0x0430)
0x0A, 0x31, 0x04, // Usage(Size, 0x0431)
0x95, 0x02, // ReportCount(2)
0xB1, 0x02, // Feature(Data, Variable, Absolute)
0x0A, 0x80, 0x04, // Usage(Data, 0x0480)

gsa-p0069.001.03 Released: 2008/01/22 Page 63


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

0x95, 0x3D, // ReportCount(61)


0xB1, 0x02, // Feature(Data, Variable, Absolute)
0xC0, // EndCollection

0x85, 0xC8, // ReportID(0xC8)


0x0A, 0x18, 0x04, // Usage(Metrics, 0x0418)
0xA1, 0x03, // Collection(Report)
0x0A, 0x30, 0x04, // Usage(Index, 0x0430)
0x0A, 0x31, 0x04, // Usage(Size, 0x0431)
0x95, 0x02, // ReportCount(2)
0x81, 0x02, // Input(Data, Variable, Absolute)
0x0A, 0x80, 0x04, // Usage(Data, 0x0480)
0x95, 0x3D, // ReportCount(61)
0x81, 0x02, // Input(Data, Variable, Absolute)
0xC0, // EndCollection

0x85, 0xC4, // ReportID(0xC4)


0x0A, 0x14, 0x04, // Usage(FailureStatus, 0x0414)
0xA1, 0x03, // Collection(Report)
0x75, 0x01, // ReportSize(1)
0x25, 0x01, // LogicalMax(1)
0x0A, 0x60, 0x04, // Usage(Firmware, 0x0460)
0x0A, 0x61, 0x04, // Usage(NVM, 0x0461)
0x0A, 0x62, 0x04, // Usage(PrintHeadDamage, 0x0462)
0x0A, 0x63, 0x04, // Usage(TempError, 0x0463)
0x95, 0x04, // ReportCount(4)
0x81, 0x02, // Input(Data, Variable, Absolute)
0x95, 0x03, // ReportCount(3)
0x81, 0x01, // Input(Const)
0x0A, 0x64, 0x04, // Usage(Other, 0x0464)
0x95, 0x01, // ReportCount(1)
0x81, 0x02, // Input(Data, Variable, Absolute)
0x75, 0x08, // ReportSize(8)
0x26, 0xFF, 0x00, // LogicalMax(255)
0x0A, 0x32, 0x04, // Usage(Diagnostic, 0x0432)
0x95, 0x01, // ReportCount(1)
0x81, 0x02, // Input(Data, Variable, Absolute)
0xC0, // EndCollection

0x85, 0xC5, // ReportID(0xC5)


0x0A, 0x15, 0x04, // Usage(PrintStatus, 0x0415)
0xA1, 0x03, // Collection(Report)
0x0A, 0x33, 0x04, // Usage(TransactionID, 0x0433)
0x26, 0xFF, 0x00, // LogicalMax(255)
0x75, 0x08, // ReportSize(8)
0x95, 0x01, // ReportCount(1)
0x81, 0x02, // Input(Data, Variable, Absolute)
0x0A, 0x65, 0x04, // Usage(PrintInProgress, 0x0465)
0x0A, 0x66, 0x04, // Usage(F1, 0x0466)
0x0A, 0x67, 0x04, // Usage(F2, 0x0467)
0x0A, 0x68, 0x04, // Usage(F3, 0x0468)
0x0A, 0x69, 0x04, // Usage(PrintComplete, 0x0469)

gsa-p0069.001.03 Released: 2008/01/22 Page 64


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

0x0A, 0x74, 0x04, // Usage(PrintInomplete, 0x0474)


0x25, 0x01, // LogicalMax(1)
0x75, 0x01, // ReportSize(1)
0x95, 0x06, // ReportCount(6)
0x81, 0x02, // Input(Data, Variable, Absolute)
0x95, 0x02, // ReportCount(2)
0x81, 0x01, // Input(Const)
0xC0, // EndCollection

0x85, 0xC6, // ReportID(0xC6)


0x0A, 0x16, 0x04, // Usage(TransferStatus, 0x0416)
0xA1, 0x03, // Collection(Report)
0x0A, 0x6A, 0x04, // Usage(Print, 0x046A)
0x0A, 0x6B, 0x04, // Usage(Template, 0x046B)
0x0A, 0x6C, 0x04, // Usage(Region, 0x046C)
0x0A, 0x6D, 0x04, // Usage(Graphic, 0x046D)
0x25, 0x01, // LogicalMax(1)
0x75, 0x01, // ReportSize(1)
0x95, 0x04, // ReportCount(4)
0x81, 0x02, // Input(Data, Variable, Absolute)
0x81, 0x01, // Input(Const)
0x0A, 0x34, 0x04, // Usage(StatusCode, 0x0434)
0x26, 0xFF, 0x00, // LogicalMax(255)
0x75, 0x08, // ReportSize(8)
0x95, 0x01, // ReportCount(1)
0x81, 0x02, // Input(Data, Variable, Absolute)
0xC0, // EndCollection

0x85, 0xC9, // ReportID(0xC9)


0x0A, 0x19, 0x04, // Usage(GraphicTransferSetup, 0x0419)
0xA1, 0x03, // Collection(Report)
0x0A, 0x35, 0x04, // Usage(Type, 0x0435)
0x0A, 0x30, 0x04, // Usage(Index, 0x0430)
0x95, 0x02, // ReportCount(2)
0xB1, 0x02, // Feature(Data, Variable, Absolute)
0x0A, 0x36, 0x04, // Usage(Data, 0x0436)
0x26, 0xFF, 0xFF, // LogicalMax(65535)
0x75, 0x10, // ReportSize(16)
0x95, 0x01, // ReportCount(1)
0xB1, 0x02, // Feature(Data, Variable, Absolute)
0xC0, // EndCollection

0x85, 0xCA, // ReportID(0xCA)


0x0A, 0x1A, 0x04, // Usage(FileTransfer, 0x041A)
0xA1, 0x03, // Collection(Report)
0x0A, 0x37, 0x04, // Usage(Index, 0x0437)
0xB1, 0x02, // Feature(Data, Variable, Absolute)
0x0A, 0x31, 0x04, // Usage(Size, 0x0431)
0x26, 0xFF, 0x00, // LogicalMax(255)
0x75, 0x08, // ReportSize(8)
0x95, 0x01, // ReportCount(1)
0xB1, 0x02, // Feature(Data, Variable, Absolute)

gsa-p0069.001.03 Released: 2008/01/22 Page 65


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

0x0A, 0x81, 0x04, // Usage(Data, 0x0481)


0x95, 0x3C, // ReportCount(60)
0xB1, 0x02, // Feature(Data, Variable, Absolute)
0xC0, // EndCollection

0x85, 0xCB, // ReportID(0xCB)


0x0A, 0x1B, 0x04, // Usage(PrinterStatus, 0x041B)
0xA1, 0x03, // Collection(Report)
0x0A, 0x33, 0x04, // Usage(TransactionID, 0x0433)
0x95, 0x01, // ReportCount(1)
0x81, 0x02, // Input(Data, Variable, Absolute)
0x0A, 0x6E, 0x04, // Usage(Chassis, 0x046E)
0x0A, 0x6F, 0x04, // Usage(PrintHead, 0x046F)
0x0A, 0x70, 0x04, // Usage(TopOfForm, 0x0470)
0x0A, 0x71, 0x04, // Usage(PaperJam, 0x0471)
0x0A, 0x72, 0x04, // Usage(PaperLow, 0x0472)
0x0A, 0x73, 0x04, // Usage(PaperEmpty, 0x0473)
0x25, 0x01, // LogicalMax(1)
0x75, 0x01, // ReportSize(1)
0x95, 0x06, // ReportCount(6)
0x81, 0x02, // Input(Data, Variable, Absolute)
0x95, 0x02, // ReportCount(2)
0x81, 0x01, // Input(Const)
0xC0, // EndCollection

0x85, 0x01, // ReportID(0x01)


0x09, 0x40, // Usage(Acknowledge)
0xA1, 0x03, // Collection(Report)
0x95, 0x01, // ReportCount(1)
0x09, 0x90, // Usage(Resync, 0x90)
0xB1, 0x02, // Feature(Data, Variable, Absolute)
0x95, 0x07, // ReportCount(7)
0xB1, 0x01, // Feature(Const)
0x26, 0xFF, 0x00, // LogicalMax(255)
0x75, 0x08, // ReportSize(8)
0x09, 0x60, // Usage(TransID, 0x60)
0x95, 0x01, // ReportCount(1)
0xB1, 0x02, // Feature(Data, Variable, Absolute)
0xC0, // EndCollection

0x85, 0xC3, // ReportID(0xC3)


0x0A, 0x13, 0x04, // Usage(Enable, 0x0413)
0xB1, 0x01, // Feature(Constant)
0x85, 0xC7, // ReportID(0xC7)
0x0A, 0x17, 0x04, // Usage(Enable, 0x0417)
0xB1, 0x01, // Feature(Constant)
0x85, 0x02, // ReportID(0x02)
0x09, 0x41, // Usage(Enable, 0x41)
0xB1, 0x01, // Feature(Constant)
0x85, 0x03, // ReportID(0x03)
0x09, 0x42, // Usage(Disable, 0x42)
0xB1, 0x01, // Feature(Constant)

gsa-p0069.001.03 Released: 2008/01/22 Page 66


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

0x09, 0x44, // Usage(ReqGATReport, 0x44)


0x85, 0x05, // ReportID(0x05)
0xB1, 0x01, // Feature(Constant)
0x85, 0x04, // ReportID(0x04)
0x09, 0x43, // Usage(SelfTest, 0x43)
0xA1, 0x03, // Collection(Report)
0x25, 0x01, // LogicalMax(1)
0x75, 0x01, // ReportSize(1)
0x09, 0x93, // Usage(NVM, 0x93)
0x95, 0x01, // ReportCount(1)
0xB1, 0x02, // Feature(Data, Variable, Absolute)
0x95, 0x07, // ReportCount(7)
0xB1, 0x01, // Feature(Const)
0xC0, // EndCollection

0x85, 0x06, // ReportID(0x06)


0x09, 0x45, // Usage(PowerStatus)
0xA1, 0x03, // Collection(Report)
0x09, 0x91, // Usage(Ext.Power, 0x91)
0x09, 0x92, // Usage(NeedReset, 0x92)
0x95, 0x02, // ReportCount(2)
0x81, 0x02, // Input(Data, Variable, Absolute)
0x95, 0x06, // ReportCount(6)
0x81, 0x01, // Input(Const)
0xC0, // EndCollection

0x85, 0x07, // ReportID(0x07)


0x09, 0x46, // Usage(GATData)
0xA1, 0x03, // Collection(Report)
0x26, 0xFF, 0x00, // LogicalMax(255)
0x75, 0x08, // ReportSize(8)
0x09, 0x61, // Usage(Index, 0x61)
0x09, 0x62, // Usage(Size, 0x62)
0x95, 0x02, // ReportCount(2)
0x81, 0x02, // Input(Data, Variable, Absolute)
0x95, 0x3D, // ReportCount(61)
0x09, 0xB0, // Usage(Data, 0xB0)
0x81, 0x02, // Input(Data, Variable, Absolute)
0xC0, // EndCollection

0x85, 0x08, // ReportID(0x08)


0x09, 0x47, // Usage(CalcCRC)
0xA1, 0x03, // Collection(Report)
0x09, 0x63, // Usage(Seed, 0x63)
0x95, 0x04, // ReportCount(4)
0xB1, 0x02, // Feature(Data, Variable, Absolute)
0xC0, // EndCollection

0x85, 0x09, // ReportID(0x09)


0x09, 0x48, // Usage(CRCData)
0xA1, 0x03, // Collection(Report)
0x09, 0x64, // Usage(CRCResult, 0x64)

gsa-p0069.001.03 Released: 2008/01/22 Page 67


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

0x81, 0x02, // Input(Data, Variable, Absolute)


0xC0, // EndCollection

0x85, 0x0A, // ReportID(0x0A)


0x09, 0x49, // Usage(DeviceStatus, 0x49)
0x25, 0x01, // LogicalMax(1)
0x75, 0x01, // ReportSize(1)
0xA1, 0x03, // Collection(Report)
0x09, 0x94, // Usage(Enable, 0x94)
0x09, 0x95, // Usage(Disable, 0x95)
0x95, 0x02, // ReportCount(2)
0x81, 0x02, // Input(Data, Variable, Absolute)
0x95, 0x06, // ReportCount(6)
0x81, 0x01, // Input(Const)
0xC0, // EndCollection

0xC0, // EndCollection
};

const unsigned char USBDeviceDescriptor[] = {


0x12, /* Descriptor length */
0x01, /* DEVICE descriptor */
0x11, 0x01, /* bcdUSB */
0x00, /* bDeviceClass */
0x00, /* bDeviceSubClass */
0x00, /* bDeviceProtocol */
0x10, /* bMaxPacketSize0 */
0xF5, 0x16, /* vendor ID */
0x03, 0x02, /* product ID */
0x01, 0x00, /* device release number */
0x01, /* String 1 is manufacturer */
0x02, /* String 2 is product */
0x03, /* String 3 is serial number*/
0x01 /* bNumConfigurations */
};

const unsigned char HIDConfgDescriptor[] = {


/************************************************
* Configuration descriptor *
************************************************/
0x09, /* bLength */
0x02, /* bDescriptorType */
0x34, 0x00, /* wTotalLength */
0x02, /* bNumInterfaces */
0x01, /* bConfigurationValue -- this Config.# */
0x04, /* iConfiguration -- Config. String index */
0x40, /* bmAttributes */
0x01, /* MaxPower - 2 mA */

/************************************************
* Interface descriptors *
************************************************/

gsa-p0069.001.03 Released: 2008/01/22 Page 68


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

0x09, /* bLength */
0x04, /* bDescriptorType */
0x00, /* bInterfaceNumber */
0x00, /* bAlternateSetting */
0x01, /* bNumEndpoints */
0x03, /* bInterfaceClass -- HID */
0x00, /* bInterfaceSubClass */
0x00, /* bInterfaceProtocol */
0x05, /* iInterface -- HID String index */

/************************************************
* HID Class Descriptor *
************************************************/
0x09, /* bLength */
0x21, /* bDescriptorType -- HID */
0x11, 0x01, /* bcdHID -- HID class release number */
0x00, /* bCountryCode */
0x01, /* bNumDescriptor */
0x22, /* bDescriptorType -- */
(unsigned char)(sizeof(HIDReportDescriptor) % 0x100), /* bInterfaceProtocol(LSB) */
(unsigned char)(sizeof(HIDReportDescriptor) / 0x100), /* bInterfaceProtocol(MSB) */

/************************************************
* HID Endpoint descriptor *
************************************************/
0x07, /* bLength */
0x05, /* bDescriptorType -- Endpoint */
0x80+1, /* Endpoint number -- Input, EPx */
0x03, /* endpoint attribute - Interrupt */
(unsigned char)(0x40 % 0x100), /* maximum packet size(LSB) */
(unsigned char)(0x40 / 0x100), /* maximum packet size(MSB) */
0x32, /* polling interval at every 50 ms */

/************************************************
* Run-time DFU Interface Descriptor *
************************************************/
0x09, /* bLength */
0x04, /* bDescriptorType */
0x01, /* bInterfaceNumber */
0x00, /* bAlternateSetting */
0x00, /* bNumEndpoints */
0xFE, /* bInterfaceClass */
0x01, /* bInterfaceSubClass -- printers */
0x01, /* bInterfaceProtocol */
0x06, /* iInterface */

/************************************************
* Run-time DFU Functional Descriptor *
************************************************/
0x09, /* bLength */
0x21, /* bDescriptorType */
8+1, /* bmAttributes -

gsa-p0069.001.03 Released: 2008/01/22 Page 69


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

8=Reset,4=Manifest,2=Upload,1=Download */
0xE8, 0x03, /* wDetachTimeOut - 1sec */
0x10, 0x00, /* wTransferSize */
0x00, 0x01, /* bcdDFUVersion */
};

const unsigned short USBStrLang[] = { /* String 0 -- Language */


0x0304, /* bLength + string bDescriptorType */
0x0409 /* wLANGID[0]->US English */
};

const unsigned short USBStrMfr[] = { /* String 1 -- Manufacturer */


0x031E, /* bLength + string bDescriptorType */
'X','X','X','X','X','X','X','X','X','X','X','X','X','X'
};

const unsigned short USBStrProd[] = { /* String 2 -- Product */


0x0328, /* bLength + string bDescriptorType */
'X','X',' ','X','X','X','X',' ','X','X','X',' ','X','X','X','X','X','X','X'
};

/* String 3 -- serial number, put hardware board revision */


unsigned short USBStrSerl[(22+1)*sizeof(short)] = {
0x0322, /* bLength + string bDescriptorType */
'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'
};

const unsigned short USBStrConfig[] = { /* String 4 -- Configuration */


0x0320, /* bLength + string bDescriptorType */
'X','X',' ','X','X','X','X',' ','X','X','X','X','X','X','X'
};

const unsigned short USBStrHIDClass[] = { /* String 5 -- HID Class string */


0x034E, /* bLength + string bDescriptorType */
'X','.','X','.','X',',','X','X',' ','X','X','X','X',' ','H','I','D','
','P','R','I','N','T','E','R',
',',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '
};

const unsigned short USBStrDFUFunct[] = { /* String 6 -- Firmware Upgrade interface


*/
0x0318, /* bLength + string bDescriptorType */
'X','X','X','-','D','F','U',' ','X','.','X'
};

gsa-p0069.001.03 Released: 2008/01/22 Page 70


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer:
Communication Protocol v1.0.3 Index

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

gsa-p0069.001.03 Released: 2008/01/22 Page 71


© 2005 - 2008 Gaming Standards Association (GSA)
GDS® Printer:
Communication Protocol v1.0.3 Index

H summary list .............................................. 35


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

R
Region, 0xC6 Transfer Status ........................... 28
regions, define ................................................... 13
report ID
allocation ................................................... 35

gsa-p0069.001.03 Released: 2008/01/22 Page 72


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

gsa-p0069.001.03
Released: 2008/01/22

Page 73
© 2005 - 2008 Gaming Standards Association (GSA)