AbstractProtecteddebugProtectedheartbeatProtectedmutexProtectedpacketProtectedprinterReadonlyprotocolProtectedrfidStaticprefixedOptionalcontext: anyAbstractconnectConnect to printer port.
ProtectedconnectSend "connect" packet and fetch the protocol version.
AbstractdisconnectDisconnect from printer port.
Calls each of the listeners registered for a given event.
Return an array listing the events for which the emitter has registered listeners.
Fetch heartbeat information and store it. Emits heartbeat/heartbeatfailed event. Do not throws exceptions.
Fetch printer information and store it
Fetch label and ribbon RFID information and store it. Do not throws exceptions.
Get the stored heartbeat information about RFID tags. Call fetchHeartbeatData to update.
Get printer capabilities based on the printer model. Model library is hardcoded.
Get the stored information about the printer. Call fetchPrinterInfo to update.
Determine print task version if any.
Get the stored information about RFID tags. Call fetchRfidInfo to update.
AbstractgetAbstractisCheck if the client is connected.
Checks if the heartbeat timer has been started.
Return the number of listeners listening to a given event.
Return the listeners registered for a given event.
ProtectednegotiateCalls connectNegotiate (exceptions are not ignored) then calls fetchPrinterInfo and fetchRfidInfo (exceptions ignored)
Optionalcleanup: () => voidcleanup/disconnect function, called when initialNegotiate fails
Optionalfn: (...args: ArgumentMap<ClientEventMap>[Extract<T, keyof ClientEventMap>]) => voidOptionalcontext: anyOptionalonce: booleanAdd a listener for a given event.
Optionalcontext: anyAdd a one-time listener for a given event.
Optionalcontext: anyProtectedprocessConvert raw bytes to packet objects and fire events. Defragmentation included.
Bytes to process.
Remove all listeners, or those of the specified event.
Optionalevent: keyof ClientEventMapRemove the listeners of a given event.
Optionalfn: (...args: ArgumentMap<ClientEventMap>[Extract<T, keyof ClientEventMap>]) => voidOptionalcontext: anyOptionalonce: booleanOptionalforce: booleanSend packet and wait for response for timeoutMs milliseconds.
If () validResponseIds is defined, it will wait for packet with this command id.
Packet object.
PrintError when ResponseCommandId.In_PrintError or ResponseCommandId.In_NotSupported received.
AbstractsendSend raw bytes to the printer port.
Bytes to send.
Optionalforce: booleanIgnore mutex lock. It used internally and you should avoid using it.
Enable some debug information logging.
Set interval for startHeartbeat.
Heartbeat interval, default is 1000ms
Set max failed heartbeat attempts to disconnect. Use 0 to disable.
Set the interval between packets in milliseconds.
Starts the heartbeat timer, "heartbeat" is emitted after packet received.
If you need to change interval, call setHeartbeatInterval before.
Stops the heartbeat by clearing the interval timer.
Send wait for response for timeoutMs milliseconds.
If ids is set, it will wait for packet with this command ids.
Packet object.
PrintError when ResponseCommandId.In_PrintError or ResponseCommandId.In_NotSupported received and catchErrorPackets is true.
Abstract class representing a client with common functionality for interacting with a printer. Hardware interface must be defined after extending this class.