EM220II Mobile Printer iOS SDK API Reference Guide P1007752-036 Rev. 1.
EM220II Table of Contents 1. Manual Information...................................................................................................................................... 7 1-1 Supported Platform & Development Environment ................................................................................... 7 1-2 Supported Platform & Supported Devices ............................................................................................... 7 1-3 Supported Properties List .....................
EM220II 5-2-14 AutoConnection ..................................................................................................................... 23 5-2-15 drawerPin ............................................................................................................................... 23 5-2-16 drawerOpenLevel .................................................................................................................. 24 5-3 Instance Methods ...................................................
EM220II ■ Proprietary Statements This manual contains proprietary information of Zebra Technologies Corporation. It is intended solely for the information and use of parties operating and maintaining the equipment described herein. Such proprietary information may not be used, reproduced, or disclosed to any other parties for any other purpose without the expressed written permission of Zebra Technologies Corporation.
EM220II Canadian Compliance Statement This Class B digital apparatus complies with Canadian ICES-003. Cet appareil numérique de la classe B est conforme á la norme NMB-003 du Canada. “IC:” before the equipment certification number signifies that the Industry Canada technical specifications were met. It does not guarantee that the certified product will operate to the user‟s satisfaction.
EM220II Copyrights The copyrights in this manual and the label print engine described therein are owned by Zebra Technologies Corporation. Unauthorized reproduction of this manual or the software in the label print engine may result in imprisonment of up to one year and fines of up to $10,000 (17 U.S.C.506). Copyright violators may be subject to civil liability. This product may contain ZPL® , ZPL II® , and ZebraLinktm programs; Element Energy Equalizer® Circuit; E3® ; and AGFA fonts. Software © ZIH Corp.
EM220II 1. Manual Information This iOS SDK manual contains the descriptions of the Library required for the applications program development. 1-1 Supported Platform & Development Environment - Platform • iOS 3.13 or higher - Development environment • XCode 3.2.6 or higher 1-2 Supported Platform & Supported Devices Compatibilities of the following list of devices were verified. Besides the devices in the list, it is compatible with iPod touch second generation or later version.
EM220II 1-4 Supported Properties List Method/Property getInstance open close lookup selectTarget connect disconnect disconnectWithTimeout isConnected enableLSB printText printBox lineFeed nextPrintPos printBarcode printBitmap checkPrinter msrReadReady msrReadCancel msrReadCancelEx msrReadTrack msrGetTrack msrReadFullTrack directIO icON icOFF icApdu icGetStatus nvImageList downloadNVImage (Diffusion) downloadNVImage (Normal) printNVImage removeNVImage removeAllNVImages openDrawer isSupport_MSR isSupport_IC i
EM220II 2. Constant Definition Constants used in the provided SDK are defined in the “BXCode.h” file. 2-1 Character Set This defines the code page and the default value is set to BXL_CS_437. Available Code Pages are as follows.
EM220II 2-2 International Character Set This defines the international character set and the default value is set to BXL_ICS_USA. Available International Character Sets are as follows. Code Value BXL_ICS_USA 0 U.S.A. BXL_ICS_FRANCE 1 France BXL_ICS_GERMANY 2 Germany BXL_ICS_UK 3 U.K.
EM220II Code BXL_TS_0HEIGHT BXL_TS_1HEIGHT BXL_TS_2HEIGHT BXL_TS_3HEIGHT BXL_TS_4HEIGHT BXL_TS_5HEIGHT BXL_TS_6HEIGHT BXL_TS_7HEIGHT Value 0 16 32 48 64 80 96 112 Description Set the ratio of vertical height to X1 Set the ratio of vertical height to X2 Set the ratio of vertical height to X3 Set the ratio of vertical height to X4 Set the ratio of vertical height to X5 Set the ratio of vertical height to X6 Set the ratio of vertical height to X7 Set the ratio of vertical height to X8 2-5 Text Attribute Thi
EM220II 2-7 Bar Code Symbology This defines the bar code type. Available settings are as follows.
EM220II 2-9 Power This indicates the remaining battery capacity of the printer. It is read only and a change of battery status is automatically shown. Support Device : Mobile Printer (EM220II) The remaining battery capacity status values are as follows.
EM220II 2-12 Drawer kick-out connector pin This defines the number of drawer kick-out connector pin. Support Device : Only thermal printer, EM220II is not support. Available settings are as follows. Code BXL_CASHDRAWER_PIN_2 BXL_CASHDRAWER_PIN_5 Value 0 1 Description Drawer kick-out connector pin 2 Drawer kick-out connector pin 5 2-13 Drawer open level This defines the type of cash drawer Support Device : Only thermal printer, EM220II is not support. Available settings are as follows.
EM220II 2-16 Result Code Code DEFINE BXL_SUCCESS BXL_NOT_CONNECTED BXL_NOT_OPENED BXL_STATUS_ERROR BXL_CONNECT_ERROR BXL_NOT_SUPPORT BXL_BAD_ARGUMENT BXL_BUFFER_ERROR BXL_NOT_CONNECTED Value 0 -1 101 103 105 107 108 109 110 BXL_RGBA_ERROR 111 BXL_MEMORY_ERROR 112 BXL_TOO_LARGE_IMAGE 113 BXL_NOT_SUPPORT_DEVICE BXL_READ_ERROR BXL_WRITE_ERROR BXL_BITMAPLOAD_ERROR BXL_BC_DATA_ERROR BXL_BC_NOT_SUPPORT BXLMSR_NOTREADY BXLMSR_FAILEDMODE BXLMSR_DATAEMPTY 114 301 300 400 500 501 602 601 603 1001H 1002H 1003
EM220II 10A6H 10A7H 10A8H 10B0H 10E4H 10E5H 10E7H 10F7H 10F8H 10FBH Rev. 1.
EM220II 3. BXBarcode Class Reference Inherits from Confirms to Framework [Availability] Declared NSObject BXPrinter.a iOS 3.1.3 and later BXBarcodeInfo.h 3-1 Overview BXBarcode class is an object that contains information about which barcode types are supported for each printer to control. 3-2 Properties 3-2-1 barNumber Barcode Define Number @property int barNumber [Discussion] Printer name is saved automatically by collecting information from the connected printer. [Availability] SDK 1.0.
EM220II 4. BXPrinter Class Reference Inherits from Confirms to Framework [Availability] Declared NSObject BXPrinter.a iOS 3.1.3 and later BXPrinterObject.h 4-1 Overview BXPrinter Class contains the information of control target printer (name / network address / port). 4-2 Properties 4-2-1 name Printer name @property(readonly) NSString * name [Discussion] Printer name is saved automatically by collecting information from the connected printer. [Availability] SDK 1.0.
EM220II 4-2-4 modelStr Model name of printer Name is provided by the firmware, and it is _EM220II in case of EM220II printer. @property(readwrite) NSString * modelStr [Discussion] This value is updated by the checkPrinter method of BXPrinterController. [Availability] SDK 1.0.0 and later 4-2-5 versionStr Firmware version of printer Version name is provided by firmware, and it is in the form of _V01.00 STOB 040711 in case of EM220II.
EM220II 5. BXPrinterController Class Reference Inherits from Confirms to Framework [Availability] Declared NSObject BXPrinter.a iOS 3.1.3 and later BXPrinter.h 5-1 Overview BXPrinterController Class is the main object for printer control. 5-2 Properties 5-2-1 version SDK version @property(readonly) NSString * version [Discussion] It is a string in the form of “1.0.0” and it is read only. [Availability] SDK 1.0.
EM220II 5-2-4 lookupDuration Printer lookup time (unit: second) @property(readwrite) CGFloat lookupDuration [Discussion] It could be a fractional number such as 0.5. [Availability] SDK 1.0.0 and later 5-2-5 lookupCount Number of repeat on signal transmission for printer search @property(readwrite) unsigned lookupCount [Discussion] Default value is set to 1. When it is set to a number bigger than 1, the printer search signal transmission is repeated by this number at intervals of 0.2 seconds.
EM220II 5-2-8 textSize Size of the printed text @property(readwrite) int textSize [Discussion] Refer to 2-4 Text Size [Availability] SDK 1.0.0 and later 5-2-9 characterSet Defines the code page of printer @property(readwrite) CGFloat lookupDuration [Discussion] Refer to 2-1 Character Set Default value is set to BXL_CS_437. [Availability] SDK 1.0.0 and later 5-2-10 internationalCharacterSet @property(readwrite) char internationalCharacterSet [Discussion] Refer to 2-2 International Character Set.
EM220II 5-2-12 state Printer state code This value is updated when checkPrinter method of BXPrinterController is called. @property(readonly) long state [Discussion] Refer to 2-10 State [Availability] SDK 1.0.0 and later 5-2-13 power @property(readonly) long state [Discussion] Refer to 2-9 Power [Availability] SDK 1.0.0 and later 5-2-14 AutoConnection @property(assign) int AutoConnection [Discussion] Refer to 2-11 Connection Control [Availability] SDK 1.0.
EM220II 5-2-16 drawerOpenLevel @property(assign) int drawerOpenLevel [Discussion] Refer to 2-13 Drawer open level [Availability] SDK 1.0.0 and later [Support Device] Only thermal printer, EM220II is not support.
EM220II 5-3-3 close Resources are de-allocated for stopping or terminating the use of BXPrinterController class. [Discussion] - It should be called before calling main delegate of applications like (void)applicationWillResignActive:(UIApplication *) application. When close method is not called and applications using BXPrinterController are running in the background, simultaneous use of BXPrinterController by other applications could be restricted. [Availability] SDK 1.0.
EM220II 5-3-6 connect Connect to target printer. [Function prototype] - (BOOL)connect [Discussion] This method not works when AutoConnection is setting in BXL_CONNECTIONMODE_AUTO(default, == 0) Target of BXPrininterController property should be set in advance. [Availability] SDK 1.0.0 and later 5-3-7 disconnect Disconnect to connected printer. [Function prototype] - (void)disconnect [Discussion] This method not works when AutoConnection is setting in BXL_CONNECTIONMODE_AUTO(default, == 0).
EM220II 5-3-9 isConnected Returns the connection state of the printer. [Return Value] TRUE if the printer is connected. FALSE if the printer is not connected. [Function prototype] - (BOOL)isConnected [Availability] SDK 1.0.0 and later 5-3-10 enableLSB Enable to Last status back. [Function prototype] - (long)enableLSB:(BOOL)bEnable [Parameters] bEnable LSB Enable. FALSE : LSB Disable TRUE : LSB Enable [Return Value] Refer to 2-16 Result Code [Availability] SDK 1.0.0 and later 5-3-11 printText Print text.
EM220II 5-3-12 printBox Print box shape text. No action takes place if no printer is connected. [Function prototype] (long)printText:(int)width height: (int)height; [Parameters] int Specify the width of the box. 1 == width equivalent to that of one character int Specify the length of the box. 1 == length equivalent to that of one character [Return Value] Refer to 2-16 Result Code [Discussion] Alignment and properties of the text should be defined in advance. [Availability] SDK 1.0.
EM220II 5-3-14 nextPrintPos Feed the paper to the beginning of the next label paper. [Function prototype] - (long)nextPrintPos [Return Value] Refer to 2-16 Result Code [Discussion] This method works only when in label mode. [Availability] SDK 1.0.0 and later 5-3-15 cutPaper Cuts paper. Support Device : Only thermal printer, EM220II is not support. [Function prototype] - (long)cutPaper [Return Value] Refer to 2-16 Result Code [Availability] SDK 1.0.
EM220II alignment Barcode alignment setting Refer to 2-3 Barcode/Text Alignment textPosition Barcode text position setting Refer to 2-6 Barcode Text Position [Return Value] Refer to 2-16 Result Code [Availability] SDK 1.0.
EM220II [Availability] SDK 1.0.0 and later 5-3-18 checkPrinter Check the printer states and update the printer state property [Function prototype] - (long)checkPrinter [Return Value] Refer to 2-16 Result Code [Availability] SDK 1.0.0 and later 5-3-19 msrReadReady Switch the printer to MSR Ready state. Printing is not allowed in Ready state. [Function prototype] - (long)msrReadReady [Return Value] Refer to 2-16 Result Code [Availability] SDK 1.0.
EM220II 5-3-22 msrReadTrack Read MSR data. It is MSR read mode. If BXLMSR_DATAEMPTY is returned, card is not read in MSR. Scan the card with MSR again or use the „msrReadCancel‟ method to cancel the read mode. [Function prototype] - (long)msrReadTrack:(NSData **)data1 data2:(NSData **)data2 data3:(NSData **)data3 [Parameters] data1 Read MSR Data Track 1 and save it. data2 Read MSR Data Track 2 and save it. data3 Read MSR Data Track 3 and save it.
EM220II [Discussion] Response carries unallocated NSData *data, and NSData object is allocated inside the method. The response is auto release one and users do not have to release it explicitly. [Availability] SDK 1.0.0 and later 5-3-24 msrReadFullTrack Read entire MSR data. It is MSR read mode. If BXLMSR_DATAEMPTY is returned, card is not read in MSR. Scan the card with MSR again or use the msrReadCancel method to cancel the read mode.
EM220II 5-3-26 icON Apply power to smart card reader of printer [Function prototype] - (long)icON:(NSData **)response [Parameters] response ATR (Answer to Reset) value is returned. [Return Value] Refer to 2-16 Result Code [Discussion] Response is saved as auto release type inside the method, and users do not have to release it explicitly. [Availability] SDK 1.0.
EM220II 5-3-29 icGetStatus Read the status of card inserted into the smart card reader of printer [Function prototype] - (long)icGetStatus:(NSData **)response [Parameters] response Card status value is returned [Return Value] Refer to 2-16 Result Code [Availability] SDK 1.0.0 and later 5-3-30 nvImageList Read the list of image addresses saved in NV area. [Function prototype] - (long)nvImageList:(NSArray **)images [Parameters] images Address list is provided. Each address is saved in the form of NSNumber *.
EM220II 5-3-31 downloadNVImage (Diffusion) Download the image data corresponding to the address saved in the NV area. [Function prototype] - (long)downloadNVImage:(int)address withImage:(UIImage *)image width:(long)width level:(long)level [Parameters] address Image address in the range of 0 ~ 99. If there is an image saved for the corresponding address, the existing image is replaced by the new image.
EM220II 5-3-32 downloadNVImage (Normal) Download the image data to the designated address in NV area. [Function prototype] - (long)downloadNVImage:(int)address withImage:(UIImage *)image [Parameters] address Image address in the range of 0 ~ 99. If there is an image saved for the corresponding address, the existing image is replaced by a new image.
EM220II 5-3-34 removeNVImage Delete image data from the designated address in NV area. [Function prototype] - (long)removeNVImage:(int)address [Parameters] address Image address in the range of 0 ~ 99 [Return Value] Refer to 2-16 Result Code [Discussion] No action takes place if image does not exist in the corresponding address [Availability] SDK 1.0.0 and later 5-3-35 removeAllNVImages Delete all image data from the designated address in NV area.
EM220II 5-3-37 isSupport_MSR Check whether a specific feature of the MSR is supported. [Function prototype] - (BOOL)isSupport_MSR [Return Value] If the feature of the MSR is supported, return TRUE. [Availability] SDK 1.0.0 and later 5-3-38 isSupport_IC Check whether a specific feature of the IC is supported. [Function prototype] - (BOOL)isSupport_IC [Return Value] If the feature of the IC is supported, return TRUE. [Availability] SDK 1.0.
EM220II 5-3-41 isSupport_LSB Check whether a specific feature of the LSB is supported. [Function prototype] - (BOOL)isSupport_MSR [Return Value] If the feature of the LSB is supported, return TRUE. [Availability] SDK 1.0.0 and later 5-3-42 isSupport_Barcode Checks whether the printer can print out barcodes. [Function prototype] - (BOOL)isSupport_Barcode [Return Value] TRUE if printing barcodes are supported. FALSE if printing barcodes are not supported. [Availability] SDK 1.0.
EM220II 6. BXPrinterControllerDelegate Protocol Reference Inherits from Confirms to Framework [Availability] Declared NSObject BXPrinter.a iOS 3.1.3 and later BXPrinteControlDelegater.h 6-1 Overview This receives events occurring in the BXPrinterController class. 6-2 Instance Methods 6-2-1 didStart It is called when class starts to be used using open method of BXPrinterController. It is called after printer connection is completed.
EM220II 6-2-3 didFindPrinter This method is called for each individual printer when a printer is discovered from the same network. [Function prototype] - (void)didFindPrinter:(BXPrinterController *)controller printer:(BXPrinter *)printer [Parameters] controller BXPrinterController object that generates events printer Information of discovered printer [Discussion] If same printer responds multiple time during the printer lookup process, this method is called only once the first time. [Availability] SDK 1.0.
EM220II 6-2-6 willLookupPrinters This method is called before starting printer search. [Function prototype] - (void)willLookupPrinters:(BXPrinterController *)controller [Parameters] controller BXPrinterController object that generates events [Discussion] This can be used to indicate the start of printer search. [Availability] SDK 1.0.0 and later 6-2-7 didLookupPrinters This method is called when printer search is completed.
EM220II 6-2-9 didBeBrokenConnection This method is called when the connection to printer is broken. [Function prototype] - (void)didBeBrokenConnection:(BXPrinterController *)controller withError:(NSError *)error [Parameters] controller BXPrinterController object that generates events error Information of cause of failure [Discussion] This is not called when user breaks the connection by calling the close method of BXPrinterController explicitly.
EM220II 6-2-11 didUpdateStatus This method is called when printer status variable has changed. [Function prototype] - (void)didUpdateStatus:(BXPrinterController *)controller Status(NSNumber*) status [Parameters] controller BXPrinterController object that generates events status printer status. [Availability] SDK 1.0.0 and later Rev. 1.
www.zebra.com Zebra Technologies International, LLC Zebra Technologies Europe Limited 333 Corporate Woods Parkway Dukes Meadow Vernon Hills, Illinois 60061, 3109 USA Millboard Road Phone: +1.847.634.6700 Bourne End Toll-Free: +1.800.423.0422 Buckinghamshire, SL8 5XF, UK Fax: +1.847.913.