76
CITIZEN UWP POS Print SDK - Programming Manual
3.
Linedisplay Control
3.1.
Program structure
Here is an example program in C# which uses the SDK
// Create an instance.
LineDisplay display = new LineDisplay();
// Connect Linedisplay
int result = await display.ConnectAsync(LineDisplayConst.CDP_PORT_WiFi,
"192.168.10.1");
if (LineDisplayConst.CDP_SUCCESS == result)
{
// Set encoding
display.SetEncoding("Shift_JIS");
// Clear text
await display.ClearDisplayAsync();
// Display text
await display.DisplayTextAsync("123456");
// Set cursor position
await display.SetCursorPosotionAsync(1,2);
// Display text (Reverse)
await display.DisplayTextAsync("123456",true);
// Disconnect
await display.DisconnectAsync();
}
else
{
// Connect Error
MessageDialog msgbox = new MessageDialog(
"Connect or LineDisplay Error : " + result.ToString(),
"Citizen_POS_sample1");
await msgbox.ShowAsync();
}
Class definition
Connect
Linedisplay
processes
Disconnect