1. Manual Information ...................................................................................................................................... 7
1-1 Supported Platform & Development Environment ................................................................................... 7
2-1 Character Set ........................................................................................................................................... 9
2-2 International Character Set .................................................................................................................... 10
2-4 Text Size................................................................................................................................................. 10
2-5 Text Attribute ........................................................................................................................................... 11
2-6 Bar Code Text Position ........................................................................................................................... 11
2-7 Bar Code Symbology ............................................................................................................................. 12
2-9 Power ..................................................................................................................................................... 13
2-10 State ..................................................................................................................................................... 13
2-11 Connection Control .............................................................................................................................. 13
2-13 Drawer open level ................................................................................................................................ 14
2-14 Model ID ............................................................................................................................................... 14
2-15 Connection Class ................................................................................................................................. 14
2-16 Result Code ......................................................................................................................................... 15
3. BXBarcode Class Reference .................................................................................................................... 17
4-2-3 port ........................................................................................................................................... 18
5-2-12 state ....................................................................................................................................... 23
5-2-13 power ..................................................................................................................................... 23
5-3-2 open ......................................................................................................................................... 24
5-3-3 close ......................................................................................................................................... 25
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.
Product Improvements
Since continuous product improvement is a policy of Zebra Technologies Corporation, all
specifications and signs are subject to change without notice.
FCC Compliance Statement
NOTE: This equipment has been tested and found to comply with the limits or a Class B
digital device, pursuant to Part 15 of the FCC Rules. These limits are designed to provide
reasonable protection against harmful interference in a residential installation. This equipment generates, uses and can radiate radio frequency energy and, if not installed and
used in accordance with the instructions, may cause harmful interference to radio
communications. However, there is no guarantee that interference will not occur in a
particular installation. If this equipment does cause harmful interference to radio or
television reception, which can be determined by turning the equipment off and on, the
user is encouraged to try to correct the interference by one or more of the following
measures:
• Reorient or relocate the receiving antenna.
• Increase the separation between the equipment and receiver.
• Connect the equipment into an outlet or circuit different from that to which the receiver is
connected.
• Consult the dealer or an experienced radio/TV technician for help.
WARNING: Exposure to Radio Frequency radiation. To conform to FCC RF exposure requirements this device shall be used in accordance with the operating conditions and instructions listed in this manual.
NOTE: This unit was tested with shielded cables on the peripheral devices. Shielded
cables must be used with the unit to insure compliance.
Changes or modifications to this unit not expressly approved by Zebra Technologies Corporation could void the user‟s authority to operate this equipment.
Rev. 1.00
Page 5
EM220II
- 5 -
Mobile Printer
iOS SDK API Reference Guide
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.
Liability Disclaimer
Inasmuch as every effort has been made to supply accurate information in this manual,
Zebra Technologies Corporation is not liable for any erroneous information or omissions.
Zebra Technologies Corporation reserves the right to correct any such errors and
disclaims liability resulting therefrom.
No Liability for Consequential Damage
In no event shall Zebra Technologies Corporation or anyone else involved in the creation,
production, or delivery of the accompanying product (including hardware and software) be
liable for any damages whatsoever (including, without limitation, damages for loss of
business profits, business interruption, loss of business information, or other pecuniary
loss) arising out of the use of or the results of use of or inability to use such product, even
if Zebra Technologies Corporation has been advised of the possibility of such damages.
Because some states do not allow the exclusion of liability for consequential or incidental
damages, the above limitation may not apply to you.
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.
• iPhone 3GS / 4G
• iPad / iPad2
1-3 Supported Properties List
Rev. 1.00
Page 8
- 8 -
Mobile Printer
iOS SDK API Reference Guide
1-4 Supported Properties List
Method/Property
Mobile Printer (EM220II)
getInstance
O
open
O
close
O
lookup
O
selectTarget
O
connect
O
disconnect
O
disconnectWithTimeout
O
isConnected
O
enableLSB
X
printText
O
printBox
O
lineFeed
O
nextPrintPos
O
printBarcode
O
printBitmap
O
checkPrinter
O
msrReadReady
O
msrReadCancel
O
msrReadCancelEx
O
msrReadTrack
O
msrGetTrack
O
msrReadFullTrack
O
directIO
O
icON
O
icOFF
O
icApdu
O
icGetStatus
O
nvImageList
O
downloadNVImage (Diffusion)
O
downloadNVImage (Normal)
O
printNVImage
O
removeNVImage
O
removeAllNVImages
O
openDrawer
X
isSupport_MSR
O
isSupport_IC
O
isSupport_Config
O
isSupport_CashDrawer
O
isSupport_LSB
O
isSupport_Barcode
O
getBarcodeSupportTable
O
EM220II
Rev. 1.00
Page 9
- 9 -
Mobile Printer
iOS SDK API Reference Guide
Code
Value
Description
BXL_CS_PC437
0
Code page PC437
BXL_CS_Katakana
1
Katakana
BXL_CS_PC850
2
Code page PC850
BXL_CS_PC860
3
Code page PC860
BXL_CS_PC863
4
Code page PC863
BXL_CS_PC865
5
Code page PC860
BXL_CS_WPC1252
16
Code page WPC1252
BXL_CS_PC866
17
Code page PC860
BXL_CS_PC852
18
Code page PC852
BXL_CS_PC858
19
Code page PC858
BXL_CS_PC864
22
Code page PC864
BXL_CS_THAI42
23
Code page THAI42
BXL_CS_WPC1253
24
Code page WPC1253
BXL_CS_WPC1254
25
Code page WPC1254
BXL_CS_WPC1257
26
Code page WPC1257
BXL_CS_FARSI
27
Code page FARSI
BXL_CS_WPC1251
28
Code page WPC1251
BXL_CS_PC737
29
Code page PC737
BXL_CS_PC775
30
Code page PC775
BXL_CS_THAI14
31
Code page THAI14
BXL_CS_PC862
33
Code page PC862
BXL_CS_PC855
36
Code page PC855
BXL_CS_PC857
37
Code page PC857
BXL_CS_PC928
38
Code page PC928
BXL_CS_THAI16
39
Code page THAI16
BXL_CS_WPC1256
40
Code page WPC1256
BXL_CS_USER
255
User set page
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
Rev. 1.00
Page 10
EM220II
- 10 -
Mobile Printer
iOS SDK API Reference Guide
Code
Value
Description
BXL_ICS_USA
0
U.S.A.
BXL_ICS_FRANCE
1
France
BXL_ICS_GERMANY
2
Germany
BXL_ICS_UK
3
U.K.
BXL_ICS_DENMARK1
4
Denmark I
BXL_ICS_SWEDEN
5
Sweden
BXL_ICS_ITALY
6
Italy
BXL_ICS_SPAIN
7
Spain
BXL_ICS_NORWAY
9
Norway
BXL_ICS_DENMARK2
10
Denmark II
Code
Value
Description
BXL_ALIGNMENT_LEFT
0
Left align
BXL_ALIGNMENT_CENTER
1
Center align
BXL_ALIGNMENT_RIGHT
2
Right align
Code
Value
Description
BXL_TS_0WIDTH
0
Set the ratio of horizontal width to X1
BXL_TS_1WIDTH
16
Set the ratio of horizontal width to X2
BXL_TS_2WIDTH
32
Set the ratio of horizontal width to X3
BXL_TS_3WIDTH
48
Set the ratio of horizontal width to X4
BXL_TS_4WIDTH
64
Set the ratio of horizontal width to X5
BXL_TS_5WIDTH
80
Set the ratio of horizontal width to X6
BXL_TS_6WIDTH
96
Set the ratio of horizontal width to X7
BXL_TS_7WIDTH
112
Set the ratio of horizontal width to X8
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.
2-3 Barcode/Image/Text Alignment
This defines the bar code/image/text alignment and the value is set to BXL_ALIGNMENT
_LEFT.
Available settings are as follows.
2-4 Text Size
This defines the settings for the text size, and horizontal and vertical ratio can be defined
simultaneously with OR operation.
Available settings are as follows.
Rev. 1.00
Page 11
- 11 -
Mobile Printer
iOS SDK API Reference Guide
Code
Value
Description
BXL_TS_0HEIGHT
0
Set the ratio of vertical height to X1
BXL_TS_1HEIGHT
16
Set the ratio of vertical height to X2
BXL_TS_2HEIGHT
32
Set the ratio of vertical height to X3
BXL_TS_3HEIGHT
48
Set the ratio of vertical height to X4
BXL_TS_4HEIGHT
64
Set the ratio of vertical height to X5
BXL_TS_5HEIGHT
80
Set the ratio of vertical height to X6
BXL_TS_6HEIGHT
96
Set the ratio of vertical height to X7
BXL_TS_7HEIGHT
112
Set the ratio of vertical height to X8
Code
Value
Description
BXL_FT_DEFAULT
0
Default setting
NOT BOLD, FONTA, NOT UNDERLINE,
NOT REVERSE
BXL_FT_FONTB
1
Use FONTB
BXL_FT_FONTC
16
Use FONTC
BXL_FT_BOLD
2
Use Bold font
BXL_FT_UNDERLINE
4
Set Underline property
BXL_FT_REVERSE
8
Set Reverse property
BXL_ExFT_CHINA_FONTA
0
Only for Pepsi Cola project
BXL_ExFT_CHINA_FONTB
32
Code
Value
Description
BXL_BC_TEXT_NONE
0
Do not print bar code data
BXL_BC_TEXT_ABOVE
1
Print bar code data above bar code
BXL_BC_TEXT_BELOW
2
Print bar code data below bar code
2-5 Text Attribute
This is a text property and each property can be combined with OR operation.
Available settings are as follows.
EM220II
2-6 Bar Code Text Position
This is for setting the position where bar code data is printed.
Available settings are as follows.
Rev. 1.00
Page 12
- 12 -
Mobile Printer
iOS SDK API Reference Guide
2-7 Bar Code Symbology
Code
Value
Number of data
Range of data
BXL_BCS_UPCA
101
11 <= n <= 12
48 <= data <= 57
BXL_BCS_UPCE
102
11 <= n <= 12
48 <= data <= 57
BXL_BCS_EAN13
103
12 <= n <= 13
48 <= data <= 47
BXL_BCS_JAN13
104
7 <= n <= 8
48 <= data <= 57
64 <= data <= 90
data = 32,36,37,43,45,46,47
BXL_BCS_EAN8
105
7 <= n <= 8
48 <= data <= 57
BXL_BCS_JAN8
106
7 <= n <= 8
48 <= data <= 57
BXL_BCS_Code39
107
1 <= n <= 255
48 <= data <= 57
65 <= data <= 68
data = 32,36,37,43,45,46,47
BXL_BCS_ITF
108
1 <= n <= 255
(Even)
48 <= data <= 57
BXL_BCS_Codabar
109
1 <= n <= 255
48 <= data <= 57
65 <= data <= 68
data = 36,43,45,46,47,58
BXL_BCS_Code93
110
1 <= n <= 255
0 <= data <= 127
BXL_BCS_Code128
111
2 <= n <= 255
0 <= data <= 127
BXL_BCS_PDF417
200
2 <= n <= 928
0 <= data <= 255
BXL_BCS_QRCODE
202~203
2 <= n <= 928
0 <= data <= 255
BXL_BCS_DATAMATRIX
204
2 <= n <= 928
0 <= data <= 255
BXL_BCS_MAXICODE
205~6
2 <= n <= 928
0 <= data <= 255
Code
Value
Description
BXL_WIDTH_FULL
-1
Value is set to max width and the image is
resized to the full paper size
BXL_WIDTH_NONE
-2
Image is not resized
This defines the bar code type.
Available settings are as follows.
EM220II
2-8 Image Width
Set the width of image and valid range is 0~ max width.
Image is resized for the conditions according to the given conditions when the following
values are set.
Available settings are as follows.
Rev. 1.00
Page 13
EM220II
- 13 -
Mobile Printer
iOS SDK API Reference Guide
Code
Value
Description
BXL_PWR_HIGH
0
Remaining battery capacity is 95%
BXL_PWR_MIDDLE
1
Remaining battery capacity is 85%
BXL_PWR_LOW
2
Remaining battery capacity is 50%
BXL_PWR_SMALL
3
Remaining battery capacity is 25%
BXL_PWR_NOT
4
Remaining battery capacity is less than 25%
Code
Value
Description
BXL_STS_NORMAL
0
Normal
BXL_STS_PAPEREMPTY
1
No paper
BXL_STS_CONVEROPEN
2
Printer cover open
BXL_STS_POWEROVER
4
Not enough remaining battery of printer
BXL_STS_MSR_READY
8
No printing
MSR read only mode
BXL_STS_PRINTING
16
Printer is printing or receiving data
BXL_STS_ERROR
32
Error in communication with printer
BXL_STS_NOT_OPEN
64
Open method of BXPrinterControl was
not called
BXL_STS_ERROR_OCCUR
128
Printer internal error
BXL_STS_NOT_CONNECTED
-1
Currently printer is not connected
Code
Value
Description
BXL_CONNECTIONMODE_AUTO
0
Automatic connect mode
BXL_CONNECTIONMODE_NOAUTO
100
Not automatic connect mode
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.
2-10 State
This indicates the status of the printer. It is read only and the status of the printer is
automatically shown when printer status is checked by calling the CheckPrinter function.
Status values can be combined and each setting can be checked through bit operation.
Printer status settings are as follows.
2-11 Connection Control
This defines the type of printer connection.
Available settings are as follows.
Rev. 1.00
Page 14
- 14 -
Mobile Printer
iOS SDK API Reference Guide
2-12 Drawer kick-out connector pin
Code
Value
Description
BXL_CASHDRAWER_PIN_2
0
Drawer kick-out connector pin 2
BXL_CASHDRAWER_PIN_5
1
Drawer kick-out connector pin 5
Code
Value
Description
BXL_CASHDRAWER_OPENLEVEL_LOW
0
If Cash drawer is open,
Drawer kick-out connector
pin 3 is LOW
BXL_CASHDRAWER_OPENLEVEL_HIGH
1
If Cash drawer is open,
Drawer kick-out connector
pin 3 is HIGH
Code
Value
Description
BXL_MODEL_ID_EM220II
0x12001002
EM220II
Code
Value
Description
BXL_CONNECTIONCLASS_WIFI
0x0000
WIFI Connection
BXL_CONNECTIONCLASS_ETHERNET
0x0001
Ethernet Connection
BXL_CONNECTIONCLASS_BT
0x0002
Bluetooth Connection
This defines the number of drawer kick-out connector pin.
Support Device : Only thermal printer, EM220II is not support.
Available settings are as follows.
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-14 Model ID
This defines the type of printer.
Available settings are as follows.
2-15 Connection Class
When the method named 'didFindPrinter' is called,
This value is updated to connectionClass in BXPrinter class
Refer to 6-2-3 didFindPrinter
Rev. 1.00
Page 15
- 15 -
Mobile Printer
iOS SDK API Reference Guide
2-16 Result Code
Code DEFINE
Value
Description
BXL_SUCCESS
0
Success
BXL_NOT_CONNECTED
-1
Printer is not connected
BXL_NOT_OPENED
101
SDK is not open
BXL_STATUS_ERROR
103
Error in status check
BXL_CONNECT_ERROR
105
Connection failure
BXL_NOT_SUPPORT
107
Not supported
BXL_BAD_ARGUMENT
108
Wrong function arguments
BXL_BUFFER_ERROR
109
Error in MSR buffer
BXL_NOT_CONNECTED
110
Printer is not connected
BXL_RGBA_ERROR
111
Error while converting image file to
RGBA data
BXL_MEMORY_ERROR
112
Memory allocation failure
BXL_TOO_LARGE_IMAGE
113
Size of image file is too big while downloading
image to NV area
BXL_NOT_SUPPORT_DEVICE
114
The printer device does not support
BXL_READ_ERROR
301
Failure in data reception
BXL_WRITE_ERROR
300
Failure in data transmission
BXL_BITMAPLOAD_ERROR
400
Fail to read image file
BXL_BC_DATA_ERROR
500
Error in bar code data
BXL_BC_NOT_SUPPORT
501
Unsupported bar code type
BXLMSR_NOTREADY
602
Not MSR READY state
BXLMSR_FAILEDMODE
601
Not automatic read mode
BXLMSR_DATAEMPTY
603
No data read from MSR
1001H
Unknown command
1002H
Command cannot be executed
1003H
Incorrect number of arguments
1004H
First byte of unknown command of
invalid command
1005H
Response time out
1010H
Response error due to card reset,
or first byte of response is not valid
1012H
Message limit is exceeded. Maximum is 254
bytes, and card data is 248 bytes
1013H
Error in reading bytes from asynchronous
routine
1015H
Card mode is terminated
Card mode command needs to be transmitted
101BH
Transmission of command with
incorrect arguments
101DH
Incorrect TCK check byte
10A0H
Error in card reset response (unknown
protocol or TA1 byte recognition error),
unsupported card, no card response value for
card reset
10A1H
Card protocol error (T=0/T=1)
10A2H
Time out due to no card response
10A3H
Parity error
10A4H
Card has aborted chaining (T=1)
10A5H
Reader has aborted chaining (T=2)
EM220II
Rev. 1.00
Page 16
EM220II
- 16 -
Mobile Printer
iOS SDK API Reference Guide
10A6H
Successful execution of IC module
and RESYNCH
10A7H
PPS error
10A8H
IC module has already been set to IC CARD
mode
10B0H
PC link command is not supported
10E4H
The card has just sent an invalid “Procedure
byte”
10E5H
The card has interrupted an exchange
10E7H
Card returns an error
10F7H
Card is removed while executing a command
10F8H
Card is not useable because it is electrically
damaged
10FBH
Card recognition failure or car entry failure
Rev. 1.00
Page 17
EM220II
- 17 -
Mobile Printer
iOS SDK API Reference Guide
Inherits from
NSObject
Confirms to
Framework
BXPrinter.a
[Availability]
iOS 3.1.3 and later
Declared
BXBarcodeInfo.h
3. BXBarcode Class Reference
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.0 and later
3-2-2 name
Barcode Name
@property(readwrite) NSString * address
[Discussion]
Printer name is saved automatically by collecting information from the connected printer.
[Availability]
SDK 1.0.0 and later
3-2-3 support
The availability of the barcode.
@property BOOL support
[Discussion]
Printer name is saved automatically by collecting information from the connected printer.
[Availability]
SDK 1.0.0 and later
Rev. 1.00
Page 18
EM220II
- 18 -
Mobile Printer
iOS SDK API Reference Guide
Inherits from
NSObject
Confirms to
Framework
BXPrinter.a
[Availability]
iOS 3.1.3 and later
Declared
BXPrinterObject.h
4. BXPrinter Class Reference
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.0 and later
4-2-2 address
ConnectionID of printer
@property(readwrite) NSString * address
[Discussion]
Target Printer should be assigned first before connection.
[Availability]
SDK 1.0.0 and later
4-2-3 port
Only Wifi printer, MFI mode is not support
@property(readwrite) unsigned short port
[Availability]
SDK 1.0.0 and later
Rev. 1.00
Page 19
EM220II
- 19 -
Mobile Printer
iOS SDK API Reference Guide
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.
@property(readwrite) NSString * versionStr
[Discussion]
This value is updated by the checkPrinter method of BXPrinterController.
[Availability]
SDK 1.0.0 and later
4-2-6 macAddress
Mac Address of printer
@property(readwrite) NSString * macAddress
[Availability]
SDK 1.0.0 and later
4-2-7 connectionClass
Printer interface type.
This value represents the way that the printer is connected.
Refer 2-15 Connection Class.
@property(readwrite) unsigned short * connectionClass
[Availability]
SDK 1.0.0 and later
Rev. 1.00
Page 20
EM220II
- 20 -
Mobile Printer
iOS SDK API Reference Guide
Inherits from
NSObject
Confirms to
Framework
BXPrinter.a
[Availability]
iOS 3.1.3 and later
Declared
BXPrinter.h
5. BXPrinterController Class Reference
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.0 and later
5-2-2 delegate
Assign the object to apply BXPrinterControlDelegate method
@property(readwrite) id<BXPrinterControlDelegate> delegate
[Availability]
SDK 1.0.0 and later
5-2-3 target
Control target printer object
@property(readwrite) BXPrinter * target
[Discussion]
It is a control target printer object and should be assigned before starting printer control.
[Availability]
SDK 1.0.0 and later
Rev. 1.00
Page 21
EM220II
- 21 -
Mobile Printer
iOS SDK API Reference Guide
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.
[Availability]
SDK 1.0.0 and later
5-2-6 alignment
Horizontal alignment setting
@property(readwrite) int alignment
[Discussion]
Default value is set to left alignment, and this setting affects all output printing including
text and bar code.
[Availability]
SDK 1.0.0 and later
5-2-7 attribute
Text printing property
@property(readwrite) int attribute
[Discussion]
Refer to 2-5 Text Attribute
[Availability]
SDK 1.0.0 and later
Rev. 1.00
Page 22
- 22 -
Mobile Printer
iOS SDK API Reference Guide
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.
Refer to 2-2 International Character Set. Default value is set to BXL_CS_437.
[Availability]
SDK 1.0.0 and later
5-2-11 textEncoding
Type of the text Encoding.
@property(readwrite) long textEncoding
[Discussion]
Refer to NSStringEncoding in NSString.h
[Availability]
SDK 1.0.0 and later
EM220II
Rev. 1.00
Page 23
EM220II
- 23 -
Mobile Printer
iOS SDK API Reference Guide
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.0 and later
<Note>
※ Printer connection is controlled automatically without using connect/disconnect
function in the automatic connection mode.
※ Consecutive use of printText function may slow down the printing speed because
most functions have a connect/disconnect job at the beginning and end of it.
Use the manual connection mode to address this issue.
5-2-15 drawerPin
@property(assign) int drawerPin
[Discussion]
Refer to 2-12 Drawer kick-out connector pin.
[Availability]
SDK 1.0.0 and later
[Support Device]
Only thermal printer, EM220II is not support.
Rev. 1.00
Page 24
EM220II
- 24 -
Mobile Printer
iOS SDK API Reference Guide
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.
5-3 Instance Methods
5-3-1 getInstance
Method to obtain the BXPrinterController class instance
[Function prototype]
- (BXPrinterController)getInstance
[Return Value]
BXPrinterController class is created and returned automatically when this method is
called first time, and the existing BXPrinterController class is returned from the next time.
[Discussion]
Since BXPrinterController class uses only one instance in one process, user should
obtain and use it using this method instead of creating it.
[Availability]
SDK 1.0.0 and later
5-3-2 open
Initialization task for using BXPrinterController class (memory allocation and background
thread operation)
[Function prototype]
- (void)open
[Discussion]
- It should be called before calling main delegate of applications like
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.0 and later
5-3-4 lookup
The following printers will be searched.
- Paired bluetooth printers with iPhone
- Printers in the same WiFi network where iPhone is connected
[Function prototype]
- (void)lookup
[Discussion]
Start/End of search and searched printers can be obtained through BXPrinter
ControlDelegate.
Each iPhone has two network adaptors including 3G and WiFi networks, and the lookup
method searches WiFi only. No operation takes place when there is no connected WiFi.
[Availability]
SDK 1.0.0 and later
5-3-5 selectTarget
Initialization task for object of specified target.
[Function prototype]
- (long)selectTarget
- (long)selectTarget : (int) modelID
[Parameters]
modelID
- Select to type of printer.
- If you were not input, This is allocated automatically.
Refer to 2-14 Model ID.
[Return Value]
Refer to 2-16 Result Code
[Discussion]
Target of BXPrininterController property should be set in advance.
[Availability]
SDK 1.0.0 and later
Rev. 1.00
Page 26
EM220II
- 26 -
Mobile Printer
iOS SDK API Reference Guide
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).
[Availability]
SDK 1.0.0 and later
5-3-8 disconnectWithTimeout
Disconnects the connected printer.
If the data remained in the buffer, the data remained will be transmitted to the printer.
[Function prototype]
- (void)disconnectWithTimeout:(int)timeout
[Parameters]
int timeout
(timeout == 0)
The timeout is not used. Disconnects the connected printer immediately even if
the data exist in the buffer.
(timeout < 0)
The connection is not disconnected until the data remained in the buffer have
been transmitted to the printer. It takes long time if the data-size is too large
(timeout > 0)
If the data remained in the buffer, the data remained will be transmitted to the
printer within the timeout and then the connected printer will be disconnected.
[Availability]
SDK 1.0.0 and later
Rev. 1.00
Page 27
- 27 -
Mobile Printer
iOS SDK API Reference Guide
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.
No operation takes place when there is no connected printer.
[Function prototype]
- (long)printText:(NSString *)string
[Parameters]
string
Unicode data with null terminator. Print target text string
[Return Value]
Refer to 2-16 Result Code
[Discussion]
Tex alignment property should be set in advance.
[Availability]
SDK 1.0.0 and later
EM220II
Rev. 1.00
Page 28
- 28 -
Mobile Printer
iOS SDK API Reference Guide
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.0 and later
5-3-13 lineFeed
Perform line feed
[Function prototype]
- (void)linefeed:(int)lines
[Parameters]
lines
Number of lines to advance
[Return Value]
Refer to 2-16 Result Code
[Availability]
SDK 1.0.0 and later
EM220II
Rev. 1.00
Page 29
EM220II
- 29 -
Mobile Printer
iOS SDK API Reference Guide
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.0 and later
5-3-16 printBarcode
Print one-dimensional and two-dimensional bar code.
ANSI code data with null terminator. Transfer bar code data to print
symbology
Define bar code type.
width
Width of barcode, valid range is 2~7
Barcode printing may not work properly if the width of barcode print exceeds the
printer paper width.
This setting does not affect 2-dimensional bar code.
height
Height of bar code, unit is number of dot, range is 1~255
This setting does not affect 2-dimensional bar code.
Rev. 1.00
Page 30
- 30 -
Mobile Printer
iOS SDK API Reference Guide
alignment
Value
Description
0 ~ 100
Color level value
If fourth digit is 1
Enable diffusion processing
If fifth digit is 1
Image print using ESC * command
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.0 and later
5-3-17 printBitmap
Print image file
[Function prototype]
- (long)printBitmap:(NSString *)path
width:(long)width
alignment:(long)alignment
level:(long)level
[Parameters]
path
Path of image file
width
Width of image file to convert, valid setting range is 0 ~ max width
Image is resized with the given condition when the value is less than 0
Refer to 2-8 Image Width
alignment
Image alignment setting
Refer to 2-3 Image Alignment
level
Color level and diffusion processing option of image
EM220II
<Note> What is Error Diffusion?
It is a method to present the color image or black and white image with less number of
bits/pixel, which may produce few visible patterns such as a snake-like pattern for a certain
type of image but in general the capability of sharp representation is excellent.
Disadvantage is long processing type and this is because errors are measured and
amount of computing required for distribution the errors to neighbor pixels.
It is recommended to use the diffusion algorithm with this SDK.
[Return Value]
Refer to 2-16 Result Code
Rev. 1.00
Page 31
- 31 -
Mobile Printer
iOS SDK API Reference Guide
[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.0 and later
5-3-20 msrReadCancel
Release the „MSR Ready‟ state of printer
[Function prototype]
- (long)msrReadCancel
[Return Value]
Refer to 2-16 Result Code
[Availability]
SDK 1.0.0 and later
5-3-21 msrReadCancelEx
Releases „MSR Ready‟ state of the printer.
[Function prototype]
- (long)msrReadCancelEx
[Return Value]
Refer to 2-16 Result Code
[Availability]
SDK 1.0.0 and later
EM220II
Rev. 1.00
Page 32
EM220II
- 32 -
Mobile Printer
iOS SDK API Reference Guide
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.
All of data1, data2, data3 carry unallocated NSData *data, and NSData object is
allocated inside the method.
The allocated data1, data2, data3 are auto release ones and users do not have to
release them explicitly.
[Availability]
SDK 1.0.0 and later
5-3-23 msrGetTrack
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)msrGetTrack:(int)track
response:(NSData **)response
[Parameters]
track
MSR Data Track number 1 ~ 3
response
MSR Data Track value
[Return Value]
Refer to 2-16 Result Code
Rev. 1.00
Page 33
EM220II
- 33 -
Mobile Printer
iOS SDK API Reference Guide
[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.
[Function prototype]
- (long)msrReadFullTrack:(NSData **)response
[Parameters]
response
MSR Data Track value
[Return Value]
Refer to 2-16 Result Code
[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-25 directIO
Send or read user defined data.
[Function prototype]
- (long)directIO:(NSData *)request
response:(NSData **)response
[Parameters]
request
Data to be sent to printer, ANSI CODE data
response
response sent from printer is returned
[Return Value]
Refer to 2-16 Result Code
[Availability]
SDK 1.0.0 and later
Rev. 1.00
Page 34
EM220II
- 34 -
Mobile Printer
iOS SDK API Reference Guide
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.0 and later
5-3-27 icOFF
Turn off the power of the smart card reader of printer
[Function prototype]
- (long)icOFF
[Return Value]
Refer to 2-16 Result Code
[Availability]
SDK 1.0.0 and later
5-3-28 icApdu
Send APDU command and get response. It works only when the power is applied to the
printer smart card.
[Function prototype]
- (long)icApdu:(NSData **)request
response:(NSData **)response
[Parameters]
request
APDU command data to send to printer, ANSI CODE data
response
APDU response sent from printer is returned
[Return Value]
Refer to 2-16 Result Code
[Availability]
SDK 1.0.0 and later
Rev. 1.00
Page 35
- 35 -
Mobile Printer
iOS SDK API Reference Guide
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 *. The
images are provided in the form of autorelease, and developers do not have to
release it explicitly.
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.
images
Download target image object
width
Width of the image to print
When the setting is BXL_WIDTH_FULL, the image is printed with the
maximum width that can be printed by the printer.
Image is enlarged when the width of the image is smaller than the setting,
and reduced when it is bigger than the setting.
level
Color level and diffusion processing option of image
EM220II
<Note> What is Error Diffusion?
It is a method to present the color image or black and white image with less number of
bits/pixel, which may produce few visible patterns such as a snake-like pattern for a certain
type of image but in general the capability of sharp representation is excellent.
Disadvantage is long processing type and this is because errors are measured and
amount of computing required for distribution the errors to neighbor pixels.
It is recommended to use the diffusion algorithm with this SDK.
[Return Value]
Refer to 2-16 Result Code
[Discussion]
When the width of the image is wider than the width of printer, the image is resized
automatically.
[Availability]
SDK 1.0.0 and later
Rev. 1.00
Page 37
EM220II
- 37 -
Mobile Printer
iOS SDK API Reference Guide
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.
images
Download target image object
[Return Value]
Refer to 2-16 Result Code
[Discussion]
When the width of the image is wider than the width of printer, the image is resized
automatically.
The width value is set to BXL_WIDTH_FULL and the image data processed with 1050 of
level, 50% of brightness and error diffusion algorithm enable settings is downloaded.
[Availability]
SDK 1.0.0 and later
5-3-33 printNVImage
Print the image data to the designated address in NV area.
[Function prototype]
- (long)printNVImage:(int)address
[Parameters]
address
Image address in the range of 0 ~ 9
[Return Value]
Refer to 2-16 Result Code
[Discussion]
Image is not printed if image does not exist in the corresponding address.
[Availability]
SDK 1.0.0 and later
Rev. 1.00
Page 38
- 38 -
Mobile Printer
iOS SDK API Reference Guide
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.
[Function prototype]
- (long)removeAllNVImages
[Return Value]
Refer to 2-16 Result Code
[Availability]
SDK 1.0.0 and later
5-3-36 openDrawer
Open to the Cash Drawer.
[Function prototype]
- (long)openDrawer
[Return Value]
Refer to 2-16 Result Code
[Availability]
SDK 1.0.0 and later
EM220II
Rev. 1.00
Page 39
- 39 -
Mobile Printer
iOS SDK API Reference Guide
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.0 and later
5-3-39 isSupport_Config
Check whether a specific feature of the Config is supported.
[Function prototype]
- (BOOL)isSupport_Config
[Return Value]
If the feature of the config is supported, return TRUE.
[Availability]
SDK 1.0.0 and later
5-3-40 isSupport_CashDrawer
Check whether a specific feature of the CashDrawer is supported.
[Function prototype]
- (BOOL)isSupport_CashDrawer
[Return Value]
If the feature of the CashDrawer is supported, return TRUE.
[Availability]
SDK 1.0.0 and later
EM220II
Rev. 1.00
Page 40
- 40 -
Mobile Printer
iOS SDK API Reference Guide
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.0 and later
5-3-43 getBarcodeSupportTable
Check that the barcode print function is supported.
[Function prototype]
- (NSMutableArray*)getBarcodeSupportTable
[Return Value]
NSMutableArray that contains BXBarcode is returned.
[Availability]
SDK 1.0.0 and later
EM220II
Rev. 1.00
Page 41
- 41 -
Mobile Printer
iOS SDK API Reference Guide
Inherits from
NSObject
Confirms to
Framework
BXPrinter.a
[Availability]
iOS 3.1.3 and later
Declared
BXPrinteControlDelegater.h
6. BXPrinterControllerDelegate Protocol Reference
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.
[Function prototype]
- (void) didStart
[Parameters]
controller
BXPrinterController object that generates events
[Discussion]
It can be used to indicate the beginning of the use of printer class to users.
[Availability]
SDK 1.0.0 and later
6-2-2 didStop
It is called when class use is stopped using open method of BXPrinterController.
[Function prototype]
- (void) didStop
[Parameters]
controller
BXPrinterController object that generates events
[Discussion]
It can be used to indicate the termination of the use of printer class.
[Availability]
SDK 1.0.0 and later
EM220II
Rev. 1.00
Page 42
EM220II
- 42 -
Mobile Printer
iOS SDK API Reference Guide
6-2-3 didFindPrinter
This method is called for each individual printer when a printer is discovered from the
same network.
This is not called when user breaks the connection by calling the close method of
BXPrinterController explicitly. This method is called only when the connection is
interrupted by external problem other than user intervention.
Refer to the target property of BXPrinterController for the information of target printer.
[Availability]
SDK 1.0.0 and later
6-2-10 msrArrived
This method is called when MSR data arrives correctly in MSR Read mode.