Connect Method - Citizen CL-S700 Programming Manual

Android label print sdk
Hide thumbs Also See for CL-S700:
Table of Contents

Advertisement

2.2.3 connect method

Syntax
1) int connect (int connectType, String address)
2) int connect (int connectType, String address, int port)
3) int connect (int connectType, String address, int port, int timeout)
4) int connect (int connectType, UsbDevice device)
Parameters
Parameter
connectType
address
device
port
timeout
Description
This method is to connect to a printer. Specify an interface type and address.
The Bluetooth device address must be written in upper case.
When the Bluetooth device name is specified, it looks for a paired device which matches up.
When the Bluetooth device name is not specified, it looks for a paired/supported device automatically.
In case of using the Insecure Bluetooth connection after Android 2.3.3, use
CLS_PORT_Bluetooth_Insecure as connectType.
In case of USB device, the
The port number is effective only when CLS_PORT_WiFi is specified as connectType. The default
port number is 9100.
The timeout is to specify the maximum amount of time (in millisecond) to wait while attempting to
connect to the printer. This is not effective when CLS_PORT_USB is specified as connectType. The
default values are 4000 ms when WiFi, 8000 ms when Bluetooth.
When connecting, this method checks if the printer model is supported.
When the connection is no longer used, the disconnect method must be called. The next connection
will be failed otherwise.
Note
When connecting via USB for the first time, a dialog message for user permission pops up. Press OK
to continue.
[IN/OUT] Description
[IN]
Interface type
[IN]
IP address to connect or
Bluetooth device address or
Bluetooth device name
[IN]
UsbDevice class
(android.hardware.usb.UsbDevice)
[IN]
Port number
[IN]
Timeout (msec)
setContext method
A dialog message for user permission (example).
CITIZEN Android Label Print SDK — Programming Manual
Setting range
CLS_PORT_WiFi
CLS_PORT_Bluetooth
CLS_PORT_Bluetooth_Insecure
CLS_PORT_USB
WiFi: 0.0.0.0~255.255.255.255
Bluetooth:
00:00:00:00:00:00~
FF:FF:FF:FF:FF:FF
Device name (Automatic detection)
null: Automatic detection
UsbDevice: Any USB device
must be called beforehand.
17

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents