Zebra API for iOS (Build v1.6.1158)
Loading...
Searching...
No Matches
PrinterStatusMessages Class Reference

This class is used to acquire a human readable string of the current errors/warnings stored in a PrinterStatus instance. More...

#include <PrinterStatusMessages.h>

Inheritance diagram for PrinterStatusMessages:

Instance Methods

(id) - initWithPrinterStatus:
 Used to acquire a human readable string of the current errors/warnings stored in aPrinterStatus
 
(NSArray *) - getStatusMessage
 Used to acquire a human readable string of the current errors/warnings passed to this instance.
 

Class Methods

(NSString *) + HEAD_OPEN_MSG
 Message to indicate the head is open.
 
(NSString *) + HEAD_TOO_HOT_MSG
 Message to indicate the head is too hot.
 
(NSString *) + PAPER_OUT_MSG
 Message to indicate the paper is out.
 
(NSString *) + RIBBON_OUT_MSG
 Message to indicate the ribbon is out.
 
(NSString *) + RECEIVE_BUFFER_FULL_MSG
 Message to indicate the receive buffer is full.
 
(NSString *) + PAUSE_MSG
 Message to indicate printer is paused.
 

Detailed Description

This class is used to acquire a human readable string of the current errors/warnings stored in a PrinterStatus instance.

Get a string array of the current errors and warnings.

#import "TcpPrinterConnection.h"
#import "ZebraPrinter.h"
#import "ZebraPrinterFactory.h"
#import "PrinterStatusMessages.h"
#import <UIKit/UIKit.h>
TcpPrinterConnection *zebraPrinterConnection = [[TcpPrinterConnection alloc] initWithAddress:@"192.168.1.100" andWithPort:6101];
BOOL success = [zebraPrinterConnection open];
NSError *error = nil;
id<ZebraPrinter,NSObject> printer = [ZebraPrinterFactory getInstance:zebraPrinterConnection error:&error];
PrinterStatus *printerStatus = [printer getCurrentStatus:&error];
NSString* status = nil;
if (printerStatus.isReadyToPrint) {
status = @"Ready To Print";
} else {
PrinterStatusMessages *statusMessage = [[PrinterStatusMessages alloc]initWithPrinterStatus:printerStatus];
NSArray *statusMessages = [statusMessage getStatusMessage];
NSMutableString *joinedStatusMessage = [[NSMutableString alloc] initWithFormat:@""];
for (NSUInteger i = 0; i < [statusMessages count]; i++) {
[joinedStatusMessage appendFormat:@"%@;", [statusMessages objectAtIndex:i]];
}
status = [[NSString alloc] initWithFormat:@"Cannot Print: %@", joinedStatusMessage];
[joinedStatusMessage release];
[statusMessage release];
}
if (error != nil || printer == nil || success == NO) {
UIAlertView *errorAlert = [[UIAlertView alloc] initWithTitle:@"Error" message:[error localizedDescription] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[errorAlert show];
[errorAlert release];
}
[zebraPrinterConnection release];
A class used to obtain the status of a Zebra printer.
Definition PrinterStatus.h:53
This class is used to acquire a human readable string of the current errors/warnings stored in a Prin...
Definition PrinterStatusMessages.h:59
NSArray * getStatusMessage()
Used to acquire a human readable string of the current errors/warnings passed to this instance.
Establishes a TCP connection to a printer.
Definition TcpPrinterConnection.h:112
A factory used to acquire an instance of a ZebraPrinter.
Definition ZebraPrinterFactory.h:19

Method Documentation

◆ getStatusMessage

- (NSArray *) getStatusMessage

Used to acquire a human readable string of the current errors/warnings passed to this instance.

Returns
A human readable string array of the current errors/warnings passed to this instance.

◆ HEAD_OPEN_MSG

+ (NSString *) HEAD_OPEN_MSG

Message to indicate the head is open.

Returns
A message to indicate the head is open.

◆ HEAD_TOO_HOT_MSG

+ (NSString *) HEAD_TOO_HOT_MSG

Message to indicate the head is too hot.

Returns
A Message to indicate the head is too hot.

◆ initWithPrinterStatus:

- (id) initWithPrinterStatus: (PrinterStatus *) aPrinterStatus

Used to acquire a human readable string of the current errors/warnings stored in aPrinterStatus

Parameters
aPrinterStatusAn instance of PrinterStatus that will be used to acquire the human readable string of warnings/errors stored in aPrinterStatus.

◆ PAPER_OUT_MSG

+ (NSString *) PAPER_OUT_MSG

Message to indicate the paper is out.

Returns
A message to indicate the paper is out.

◆ PAUSE_MSG

+ (NSString *) PAUSE_MSG

Message to indicate printer is paused.

Returns
A message to indicate printer is paused.

◆ RECEIVE_BUFFER_FULL_MSG

+ (NSString *) RECEIVE_BUFFER_FULL_MSG

Message to indicate the receive buffer is full.

Returns
A message to indicate the receive buffer is full.

◆ RIBBON_OUT_MSG

+ (NSString *) RIBBON_OUT_MSG

Message to indicate the ribbon is out.

Returns
A message to indicate the ribbon is out.

The documentation for this class was generated from the following file: