ccTalk protocol implementation in modern C++ / Qt.
ccTalk is a serial protocol for communication with bill validators and coin acceptors. The protocol is in widespread use throughout the money transaction and point-of-sale industry.
Implementation is finished, but untested (I no longer have access to ccTalk devices).
This project is up for adoption!
This project provides:
- High-level, type-safe C++ API for ccTalk commands.
- ccTalk device management (including serial port device management).
- Controller and worker thread management for non-blocking communication with multiple ccTalk devices.
- A test GUI application for testing ccTalk devices, inspecting sent / received commands, and providing a source code example for ccTalk library usage.
The code is thoroughly annotated using doxygen-style comments. Below is an overview of main components of the project:
An instance of this class lives in a worker thread and is managed by qtcc::CctalkLinkController
controller.
Its main responsibility is to open / close a serial port device, send ccTalk request binary data
(as received by the controller object) to the device and pass the binary response back to the controller.
This class creates and manages a worker thread with a qtcc::SerialWorker
object in it.
In user thread, it can be used to manage the serial port device, send binary requests,
and receive binary responses from a qtcc::SerialWorker
instance, which lives in a worker thread.
This class provides a type-safe, high-level ccTalk command API, translating the high-level API to
low-level binary ccTalk commands. An object of this class owns a
qtcc::CctalkLinkController
instance and uses it for communication with ccTalk devices.
These classes simply inherit qtcc::CctalkDevice
to help you specify different behavior
for bill validators and coin acceptors in a type-safe way.
The test_gui
directory contains a GUI application to showcase the ccTalk API and its usage in a user application.
It can also serve as an API debugger and device tester, displaying all the sent and received commands
in a log window.
These functions show how to set up and use bill validator and/or coin acceptor devices within an application.
The GUI uses .ini file for ccTalk device configuration. On Linux the file is located at
~/.config/Qt-ccTalk/Qt-ccTalk GUI.ini
.
The function setUpCctalkDevices()
lists the supported configuration keys.
An example configuration file may look like this:
[bill_validator]
serial_device_name="/dev/ttyUSB0"
[cctalk]
show_full_response=true
Copyright: Alexander Shaduri ashaduri@gmail.com
License: 3-Clause BSD License