RelianceCore
1.4.0
Reliance Thermal Printer API
|
Required header for integration into your project. More...
Data Structures | |
class | RelianceHID |
Primary interface for interacting with Reliance Thermal Printer. More... | |
struct | RelianceHID::Revision |
Describes a firmware revision levels using semver syntax. More... | |
struct | RelianceHID::Result |
Describes response from all RelianceHID printer commands. More... | |
struct | RelianceHID::RelianceStatus |
Status response from Reliance printer. More... | |
Typedefs | |
using | RelianceHID::ArgList = std::vector< std::string > |
List of string arguments. More... | |
Enumerations |
Functions | |
bool | RelianceHID::RelianceStatus::hasSensorFlag (SensorStatus flag) |
Helper function to check if specified flag is set. More... | |
bool | RelianceHID::RelianceStatus::hasErrorFlag (ErrorStatus flag) |
Helper function to check if specified flag is set. More... | |
bool | RelianceHID::RelianceStatus::hasSensorFlag (SensorStatus flag) const |
Const function method to check if specified flag is set. More... | |
bool | RelianceHID::RelianceStatus::hasErrorFlag (ErrorStatus flag) const |
Const function method to check if specified flag is set. More... | |
bool | RelianceHID::RelianceStatus::isPaperLow () |
Helper function returns true if status report indicates paper low. More... | |
bool | RelianceHID::RelianceStatus::isPaperOut () |
Helper function returns true if status report indicates paper is out. More... | |
static float | RelianceHID::RelianceStatus::adc2Voltage (uint16_t adc) |
Returns the voltage given a raw ADC reading. This assumes a 12-bit ADC. More... | |
RELIANCECORE_EXPORT Result | RelianceHID::initialize () |
Attempt to connect to device. More... | |
RELIANCECORE_EXPORT Result | RelianceHID::getRevision (Revision *rev) |
Read firmware revision from target. More... | |
RELIANCECORE_EXPORT Result | RelianceHID::ping () |
Side effect free command to test for presence of printer. More... | |
RELIANCECORE_EXPORT Result | RelianceHID::reboot () |
Immediately perform a hard reboot of the printer. More... | |
RELIANCECORE_EXPORT Result | RelianceHID::getStatus (RelianceStatus *status) |
Get the current status of Reliance printer. More... | |
RELIANCECORE_EXPORT Result | RelianceHID::getVirtualCommsEnabled () |
Gets the state of the USB virtual comm port feature. More... | |
RELIANCECORE_EXPORT Result | RelianceHID::setVirtualCommsEnabled (bool enabled) |
Enable or disable the USB virtual comm port feature. More... | |
RELIANCECORE_EXPORT Result | RelianceHID::getStartupTicketEnabled () |
Gets the state of the startup ticket feature. More... | |
RELIANCECORE_EXPORT Result | RelianceHID::setStartupTicketEnabled (bool enabled) |
Sets the state of the startup ticket feature. More... | |
RELIANCECORE_EXPORT Result | RelianceHID::getUnknownCommands (std::vector< int > &dst) |
Returns a list of ESC/POS commands the Reliance does not understand. More... | |
RELIANCECORE_EXPORT Result | RelianceHID::getPaperWidth () |
Returns the current configured paper roll width. More... | |
RELIANCECORE_EXPORT Result | RelianceHID::setPaperWidth (int width) |
Change the paper roll width configuration. More... | |
RELIANCECORE_EXPORT Result | RelianceHID::getMotorGen () |
Returns the current motor configuration. More... | |
RELIANCECORE_EXPORT Result | RelianceHID::setMotorGen (int gen) |
Change the motor configuration to another gen. More... | |
RELIANCECORE_EXPORT Result | RelianceHID::getMotorCurrent () |
Returns the current motor current in milliamps. More... | |
RELIANCECORE_EXPORT Result | RelianceHID::setMotorCurrent (int current) |
Change the motor current. More... | |
Required header for integration into your project.
using RelianceHID::ArgList = std::vector<std::string> |
List of string arguments.
|
strong |
Bit enumberation describes each error state that can be reported by Reliance.
|
strong |
|
strong |
Bit enumeration describes the state of each sensor.
|
strong |
|
static |
Returns the voltage given a raw ADC reading. This assumes a 12-bit ADC.
RELIANCECORE_EXPORT Result RelianceHID::getMotorCurrent | ( | ) |
Returns the current motor current in milliamps.
This is the current that is applied to printer motor.
RELIANCECORE_EXPORT Result RelianceHID::getMotorGen | ( | ) |
Returns the current motor configuration.
There are currently two motors, gen1 and gen2. The returned result will populate the value field with 0, 1, etc. which represent these motor gens.
RELIANCECORE_EXPORT Result RelianceHID::getPaperWidth | ( | ) |
Returns the current configured paper roll width.
Reliance supports paper rolls width from 58mm though 80mm. This setting enables proper print margins for your chosen roll width.
RELIANCECORE_EXPORT Result RelianceHID::getRevision | ( | Revision * | rev | ) |
Read firmware revision from target.
rev | out parameter |
RELIANCECORE_EXPORT Result RelianceHID::getStartupTicketEnabled | ( | ) |
Gets the state of the startup ticket feature.
When enabled, Reliance will print its configuration to a ticket on every power up. When disabled, this behavior is disabled.
RELIANCECORE_EXPORT Result RelianceHID::getStatus | ( | RelianceStatus * | status | ) |
Get the current status of Reliance printer.
status | will be written with current status |
RELIANCECORE_EXPORT Result RelianceHID::getUnknownCommands | ( | std::vector< int > & | dst | ) |
Returns a list of ESC/POS commands the Reliance does not understand.
The list will be written to dst in the order cmd:arg where cmd is a known ESC/POS prefix such as ESC, FS, or GS (1B, 1C, 1D) and the arg is the first given parmeter. This is useful for legacy applications that send uncommon or customer ESC/POS commands to their printers.
dst | vector to write log to |
RELIANCECORE_EXPORT Result RelianceHID::getVirtualCommsEnabled | ( | ) |
Gets the state of the USB virtual comm port feature.
When enabled, Reliance will enumerate an additional USB interface as a CDC comm port. Check device manager or /dev/tty* to find the OS assigned port name.
bool RelianceHID::RelianceStatus::hasErrorFlag | ( | ErrorStatus | flag | ) |
Helper function to check if specified flag is set.
flag | to check |
bool RelianceHID::RelianceStatus::hasErrorFlag | ( | ErrorStatus | flag | ) | const |
Const function method to check if specified flag is set.
flag | to check |
bool RelianceHID::RelianceStatus::hasSensorFlag | ( | SensorStatus | flag | ) |
Helper function to check if specified flag is set.
flag | to check |
bool RelianceHID::RelianceStatus::hasSensorFlag | ( | SensorStatus | flag | ) | const |
Const function method to check if specified flag is set.
flag | to check |
RELIANCECORE_EXPORT Result RelianceHID::initialize | ( | ) |
Attempt to connect to device.
bool RelianceHID::RelianceStatus::isPaperLow | ( | ) |
Helper function returns true if status report indicates paper low.
bool RelianceHID::RelianceStatus::isPaperOut | ( | ) |
Helper function returns true if status report indicates paper is out.
RELIANCECORE_EXPORT Result RelianceHID::ping | ( | ) |
Side effect free command to test for presence of printer.
RELIANCECORE_EXPORT Result RelianceHID::reboot | ( | ) |
Immediately perform a hard reboot of the printer.
RELIANCECORE_EXPORT Result RelianceHID::setMotorCurrent | ( | int | current | ) |
Change the motor current.
current | milliamps to apply to printer motor (min: 50, max: 1500) |
RELIANCECORE_EXPORT Result RelianceHID::setMotorGen | ( | int | gen | ) |
Change the motor configuration to another gen.
gen | 0 for gen1, 1 for gen 2 |
RELIANCECORE_EXPORT Result RelianceHID::setPaperWidth | ( | int | width | ) |
Change the paper roll width configuration.
width | value between 58 and 80, inclusive |
RELIANCECORE_EXPORT Result RelianceHID::setStartupTicketEnabled | ( | bool | enabled | ) |
Sets the state of the startup ticket feature.
enabled | true or false |
RELIANCECORE_EXPORT Result RelianceHID::setVirtualCommsEnabled | ( | bool | enabled | ) |
Enable or disable the USB virtual comm port feature.
When enabled, Reliance will enumerate an additional USB interface as a CDC comm port. Check device manager or /dev/tty* to find the OS assigned port name.
enabled | true or false |