Module to facilitate listening/retrieval of printer unsolicited messaging or retrieval of printer status/information. More...
#include <PrinterMonitor.h>
Public Types | |
typedef void(^ | EngineStatusCallback) (NSString *newEngineState) |
A callback type for engine status changes. | |
typedef void(^ | DisplayStatusCallback) (NSArray< NSString * > *panelText) |
A callback type for display status changes. | |
typedef void(^ | AlertStatusCallback) (NSArray< NSString * > *alertText) |
A callback type for alert status changes. | |
Instance Methods | |
(instancetype) | - initWithTcpComm: |
Initializes a new instance with the given TCP communication object. | |
(instancetype) | - initWithJsonComm: |
Initializes a new instance with the given JSON communication object. | |
(instancetype) | - initWithCommDescriptor: |
Constructor called when creating a connection managed by the SDK. | |
(PrinterInfo *) | - getPrinterInfo |
Get printer information. | |
(NSString *) | - getEngineStatus |
Query the printer for the engine status. | |
(NSArray< NSString * > *) | - getFaultStatus |
Query the printer for fault status. | |
(void) | - SetEngineStatusListening: |
Sets whether engine status listening is enabled. | |
(void) | - SetDisplayStatusListening: |
Sets whether display status listening is enabled. | |
(void) | - SetAlertStatusListening: |
Sets whether alert status listening is enabled. | |
Properties | |
BOOL | engineStatusListening |
Enable/disable listening/parsing unsolicited engine status from printer. | |
BOOL | displayStatusListening |
Enable/disable listening/parsing unsolicited front panel display text from printer. | |
BOOL | alertStatusListening |
Enable/disable listening/parsing unsolicited fault status alerts from printer. | |
EngineStatusCallback | engineStatusCallback |
Holds the function to call when engine status received from printer. Function must match signature of EngineStatusNotice. | |
DisplayStatusCallback | displayStatusCallback |
Holds the function to call when display text messages are received from printer. Function must match signature of DisplayStatusNotice. | |
AlertStatusCallback | alertStatusCallback |
Holds the function to call when fault/alert messages are received from printer. Function must match signature of AlertStatusNotice. | |
Module to facilitate listening/retrieval of printer unsolicited messaging or retrieval of printer status/information.
Unsolicited messages, if enabled on printer, can be sent at any time. This module requires a constant connection to the printer's management port in order to listen for any messaging sent out by printer.
- AlertStatusCallback |
A callback type for alert status changes.
alertText | The new alert text. |
- DisplayStatusCallback |
A callback type for display status changes.
panelText | The new panel text. |
- EngineStatusCallback |
A callback type for engine status changes.
newEngineState | The new engine state. |
- (NSString *) getEngineStatus |
Query the printer for the engine status.
Engine status is useful to check if printer is in a state that can print before sending a print job.
The string returned is any of the "fault", "idle", "offline", "pause", "printing", "present" (Label Present).
Implemented in PrinterMonitor.
- (NSArray< NSString * > *) getFaultStatus |
Query the printer for fault status.
Fault status is used to check if printer is in a fault state that needs attention or may prevent processing of any print job.
The alert string array returned represents the alert number sent by printer at alert[0] and brief description at alert[1].
e.g. "2418" represents a "Print Head Open" alert. alert[0] = "2418"; alert[1] = "Print Head Open";
Implemented in PrinterMonitor.
- (PrinterInfo *) getPrinterInfo |
Get printer information.
Useful for cases where want to check model, firmware version, options installed and other hardware specific details.
Implemented in PrinterMonitor.
- (instancetype) initWithCommDescriptor: | (NSString *) | commDescriptor |
Constructor called when creating a connection managed by the SDK.
commDescriptor is descriptor for the communication used to connect with printer.
TCP descriptor format: "ip" or "ip:port"
e.g. "127.0.0.1" or "127.0.0.1:3007"
If port is not provided, default value is used.
commDescriptor | The communication descriptor. |
- (instancetype) initWithJsonComm: | (JsonComm *) | mgmtComm |
Initializes a new instance with the given JSON communication object.
mgmtComm | The JSON communication object. |
- (instancetype) initWithTcpComm: | (TcpComm *) | connection |
Initializes a new instance with the given TCP communication object.
connection | The TCP communication object. |
- (void) SetAlertStatusListening: | (BOOL) | value |
Sets whether alert status listening is enabled.
value | YES to enable listening, NO to disable. |
- (void) SetDisplayStatusListening: | (BOOL) | value |
Sets whether display status listening is enabled.
value | YES to enable listening, NO to disable. |
- (void) SetEngineStatusListening: | (BOOL) | value |
Sets whether engine status listening is enabled.
value | YES to enable listening, NO to disable. |
|
readwritenonatomiccopy |
Holds the function to call when fault/alert messages are received from printer. Function must match signature of AlertStatusNotice.
|
readwritenonatomicassign |
Enable/disable listening/parsing unsolicited fault status alerts from printer.
Note that this must be enabled in order to receive any notifications, AlertStatusCallback, from printer.
|
readwritenonatomiccopy |
Holds the function to call when display text messages are received from printer. Function must match signature of DisplayStatusNotice.
|
readwritenonatomicassign |
Enable/disable listening/parsing unsolicited front panel display text from printer.
Note that this must be enabled in order to receive any notifications, DisplayStatusCallback, from printer.
|
readwritenonatomiccopy |
Holds the function to call when engine status received from printer. Function must match signature of EngineStatusNotice.
|
readwritenonatomicassign |
Enable/disable listening/parsing unsolicited engine status from printer.
Note that this must be enabled in order to receive any notifications, EngineStatusCallback, from printer.