Seiko RP D10 iOS Programmers Guide
Seiko RP D10 iOS Programmers Guide
RP-D10, RP-E10
Print Class Library for iOS
Application Programmer's Guide
U00134990801
DPU-S245, DPU-S445, RP-D10, RP-E10 Print Class Library for iOS Application Programmer's Guide
IOS is a trademark or registered trade mark of Cisco in the U.S. and other countries and is used under
license.
iPad®, iPad Air®, iPad miniTM, iPhone®, iPod® are trademarks of Apple Inc., registered in the U.S. and
other countries.
App StoreSM is a service mark of Apple Inc.
SII reserves the right to make changes without notice to the specifications and materials contained
herein and shall not be responsible for any damages (including consequential) caused by reliance on the
materials presented, including but not limited to typographical, arithmetic, or listing errors.
Introduction
This manual describes the Print Class Library for iOS SDK (hereinafter referred to as "the SDK") for
the printers provided by Seiko Instruments Inc. (hereinafter referred to as "SII").
Target Printers
This section lists the printers supported by the SDK.
Description in
Interface Printer
This Manual
DPU-S245 Bluetooth DPU-S245-01B-E
Mobile Printer
DPU-S445 Bluetooth DPU-S445-01B-E
Bluetooth RP-D10-x27J2-Bx
RP-D10
Ethernet RP-D10-x27J1-Ex
RP-E10-x3FJ2-Bx
POS Printer Bluetooth
RP-E11-x3FJ2-Bx
RP-E10
RP-E10-x3FJ1-Ex
Ethernet
RP-E11-x3FJ1-Ex
Introduction-1
Table of Contents
TOC-2
(4) Method Details ........................................................................................ 4-43
SIIPrinterException Constructor ......................................................... 4-43
(5) Property Details....................................................................................... 4-29
errorCode Obtaining error codes ......................................... 4-43
errorMessage Obtain error message ......................................... 4-43
TOC-3
Chapter 1
Product Overview
Moreover, the SDK includes Xcode projects for iOS device as a sample.
The SII print class library (hereinafter referred to as "the library") and the sample programs included in
the SDK are located in the section surrounded by dashed lines in the iOS configuration diagram (Figure
1-1). The library consists of two classes: the class which produces printer commands, and the class
which controls communication port.
Figure 1-1
1-1
1.2.2 Function Provided by the Library
By using the library, applications can easily transmit commands and data to a printer through
communication port (Bluetooth or TCP/IP) on an iOS device. Also, applications can obtain printer status.
• Cut paper
(NOTE) *1: Commands that obtains the response from the printer are not available.
In order to obtain responses from a printer, use "Obtaining printer status" or
"Obtaining various responses from a printer".
1.2.3 Application Development Used for Communication with SII Printer by Bluetooth
When an application used for communication with Mobile printer or POS printer by Bluetooth is
registered to App Store, SII needs to apply it in advance. For the details, contact SII.
1-2
Chapter 2
Product Specification
2-1
Table 2-1 Operating Environment
F/W Version 2.01 or later 1.04 or later 2.01 or later 1.09 or later
later later
LAN Interface
- - - 1.13.01 or later - 1.13.01 or later
F/W Version
Interface Bluetooth Bluetooth Bluetooth Ethernet Bluetooth Ethernet
Communication
Bluetooth Bluetooth Bluetooth TCP/IP*1 Bluetooth TCP/IP*1
Port
OS
iOS 7.0 iOS 8.1 iOS 7.0 iOS 8.1 iOS 7.0 iOS 8.1 iOS 7.0 iOS 8.1 iOS 7.0 iOS 8.1
iOS Devise
iPhone 6 Plus - Supported - Supported - Supported - Supported - Supported
iPhone 5s Supported Supported Supported Supported Supported Supported Supported Supported Supported Supported
iPhone 5c Supported Supported Supported Supported Supported Supported Supported Supported Supported Supported
iPhone 5 Supported Supported Supported Supported Supported Supported Supported Supported Supported Supported
iPad Air Supported Supported Supported Supported Supported Supported Supported Supported Supported Supported
iPad
iPad mini 2 Supported Supported Supported Supported Supported Supported Supported Supported Supported Supported
iPad mini Supported Supported Supported Supported Supported Supported Supported Supported Supported Supported
iPad (4th
Supported Supported Supported Supported Supported Supported Supported Supported Supported Supported
generation)
Supported Supported Supported Supported Supported Supported Supported Supported Supported Supported
generation)
Supported Japanese
Language English
(NOTE) *1: Wireless LAN access point connected to iOS device and POS printer need to be connected to the same network.
2-2
2.1.2 Operating Conditions
This section describes the operating conditions for the library in Table 2-2 and Table 2-3.
Set the Function Setting/function selection to the values shown in each table before using the library.
See the technical reference of each printer for details about Function Setting/function selection.
Table 2-2 Function Setting of the DPU-S245/DPU-S445 When Using Bluetooth Connection
2.1.3 Precaution
When using TCP/IP connection in this library, the communication port cannot be shared with printer
drivers or other libraries.
2-3
Chapter 3
How to Use the Library
This chapter describes development environment for iOS application and how to use the library.
After this chapter, this manual describes on the assumption that the environment is arranged to use each
tool.
3-1
3.2 Provided Files
The file configuration of the SDK is as follows.
Figure 3-1
The file format of the library is Static Library. The file name of the library is libSIIPrinterManager.a.
3-2
3.3 Build the Library into Projects
Taking the project of the sample program (SIIPrinterManagerSample) included in the SDK as an example,
this section describes how to build the library into projects.
See "Chapter 5 Sample Program" for sample programs included in the SDK.
(b) Drag the following header file provided in [Project Navigator] of the navigation window as a
target object, to an arbitrary level. (Figure 3-2)
• SIIPrinterEnum.h
• SIIPrinterException.h
• SIIPrinterManager.h
Figure 3-2
(c) Build ExternalAccessory.framework into the project. Select the target project in [Project
Navigator], go [TARGETS] - [General] - [Linked Frameworks and Libraries], open [Linked
Frameworks and Libraries], click [+], and select ExternalAccessory.framework to build into.
(Figure 3-3)
(d) Build this library into the project. As well as the previous procedure, open [Linked Frameworks
and Libraries], click [+], and select this library to build into. (Figure 3-3)
Figure 3-3
3-3
(e) Add the import definition of *.h header file to use this library or header file provided by *.m
source file as follows.
#import "SIIPrinterManager.h"
(f) Set the protocol name used by ExternalAccessory.framework. Select xxxx.plist in [Project
Navigator].
(For the sample program in this SDK, see SIIPrinterManagerSample-Info.plist.)
From the popup menu, select [Add Row] - [Supported external accessory protocols].
When open the added [Supported external accessory protocols], [Item 0] is displayed so input
"com.sii-ps.siieap" as the value.
Figure 3-4
3-4
Chapter 4
Function of the Library
This chapter describes the APIs for each class implemented in the library.
4-1
4.3.1 SIIPrinterManager Class
4-2
(2) Property List
(a) Constants used when setting/obtaining international characters are shown in Table 4-3.
Table 4-3 Constant Name for International Character Setting
Target
Constant Name Description Value
Mobile POS
SII_PM_COUNTRY_USA U.S.A. 0 Supported Supported
SII_PM_COUNTRY_FRANCE France 1 Supported Supported
SII_PM_COUNTRY_GERMANY Germany 2 Supported Supported
SII_PM_COUNTRY_ENGLAND United Kingdom 3 Supported Supported
SII_PM_COUNTRY_DENMARK_1 DenmarkⅠ 4 Supported Supported
SII_PM_COUNTRY_SWEDEN Sweden 5 Supported Supported
SII_PM_COUNTRY_ITALY Italy 6 Supported Supported
SII_PM_COUNTRY_SPAIN Spain 7 Supported Supported
SII_PM_COUNTRY_JAPAN Japan 8 Supported Supported
SII_PM_COUNTRY_NORWAY Norway 9 Supported Supported
SII_PM_COUNTRY_DENMARK_2 DenmarkⅡ 10 Supported Supported
SII_PM_COUNTRY_SPAIN_2 SpainⅡ 11 Supported Supported
SII_PM_COUNTRY_LATIN_AMERICA Latin America 12 Supported Supported
SII_PM_COUNTRY_ARABIA Arabia 17 Not supported Supported
4-3
(b) Constants used when setting/obtaining codepage are shown in Table 4-4
4-4
(e) Connecting port type constant
Constants used when obtaining connecting port type are shown in Table 4-7.
4-5
(b) Underline (CharacterUnderline)
Enumerated type constants used for underline are shown in Table 4-10.
4-6
(e) Character Scale (CharacterScale)
Enumerated type constants used for character scale are shown in Table 4-13.
4-7
(f) Alignment (PrintAlignment)
Enumerated type constants used for alignment are shown in Table 4-14.
4-8
(h) Module size (ModuleSize)
Enumerated type constants used for module size are shown in Table 4-16.
Table 4-16 Module Size (ModuleSize)
Target
Constant Name Description Using Method
Mobile POS
SII_PM_BARCODE_MODULE_ Fine element 2 dots
Supported Supported
WIDTH_2 Module width 0.250 mm
SII_PM_BARCODE_MODULE_ Fine element 3 dots
Supported Supported
WIDTH_3 Module width 0.375 mm
SII_PM_BARCODE_MODULE_ Fine element 4 dots
printBarcode Supported Supported
WIDTH_4 Module width 0.500 mm
SII_PM_BARCODE_MODULE_ Fine element 5 dots
Not supported Supported
WIDTH_5 Module width 0.625 mm
SII_PM_BARCODE_MODULE_ Fine element 6 dots
Not supported Supported
WIDTH_6 Module width 0.750 mm
SII_PM_PDF417_MODULE_ Nominal fine element
Supported Supported
WIDTH_2 width 2 dots
SII_PM_PDF417_MODULE_ Nominal fine element
Supported Supported
WIDTH_3 width 3 dots
SII_PM_PDF417_MODULE_ Nominal fine element
Supported Supported
WIDTH_4 width 4 dots
SII_PM_PDF417_MODULE_ Nominal fine element
printPDF417 Supported Not supported
WIDTH_5 width 5 dots
SII_PM_PDF417_MODULE_ Nominal fine element
Supported Not supported
WIDTH_6 width 6 dots
SII_PM_PDF417_MODULE_ Nominal fine element
Supported Not supported
WIDTH_7 width 7 dots
SII_PM_PDF417_MODULE_ Nominal fine element
Supported Not supported
WIDTH_8 width 8 dots
SII_PM_QR_MODULE_SIZE_2 2 dots Supported Supported
SII_PM_QR_MODULE_SIZE_3 3 dots Supported Supported
SII_PM_QR_MODULE_SIZE_4 4 dots Supported Supported
SII_PM_QR_MODULE_SIZE_5 5 dots Supported Supported
SII_PM_QR_MODULE_SIZE_6 6 dots Supported Supported
printQRcode
SII_PM_QR_MODULE_SIZE_7 7 dots Supported Supported
SII_PM_QR_MODULE_SIZE_8 8 dots Supported Supported
SII_PM_QR_MODULE_SIZE_9 9 dots Supported Supported
SII_PM_QR_MODULE_SIZE_10 10 dots Supported Supported
SII_PM_QR_MODULE_SIZE_11 11 dots Supported Supported
4-9
(i) HRI character print position (HriPosition)
Enumerated type constants used for HRI character print position are shown in Table 4-17
4-10
(k) Error correction level (ErrorCorrection)
Enumerated type constants used for error correction level are shown in Table 4-19.
4-11
(m) QR code model (QrModel)
Enumerated type constants used for QR code model are shown in Table 4-21.
4-12
(5) Method Details
init Instance
Description This method starts communication between iOS device and paired printer through
Bluetooth connection. Call this method before using other methods of this class.
This method connects to the paired Bluetooth device (Bluetooth accessory) specified by
address parameter.
See Table 4-6 Printer Model Constant for available setting in printerModel parameter.
In order to operate this library properly, printer settings may be needed to change at the
connection in this method.
4-13
connect Start communicating with a printer (TCP/IP)
Description This method is valid only for POS printer. This method starts communication between iOS
device and printer connected to the same network through TCP/IP connection. Call this
method before using other methods of this class.
This method connects to the IP address specified by address parameter. TCP port
number 9100 is used for communication. Also, printer default settings are executed based
on printerModel parameter which is specified at the connection. See Table 4-6 Printer
Model Constant for available printer model constant in printerModel parameter.
In order to operate a printer properly, printer settings may be needed to change at the
connection in this method.
During connection with TCP/IP, the Library creates a socket when data
transmission/reception is necessary, and deletes one when unnecessary.
On the basis of data transmission completion time to a printer, a created socket is kept
until socket keeping time elapses that is set with socketKeepingTime property. The
same printer cannot be connected from other iOS application that uses this Library until
socket keeping time elapses.
After socket keeping time elapses, the socket is deleted temporarily but a socket is
created again when data is transmitted by method execution.
The Library deletes socket and disconnects the printer and TCP/IP connection by
executing disconnect method.
4-14
disconnect Disconnect a printer
Description This method sends the text data specified by text parameter to a printer. Data size that
can be specified at 1 time is 16K bytes (16384 bytes).
This method encodes the specified text data to printable text data based on the settings of
international character set and codepage, and then sends it to a printer.
In this method, the line spacing code is not added to the end of text data.
Error SIIPrinterException may be thrown when this method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
4-15
sendTextEx Send format specified text data
Description This method is valid only for Mobile printer. This method encodes format specified text
data to printable text data based on the settings of international character set or codepage,
and then sends it to a printer. Data size that can be specified at one time is 16K bytes
(16384 bytes).
See Table 4-9 Bold Print (CharacterBold) for available setting in bold parameter.
See Table 4-12 Character Font (CharacterFont) for available setting in font parameter.
See Table 4-13 Character Scale (CharacterScale) for available setting in scale
parameter.
In this method, no line feed code is added at the end of text data.
Error SIIPrinterException may be thrown when this method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
4-16
sendTextEx Send format specified text data
Description This method is valid only for POS printer. This method encodes format specified text data
to printable text data based on the settings of international character set or codepage, and
then sends it to a printer. Data size that can be specified at one time is 16K bytes (16384
bytes).
See Table 4-9 Bold Print (CharacterBold) for available setting in bold parameter.
See Table 4-11 Reverse Print (CharacterReverse) for available setting in reverse
parameter.
See Table 4-12 Character Font (CharacterFont) for available setting in font parameter.
See Table 4-13 Character Scale (CharacterScale) for available setting in scale
parameter.
In this method, no line feed code is added at the end of text data.
Error SIIPrinterException may be thrown when this method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
4-17
printBarcode Print barcode
See Table 4-16 Module Size (ModuleSize) for available setting in moduleWidth
parameter.
See Table 4-17 HRI Character Print Position (HriPosition) for available setting in
hriPosition parameter.
See Table 4-12 Character Font (CharacterFont) for available setting in hriFont
parameter.
4-18
See Table 4-18 N:W ratio (NwRatio) for available setting in nwRatio parameter.
Depending on the relationship between nwRatio parameter and moduleWidth
parameter, the wide element width is set in the following tables. See "Table 4-25 N:W
Ratio for Mobile Printer" for Mobile printer, and "Table 4-26 N:W Ratio for POS Printer" for
POS printer.
Error SIIPrinterException may be thrown when this method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
4-19
printPDF417 Print PDF417
Description This method prints PDF417. pdf417Symbol parameter for syntax (b) is fixed to standard
PDF417.
See Table 4-19 Error Correction Level (ErrorCorrection) for available setting in
errorCorrection parameter.
The valid range of row parameter is from 0 to 90. When 0 is specified, the number of row
is automatically set.
The valid range of column parameter is from 0 to 30. When 0 is specified, the number of
row in the data area is automatically set.
See Table 4-16 Module Size (ModuleSize) for available setting in moduleWidth
parameter.
The valid range of moduleHeight parameter is from 2 to 127. When make the module
height smaller, barcode reader may not read it. Specify 3 or higher in the normal use.
See Table 4-20 PDF417 Symbol (Pdf417Symbol) for available setting in pdf417Symbol
parameter.
Error SIIPrinterException may be thrown when this method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
4-20
printQRcode Print QR code
Description This method prints QR code. The type (a) is a QR code model 2 fixed.
Also the version for either type (a) or (b) is automatically set depends on the number of
data specified on text parameter.
See Table 4-19 Error Correction Level (ErrorCorrection) for available setting in
errorCorrection parameter.
See Table 4-16 Module Size (ModuleSize) for available setting in moduleSize
parameter.
See Table 4-21 QR Code Model (QrModel) for available setting in the model parameter.
Error SIIPrinterException may be thrown when this method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
Description This method is valid only for POS printer. This method cuts paper. Cutting paper is
executed after certain paper feed to avoid cutting the print data.
See Table 4-22 Cutting Method (CuttingMethod) for available setting in cuttingMethod
parameter.
Error SIIPrinterException may be thrown when this method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
4-21
openDrawer Open cash drawer
Description This method is valid only for POS printer. This method opens the specified cash drawer.
See Table 4-23 Drawer Number (DrawerNum) for available setting in drawerNum
parameter.
See Table 4-24 Activation Pulse Width (PulseWidth) for available setting in onOffTime
parameter.
Error SIIPrinterException may be thrown when this method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
Description This method is valid only for POS printer. This method sounds the buzzer.
Error SIIPrinterException may be thrown when this method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
Description This method sends the binary data which is specified by data parameter to a printer. Data
size that can be specified at a time is 16K bytes (16384 bytes).
By sending printer command as binary data with this method, printer functions which are
not supported in the library become available. However, this method does not support
commands which obtain responses from a printer.
4-22
Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
Description This method is valid only for Mobile printer. This method determines data format based on
the file extension specified by fileName parameter, converts it to printer-enabled data
format, and sends it to a printer. The maximum file size that can be specified is 1M byte
(1048576 bytes).
Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
4-23
sendDataFile Send specified file
Description This method is valid only for POS printer. This method determines data format based on
the file extension specified by fileName parameter, converts it to printer-enabled data
format, and sends it to a printer. The maximum file size that can be specified is 1M byte
(1048576 bytes).
The alignment is valid only when the file extension specified on fileName parameter
is .bmp, .jpg, .jpeg, .png, or .txt.
Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
4-24
getStatus Obtain printer status
Description This method obtains printer status. Status obtained from a printer is stored to an
NSInteger array. Contents of status vary between Mobile printer and POS printer.
4-25
The POS printer status is shown in Table 4-28.
Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending or receiving.
See isConnect property for verifying connection state.
4-26
abort Abort the waiting state of a printer
Description When sending of image data by sendDataFile method is aborted, a printer does not
accept other processes until specified image data is received completely. (Method or sent
data are misinterpreted and recognized as part of the image data.)
To solve this situation, use this method to abort the waiting state of a printer.
Note that when executing this method, a part of unprocessed image data may be printed.
Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
Description This method registers image data specified by fileName parameter to a printer as a logo.
File extension for image data supported by the parameter is .bmp, .jpg, jpeg, or .png.
The valid range of logoId parameter varies depends on the target printer.
For Mobile printer, the valid range is a character string indicating the value from 0 to 127.
For POS printer, specify by 2 characters. The valid characters are ASCII character code
from 20h (blank) to 7Eh (tilde) such as alphanumeric ('0' to '9', 'A' to 'Z', 'a' to 'z').
Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
4-27
printLogo Print specified logo (image) on printer
Description This method is valid only for Mobile printer. This method print the logo (image) registered
by registerLogo method. Specify registered logo ID in logoId parameter. The valid
range of logoId parameter is a character string indicating the value from 0 to 127.
Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
Description This method is valid only for POS printer. This method print the logo (image) registered by
registerLogo method. Specify registered logo ID in logoId parameter. The valid range
of logoId parameter is 2 characters. The valid characters are ASCII character code from
20h (blank) to 7Eh (tilde) such as alphanumeric ('0' to '9', 'A' to 'Z', 'a' to 'z').
See Table 4-14 Alignment (PrintAlignment) for available setting in alignment parameter.
Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
Description This method deletes the logo (image) registered by registerLogo method (for Mobile
printer). Specify registered logo ID in logoId parameter. The valid range of logoId
parameter varies depends on the target printer.
For Mobile printer, the valid range is a character string indicating the value from 0 to 127.
For POS printer, specify by 2 characters. The valid characters are ASCII character code
from 20h (blank) to 7Eh (tilde) such as alphanumeric ('0' to '9', 'A' to 'Z', 'a' to 'z').
Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
4-28
registerStyleSheet Register style sheet to a printer
Description This method is valid only for POS printer. This method registers CSS file specified by
fileName parameter to a printer. Maximum number of registerable style sheet is 4
sheets.
Style sheet supported by fileName parameter is that style sheet language is written in
CSS (cascading style sheets), and that file extension is .css.
Maximum number of style registerable to 1 CSS file is 64.
Also, the valid range of cssId parameter is from 1 to 4.
Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
Description This method is valid only for POS printer. This method deletes the style sheet registered
by registerStyleSheet method.
Specify the registered style sheet number for cssId parameter.
The valid range of cssId parameter is from 1 to 4.
Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
4-29
resetPrinter Printer hardware reset
Description This method is valid only for POS printer. This method is available only when specified
portType parameter is SII_PM_PRINTER_PORT_TYPE_TCP while executing connect
method. This method resets a connected printer by using the SII original command (reset
command) to TCP port number 26100. After executing this method, connection to a printer
is maintained.
Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending.
See isConnect property for verifying connection state.
Description This method stores the response data specified by responseId parameter to the object
specified by response parameter. See Table 4-8 Response Type Constant for available
constants for responseId parameter. Contents of obtainable response from a printer
vary between Mobile printer and POS printer.
4-30
Contents of obtained response for Mobile printer are shown in Table 4-29.
4-31
Contents of obtained response for POS printer are shown in Table 4-30.
Error SIIPrinterException may be thrown when the method is called. The printer may be
disconnected when SIIPrinterException is thrown during data sending or receiving.
See isConnect property for verifying connection state.
4-32
startDiscoveryPrinter Start printer search (Bluetooth)
Description This method searches Bluetooth device (Bluetooth accessory). This method calls
showBluetoothAccessoryPickerWithNameFilter of EAAccessoryManager
internally. When executing this method, paring with Bluetooth device is enable in the
displayed window.
Syntax - (void)startDiscoveryPrinter:(NSInteger)retryCount
timeout:(NSInteger)timeout
completion:(SIIDiscoveryPrinterCompletion)completion;
Description This method is valid only for POS printer. This method is available only when specified
portType parameter is SII_PM_PRINTER_PORT_TYPE_TCP while executing connect
method. This method sends local broad cast packet and search SII printer. Completion or
cancellation of searching is notified to a block specified in completion parameter as an
event.
This method sends local broad cast packet as the number of times specified in
retryCount parameter, and waits for response from the printer until the searching
timeout period specified in timeout parameter. The searching printer information can be
obtained by getFoundPrinter method.
In order to use this method, LAN interface F/W version needs to be 1.13.01 or later.
4-33
cancelDiscoveryPrinter Cancel printer search
Syntax - (void)cancelDiscoveryPrinter;
Description This method is valid only for POS printer. This method is available only when specified
portType parameter is SII_PM_PRINTER_PORT_TYPE_TCP while executing connect
method. This method cancels executing startDiscoveryPrinter method.
Cancellation of searching is notified to a block specified in completion parameter as an
event.
Parameter This method is valid only for POS printer. This method is available only when specified
portType parameter is SII_PM_PRINTER_PORT_TYPE_TCP while executing connect
method. This method returns the printer information searched by printer search as
NSArray type. For the details of printer information, see SIIPrinterInfo class
described later.
4-34
(6) Property Details
Description This property maintains the timeout period when data is sent. This property is configurable
or obtainable whether a printer is connected or not. However, the configured timeout
period is enabled at the next data sending. When the configured value is outside of the
valid range, 100 is set when the set value is lower than 100, or 300000 is set when the set
value is more than 300000.
Description This property maintains the timeout period when data is received. This property is
configurable or obtainable whether a printer is connected or not. When the configured
value is outside of the valid range, 100 is set when the set value is lower than 100, or
300000 is set when the set value is more than 300000.
Description This property maintains the configuration of international character set. When text data is
send by sendText method, sendTextEx method, or sendDataFile method, the print
result for the following character differs depending on the international character setting
value.
The character code differs depending on the international character setting value:
0x23, 0x24, 0x40, 0x5B, 0x5C, 0x5D, 0x5E, 0x60, 0x7B, 0x7C, 0x7D, 0x7E
See Table 4-3 Constant Name for International Character setting for details about
configurable values. When international character set is not configured, it is initialized to
following state depending on a language setting of an iOS device. Also, when invalid value
is specified, it is ignored.
4-35
codePage Code page
Description This property maintains setting values of codepage. The encoder used for sending text
data by sendText method, sendTextEx method, or sendDataFile method is changed
depends on the codepage setting. See Table 4-4 Constant Name for Codepage for the
details about configurable values. When a codepage is not configured, it is initialized to
the following state depending on a language setting of an iOS device. Also, when invalid
value is specified, it will be ignored.
Description This property obtains a model value for the connected printer. When a printer is not
connected, -1 is returned.
Return value See Table 4-6 Printer Model Constant for details.
Default -1
Description This property obtains the port type of connecting printer in use during connection with a
printer. When a printer is not connected, -1 is returned.
Return value See Table 4-7 Port Type Constant for details.
Default -1
Description This property maintains BOOL value with a printer. Maintains YES when a printer is
connected and NO when the printer is disconnected. When SIIPrinterException is
thrown during data sending and the printer is disconnected, NO is returned in this property.
When NO is returned, reconnect with the printer is needed by connect method.
Return value Following values are returned depending on the connection state with a printer.
4-36
YES Connected to a printer
NO Disconnected to a printer
Description This method is valid only for POS printer. This property maintains the setting of socket
keeping time during TCP/IP connection. For socket keeping time, set the same time as
Network Printer Receive. See "RP-D10/RP-E10 SERIES LAN INTERFACE TECHNICAL
REFERENCE" for more details about Network Printer Receive Timeout.
This property is configurable and obtainable whether a printer is connected or not.
However, socket keeping time is enabled at the next execution of connect method
(TCP/IP). Moreover, when configured value is outside of the valid range, set 6000 when
the set value is lower than 6000 and set 300000 when the set value is more than 300000.
4-37
4.3.2 SIIPrinterInfo Class
This class stores printer information searched by printer search method. This class obtains printer model,
MAC address, and IP address from the searched printer information.
This class stores the printer information searched by printer searching method. This class obtains printer
model, MAC address, and IP address from the searched printer information.
The list of methods provided by SIIPrinterInfo class is shown in Table 4-31.
The list of methods provided by the SIIPrinterInfo class is shown in Table 4-32.
SIIPrinterInfo Constractor
Syntax SIIPrinterInfo
Description This method is valid only for POS printer. This method is used for storing printer
information searched by printer searching method.
4-38
(4) Property Details
Description This property is valid only for POS printer. This property obtains printer model name
searched by printer searching method.
Description This property is valid only for POS printer. This property obtains MAC address searched
by printer searching method.
ip Obtain IP address
Description This property is valid only for POS printer. This property obtains IP address searched by
printer searching method.
4-39
4.3.3 SIIPrinterException Class
The list of property provided by the SIIPrinterException class is shown in Table 4-34
4-40
(3) Constant List
Constants used for obtaining error codes are shown in Table 4-35.
4-41
Target
Constant Name Description Value
Mobile POS
SII_PM_ERROR_ Inappropriate value specified for
-501 Not supported Supported
INVALID_NO style sheet number.
The number of style registered in
SII_PM_ERROR_
the specified file exceeds rated -502 Not supported Supported
OVER_STYLE_NUM
value (64).
SII_PM_ERROR_
Invalid parameter specified. -9999 Supported Supported
INVALID_PARAM
*1 Abnormality processing might have happened.
4-42
(4) Method Details
SIIPrinterException Constructor
Syntax SIIPrinterException
Description Exception class thrown when API for SIIPrinterManager class is called.
Return value See Table 4-29 Error Codes List for details.
Description This method obtains exception error message thrown. Character string to complement
errorCode property can be obtained.
4-43
Chapter 5
Sample Program
Figure 5-1 API Screen Figure 5-2 Setting Screen Figure 5-3 Status Screen
5-1
5.2 Sample Program Function
This section describes the functions of the sample program.
(1)
(2)
(3) (4)
(5) (6)
(7) (8)
(9) (10)
(11) (12)
(13) (14)
(15) (16)
(17) (18)
(19) (20)
(21) (22)
(23)
5-2
Functions of the sample program are shown in Table 5-1.
5-3
5.2.2 Setting Screen
(1)
(2)
(3)
(4)
(5)
5-4
No. Description Remarks
Sets codepage. This is the encoding and the character set
configuration value for printer side when printing texts (when
(5) Code page
text files are specified by the sendText method,
sendTextEx method, or the sendDataFile method).
(1)
(2)
(3)
5-5
5.3 Precaution
No guarantee of proper operation and support are provided for sample programs.
5-6
Chapter 6
Disclaimer
We closely monitor the development of this software in order to avoid problems. However, we are not
responsible for any damages arising out of the use of this software.
6-1