80
CITIZEN UWP POS Print SDK - Programming Manual
3.3.3. ConnectAsync method
Syntax
1)
Task<int> ConnectAsync (int connectType, String addr)
2)
Task<int> ConnectAsync (int connectType, String addr, int port)
3)
Task<int> ConnectAsync (int connectType, String addr, int port, int timeout)
Parameter
The meaning and the setting range of the parameters are as follows.
Value
[IN/OUT]
Meaning
Setting range
connectType
[IN]
Connection type of the
printer
CDP_PORT_WiFi
CDP_PORT_Bluetooth
addr
[IN]
IP address to connect
WiFi:
0.0.0.0
~
255.255.255.255
Bluetooth: 00:00:00:00:00:00~
FF:FF:FF:FF:FF:FF
port
[IN]
Connection port number
timeout
[IN]
Timeout (msec)
Description
This method is used to connect the line display. Please specify the type and address of the printer to
which the line display is connected.
Connection port number is valid only if you specify the connection type CDP_PORT_WiFi. If it is omitted,
it connects with number 9200.
Timeout is giving the maximum number of milliseconds to connect display. If it is omitted, it connects
with 4000 milliseconds in the case of Wi-Fi.
When communication with the line display is not necessary, must execute the
to disconnect the line display connection. When not disconnect, the next connection will be an error.
Return value
Return CDP_SUCCESS (0) in success. Please check the description of the error codes below in the case
of failure. Please refer to "
" for the error code except it.
Error codes
Description
CDP_E_NOTCONNECT (1003)
Failed connection to the line display.
(1) The line display is under none-connection status.
(2) The printer is not turned ON.
(3) Cannot obtain handle of interface board.
Example
await display.ConnectAsync(LineDisplayConst.CDP_PORT_
WiFi, "192.168.0.10");