Argox PT-9230 Owner's manual

PT-9230 Mobile Computer
SDK Programming Manual
DOC NO. UM-PT905-011
Nov. 2010
Version 1.0
©2010 ARGOXInformationCo.,Ltd.
http://www.argox.com

PT-9230 Mobile Computer SDK Programming Manual II
Table of Contents
OVERVIEW............................................................................................................................................................................................................................2
SDKFUNCTIONS...............................................................................................................................................................................................................3
SYSAPIAX.DLL....................................................................................................................................................................................................................4
A
UDIO
R
ELATED
F
UNCTIONS
...............................................................................................................................................................................7
Audio_GetVolume........................................................................................................................................................................7
Audio_SetVolume.........................................................................................................................................................................8
B
ATTERY
R
ELATED
F
UNCTION
.............................................................................................................................................................................9
GetBatteryStatus...........................................................................................................................................................................9
D
ISPLAY
R
ELATED
F
UNCTIONS
.........................................................................................................................................................................11
BacklightOn.................................................................................................................................................................................11
Display_QueryBacklightIntensity........................................................................................................................................12
GetBacklightStatus....................................................................................................................................................................14
PowerOnLCD...........................................................................................................................................................................15
SetBacklightPWM....................................................................................................................................................................16
K
EY
P
AD
R
ELATED
F
UNCTIONS
........................................................................................................................................................................17
EnablePowerButton.................................................................................................................................................................17
GetKeypadAlphaMode..........................................................................................................................................................18
SendKbdVisualKey...................................................................................................................................................................19
SetKeypadAlphaMode............................................................................................................................................................20
LED
R
ELATED
F
UNCTIONS
................................................................................................................................................................................21
GetKeypadLEDStatus.............................................................................................................................................................21
GoodReadLEDOn...................................................................................................................................................................22
KeypadLEDOn.........................................................................................................................................................................23
QueryKeypadLEDIntensity...................................................................................................................................................24
SetKeypadPWM.......................................................................................................................................................................26
S
YSTEM
R
ELATED
F
UNCTIONS
.........................................................................................................................................................................27
CallSuspend................................................................................................................................................................................27
EnableAutoConnect.................................................................................................................................................................28
RegisterAlphaKeyNotification..............................................................................................................................................29
ShowChineseIME.....................................................................................................................................................................30
ShowDesktop..............................................................................................................................................................................31
ShowExploreToolbar...............................................................................................................................................................32
ShowTaskbar..............................................................................................................................................................................33
UnRegisterAlphaKeyNotification........................................................................................................................................34
V
IBRATOR
R
ELATED
F
UNCTIONS
.....................................................................................................................................................................35

PT-9230 Mobile Computer SDK Programming Manual III
VibratorOn...................................................................................................................................................................................35
WLAN
R
ELATED
F
UNCTION
............................................................................................................................................................................36
WL_Enable.................................................................................................................................................................................36
WL_Disable................................................................................................................................................................................37
B
LUETOOTH
R
ELATED
F
UNCTION
...................................................................................................................................................................38
BT_On..........................................................................................................................................................................................38
BT_Off...........................................................................................................................................................................................39
SetDiscoverMode......................................................................................................................................................................40
GetDiscoverMode....................................................................................................................................................................41
SetSPPService............................................................................................................................................................................42
GetSPPService...........................................................................................................................................................................43
SetFTPService............................................................................................................................................................................44
GetFTPService..........................................................................................................................................................................45
SetFTPWriteable.......................................................................................................................................................................46
GetFTPWriteable......................................................................................................................................................................47
SetFTPShareFolder.................................................................................................................................................................48
GetFTPShareFolder................................................................................................................................................................49
InitSearchBTDevice.................................................................................................................................................................50
FindNextBTDevice...................................................................................................................................................................51
EndSearchBTDevice...............................................................................................................................................................53
InitSearchFTPDevice..............................................................................................................................................................54
FindFirstFTPDevice...............................................................................................................................................................55
FindNextFTPDevice...............................................................................................................................................................57
PairDevice...................................................................................................................................................................................59
UnPairDevice............................................................................................................................................................................60
GetComInfo................................................................................................................................................................................61
ConnectDevice...........................................................................................................................................................................63
GetConnectStatus......................................................................................................................................................................64
GetSPPClientChannel............................................................................................................................................................65
FindFirstFTPFile......................................................................................................................................................................66
FindNextFTPFile......................................................................................................................................................................67
GetFTPFile.................................................................................................................................................................................68
PutFTPFile.................................................................................................................................................................................69
CreateFTPFolder.....................................................................................................................................................................70
DeleteFTPFolder......................................................................................................................................................................71
DeleteFTPFile............................................................................................................................................................................72
B
LUETOOTH
S
TRUCTURE
...................................................................................................................................................................................73
CONNECT_INFOStructure...............................................................................................................................................73
FTP_FILEStructure................................................................................................................................................................74

PT-9230 Mobile Computer SDK Programming Manual IV
SCANAPIAX.DLL............................................................................................................................................................................................................75
API_SCAN
R
ELATED
F
UNCTIONS
.................................................................................................................................................................79
API_Register...............................................................................................................................................................................79
API_Unregister..........................................................................................................................................................................80
API_GetBarData......................................................................................................................................................................81
API_GetBarDataLength........................................................................................................................................................83
API_GetBarType.......................................................................................................................................................................84
API_GetError.............................................................................................................................................................................85
API_GetSysError......................................................................................................................................................................86
API_GoodRead.........................................................................................................................................................................87
API_LoadSettingsFromFile..................................................................................................................................................88
API_Reset....................................................................................................................................................................................89
API_ResetBarData..................................................................................................................................................................90
API_SaveSettingsToFile..........................................................................................................................................................91
API_SaveSettingsToScanner.................................................................................................................................................92
S2K_IsLoad................................................................................................................................................................................93
S2K_Load....................................................................................................................................................................................94
SCAN_QueryStatus..................................................................................................................................................................95
SCAN_SendCommand..........................................................................................................................................................96
SCAN_ResumeSystem............................................................................................................................................................97
SCAN_BatchSetting.................................................................................................................................................................98
SCAN_BatchRead....................................................................................................................................................................99
S
CAN
2K
EY
R
ELATED
F
UNCTIONS
.................................................................................................................................................................100
PT_OpenScan2Key...............................................................................................................................................................100
PT_CloseScan2Key...............................................................................................................................................................101
PT_SetToDefault.....................................................................................................................................................................102
S
CANNER
R
ELATED
F
UNCTIONS
....................................................................................................................................................................103
PT_EnableScanner................................................................................................................................................................103
PT_DisableScanner...............................................................................................................................................................104
PT_CheckBarcodeData.......................................................................................................................................................105
PT_GetBarcodeData............................................................................................................................................................106
PT_SetDefault..........................................................................................................................................................................108
S
CAN
K
EY
R
ELATED
F
UNCTIONS
..................................................................................................................................................................109
EnableTriggerKey...................................................................................................................................................................109
GetLibraryVersion..................................................................................................................................................................110
GetTriggerKeyStatus...............................................................................................................................................................111
PressTriggerKey......................................................................................................................................................................112
TriggerStatus.............................................................................................................................................................................113
S
CAN
S
TRUCTURE
...............................................................................................................................................................................................114

PT-9230 Mobile Computer SDK Programming Manual V
ScannerSettingStructure.......................................................................................................................................................114
GeneralSettingStructure.......................................................................................................................................................119
Code11_SettingStructure......................................................................................................................................................120
Code39_SettingStructure.....................................................................................................................................................121
Code93_SettingStructure.....................................................................................................................................................122
Code128_SettingStructure..................................................................................................................................................123
Codabar_SettingStructure...................................................................................................................................................124
EAN8_SettingStructure........................................................................................................................................................125
EAN13_SettingStructure......................................................................................................................................................126
Industrial25_SettingStructure.............................................................................................................................................127
Interleaved25_SettingStructure..........................................................................................................................................128
MSI_SettingStructure............................................................................................................................................................129
UK_SettingStructure..............................................................................................................................................................130
Telepen_SettingStructure......................................................................................................................................................131
UPCA_SettingStructure.......................................................................................................................................................132
UPCE_SettingStructure.......................................................................................................................................................133
Matrix25_SettingStructure..................................................................................................................................................134
PDF417_SettingStructure...................................................................................................................................................135
Code16K_SettingStructure.................................................................................................................................................136
ChinaPost_SettingStructure................................................................................................................................................137
RSS14_SettingStructure........................................................................................................................................................138
RSSLimited_SettingStructure..............................................................................................................................................139
RSSExpanded_SettingStructure........................................................................................................................................140
Pharmacode_SettingStructure...........................................................................................................................................141
MicroPDF_SettingStructure..............................................................................................................................................142
EANUCC_SettingStructure................................................................................................................................................143
IATA25_SettingStructure......................................................................................................................................................144
Trioptic_SettingStructure......................................................................................................................................................145
PosiCode_SettingStructure.................................................................................................................................................146
CodablockF_SettingStructure............................................................................................................................................147
Code49_SettingStructure.....................................................................................................................................................148
TLC39_SettingStructure.......................................................................................................................................................149
Planet_SettingStructure........................................................................................................................................................150
Postnet_SettingStructure......................................................................................................................................................151
AustralianPost_SettingStructure........................................................................................................................................152
BritishPost_SettingStructure...............................................................................................................................................153
CanadianPost_SettingStructure........................................................................................................................................154
JapanesePost_SettingStructure..........................................................................................................................................155
KIXPost_SettingStructure....................................................................................................................................................156

PT-9230 Mobile Computer SDK Programming Manual VI
KoreaPost_SettingStructure................................................................................................................................................157
USPS_SettingStructure.........................................................................................................................................................158
UPU_SettingStructure..........................................................................................................................................................159
Aztec_SettingStructure..........................................................................................................................................................160
DataMatrix_SettingStructure.............................................................................................................................................161
MaxiCode_SettingStructure................................................................................................................................................162
QRCode_SettingStructure...................................................................................................................................................163
ChineseSensible_SettingStructure.....................................................................................................................................164
SCANCOMMANDTABLE....................................................................................................................................................................................165
FUNCTIONRETURNVALUES..........................................................................................................................................................................177

PT-9230 Mobile Computer SDK Programming Manual 2
Overview
The Argox PT-90 Mobile Computer Software Developer Kit (SDK) Programming Manual is
prepared to assist programmers on developing application programs using Argox PT-90 Mobile
Computers under Microsoft® Windows® CE6.0 Operating System. It gives all the details needed
to call functional subroutines controling the devices on the Argox PT-90 Mobile Computer or
access value-added devices on board such as Scanning and Wireless module.
This Programming Manual is organized as two major sections, one for the system related functions
and the other for value-added scanning functions with the following information:
•Argox Mobile Computer standard Application Programming Interface (API) Definitions
for system related functions:
Audio
Display
Keypad
Led and Vibrator Indicators
Battery Status
System Settings
Bluetooth
WLAN
•Argox Scanning module Application Programming Interface (API) Definitions
API definitions illustrate how to call a given functional subroutine. The API definitions are
structed with information including: prototypes, parameters, return values, examples, and
requirements of each API. The “Requirements” section gives information on whether or not a
device supports a specific API function and the files to be included.

PT-9230 Mobile Computer SDK Programming Manual 3
SDKFunctions
When using SDK to develop their own application program, the programmer should link DLL file
or LIB file, then, include header file SYSAPIAX.H.
The following two examples are given to show how to use LIB file and DLL file while developing
an application program. We will use Visual Studio 2005 to illustrate.
Example 1: Using LIB file.
First, programmer should include sysapiax.lib in the application project.
#include "Sysapiax.h"
main()
{
. . . . .
SetBacklightPWM(100, 100);
. . . . .
}
Example 2: Using DLL file.
HINSTANCE dllHandle = NULL;
typedef DWORD (_stdcall *pfnSetBacklightPWM)(int nACPowerPercent, int
nBatteryPercent);
pfnSetBacklightPWM m_SetBacklightPWM;
main()
{
dllHandle = LoadLibrary(L"SYSAPIAX.dll");
m_SetBacklightPWM = (pfnSetBacklightPWM) ::GetProcAddress(dllHandle,
_T("SetBacklightPWM"));
m_SetBacklightPWM(0, 0);
FreeLibrary(dllHandle);
}

PT-9230 Mobile Computer SDK Programming Manual 4
SYSAPIAX.DLL
In PT-90 SDK, we provide SYSAPIAX.DLL which includes several functions to allow
programmer to control device drivers and system functions. Programmer can use WINCE develop
tool like Visual Studio 2005 to develop application programs. Descriptions of all these functions
are given below.
Audio Related Functions
Audio_GetVolume – Query current volume setting.
Audio_SetVolume – Set level of audio volume.
Battery Related Function
GetBatteryStatus – Gets main battery status.
Display Related Functions
BacklightOn – Turn ON or OFF screen backlight.
Display_QueryBacklightIntensity – Query back-light intensity.
GetBacklightStatus – Gets screen backlight status.
PowerOnLCD – Turn ON or OFF the power of LCD.
SetBacklightPWM – Adjusts screen back-light brightness.
KeyPad Related Functions
EnablePowerButton – ENABLE or DISABLE Power button.
GetAlphaMode – Get the current keypad input MODE.
SendKbdVisualKey – Sends a virtual key to key buffer.
SetAlphaMode – Change keypad input MODE.
LED Related Functions
GetKeypadLEDStatus – Gets keypad backlight LED status.
GoodReadLEDOn – Turn ON or OFF good read LED.
KeypadLEDOn – Turn ON or OFF keypad backlight LED.
QueryKeypadLEDIntensity – Query keypad backlight LED brightness.
SetKeypadPWM – Adjusts keypad backlight LED brightness.
System Related Functions
CallSuspend – Enter SUSPEND mode.
EnableAutoConnect – Turn auto-connect ON or OFF.

PT-9230 Mobile Computer SDK Programming Manual 5
RegisterAlphaKeyNotification – Register a request to send a prompt message
when the ALPHA key is pressed.
ShowChineseIME – DISPLAY or HIDE the Chinese IME.
ShowDeskTop – DISPLAY or HIDE all icons on desktop.
ShowExploreToolbar – DISPLAY or HIDE toolbar on windows explorer.
ShowTaskbar – DISPLAY or HIDE taskbar.
UnregisterAlphaKeyNotification – UNREGISTER prompt message request.
Vibrator Related Functions
VibratorOn – ON or OFF vibration indicator.
WLAN Related Functions
WL_Enable – ENABLE WLAN.
WL_Disable – DISABLE WLAN.
BlueTooth Related Functions
BT_On – Enable Bluetooth.
BT_Off – Disable Bluetooth.
SetDiscoverMode – Enable/Disable the terminal is discoverable.
GetDiscoverMode –Query terminal discoverable status.
SetSPPService – Enable/Disable SPP Service.
GetSPPService –Query SPP Service.
SetFTPService – Enable/Disable FTP service.
GetFTPService – Query FTP service status.
SetFTPWriteable – Enable/Disable FTP service writeable.
GetFTPWriteable – Query FTP service writeable status.
SetFTPShareFolder – Setup the FTP share folder in terminal.
GetFTPShareFolder – Query current FTP share folder in terminal.
InitSearchBTDevice – Initial search information.
FindNextBTDevice – retrieves the results of an Bluetooth device.
EndSearchBTDevice – frees the search handle.
InitSearchFTPDevice – Initial search the device supported FTP service.
FindFirstFTPDevice – Get first device supported FTP service position.
FindNextFTPDevice – Get next device supported FTP service position.
PairDevice – Pair with device.
UnPairDevice – Unpair with device.
GetComInfo – Get com identifier index and amount.
ConnectDevice – Connect to Bluetooth device for SPP or FTP.

PT-9230 Mobile Computer SDK Programming Manual 6
GetConnectStatus – Query the device connected status.
GetSPPClientChannel – Get SPP channel.
FindFirstFTPFile – Get first file information from share folder in connected
device.
FindNextFTPFile – Get next file information from share folder in connected
device.
GetFTPFile – Get file from share folder in the connected device.
PutFTPFile – Send file to share folder in the connected device.
CreateFTPFolder – Create a new folder to share folder in the connected device.
DeleteFTPFolder – Delete folder from share folder in connected device.
DeleteFTPFile – Delete file from share folder in connected device.
Bluetooth Structure
CONNECT_INFO Structure – CONNECT_INFO Information used by
ConnectDevice.
FTP_FILE Structure – FTP_FILE Information used by FindFirstFTPFile and
FindNextFTPFile.

PT-9230 Mobile Computer SDK Programming Manual 7
AudioRelatedFunctions
Audio_GetVolume
Toquerythecurrentaudiovolumelevelsetting.
DWORDAudio_GetVolume
{
LPDWORDlpdwVolume
}
Parameters
lpdwVolume
[out]Thecurrentvolumelevelsetting.
ReturnedValues
Ifthisactionsucceeds,thereturnedvalueisE_FUNC_SUCCEED.Ifthisactionfails,thereturnedvalueis
E_FUNC_ERROR.
Example
DWORDdwResult,dwVolume;
dwResult=Audio_GetVolume(&dwVolume);
if(dwResult!=E_FUNC_SUCCEED)
AfxMessageBox(_T("Audio_GetVolumefail"));
else
{
CStringstrTemp;
strTemp.Format(_T("Volume: %d"),dwVolume);
AfxMessageBox(strTemp);
}
Requirements
OSVersions:WindowsCE6.0orbeyond.
Header:sysapiax.h
LinkLibrary:sysapiax.lib
LinkDLL:sysapiax.dll
Device:PT90

PT-9230 Mobile Computer SDK Programming Manual 8
Audio_SetVolume
Tosettheaudiovolumelevel.
DWORDAudio_SetVolume
{
DWORDdwVolume
}
Parameters
dwVolume
[in]Specifiesanewvolumelevelsetting.Thedefaultlevelis0x99999999.
ReturnedValues
Ifthisactionsucceeds,thereturnedvalueisE_FUNC_SUCCEED.Ifthisactionfails,thereturnedvalueis
E_FUNC_ERROR.
Example
DWORDdwResult,dwVolume;
dwVolume=0x11111111;
dwResult=Audio_SetVolume(dwVolume);
if(dwResult!=E_FUNC_SUCCEED)
AfxMessageBox(_T("Audio_SetVolumefail"));
Requirements
OSVersions:WindowsCE6.0orbeyond.
Header:sysapiax.h
LinkLibrary:sysapiax.lib
LinkDLL:sysapiax.dll
Device:PT90

PT-9230 Mobile Computer SDK Programming Manual 9
BatteryRelatedFunction
GetBatteryStatus
Togetmainbatterystatus.
intGetBatteryStatus
{
}
Parameters
None.
ReturnedValues
Thereturnvaluecanbeoneofthevaluesinthefollowingtable.
Returnvalue Description
0 batteryhigh
1 batterylow
2 batterycritical
3 batterycharging
4 nobattery
5 batteryunknown
Example
switch(GetBatteryStatus())
{
case0:
AfxMessageBox(_T("BatteryHigh"));
break;
case1:
AfxMessageBox(_T("BatteryLow"));
break;
case2:
AfxMessageBox(_T("BatteryCritical"));
break;
case3:
AfxMessageBox(_T("BatteryCharging"));

PT-9230 Mobile Computer SDK Programming Manual 10
break;
case4:
AfxMessageBox(_T("NoBattery"));
break;
case5:
AfxMessageBox(_T("BatteryUnknown"));
break;
}
Requirements
OSVersions:WindowsCE6.0orbeyond.
Header:sysapiax.h
LinkLibrary:sysapiax.lib
LinkDLL:sysapiax.dll
Device:PT90

PT-9230 Mobile Computer SDK Programming Manual 11
DisplayRelatedFunctions
BacklightOn
ToturnONorOFFtheLCDscreenback-light.
DWORDBacklightOn
{
BOOLbOn
}
Parameters
bOn
[in]FlagthatindicateswhethertoturnONscreenback-light(TRUE)orturnOFFscreen
back-light(FALSE).
ReturnedValues
Ifthisactionsucceeds,thereturnedvalueisE_FUNC_SUCCEED.Ifthisactionfails,thereturnedvalueis
E_FUNC_ERROR,E_FUNC_PAR_ERROR.
Remarks
AfterthisactionturningONorOFFthescreenback-light,theback-lightwillbealwaysONorOFF.Theback-light
settingofdisplaypropertiesincontrolpaneldoesnotworkuntiltheterminalbeenreseted.
Example
DWORDdwResult;
dwResult=BacklightOn(TRUE);
if(dwResult!=E_FUNC_SUCCEED)
AfxMessageBox(_T("BacklightOnfail"));
Requirements
OSVersions:WindowsCE6.0orbeyond.
Header:sysapiax.h
LinkLibrary:sysapiax.lib
LinkDLL:sysapiax.dll
Device:PT90

PT-9230 Mobile Computer SDK Programming Manual 12
Display_QueryBacklightIntensity
Toreturntheback-lightintensityofexternalpowerandbatterypower.
DWORDDisplay_QueryBacklightIntensity
{
LPDWORDlpdwACBacklight,
LPDWORDlpdwBatteryBacklight
}
Parameters
lpdwACBacklight
[out]Thebacklightintensityofexternalpower.
lpdwBatteryBacklight
[out]Thebacklightintensityofbatterypower.
ReturnedValues
Ifthisactionsucceeds,thereturnedvalueisE_FUNC_SUCCEED.Ifthisactionfails,possiblereturnedvaluesare
E_FUNC_ERROR,E_FUNC_NULLPTR.
Remarks
Theparameterswillbeoneofthevaluesinthefollowingtable.
Backlightintensity Backlightbrightness
4 super
3 normal
2 fine
1 micro
0 off
Example
DWORDdwResult,dwValue1,dwValue2;
dwResult=Display_QueryBacklightIntensity(&dwValue1,&dwValue2);
if(dwResult!=E_FUNC_SUCCEED)
AfxMessageBox(_T("Display_QueryBacklightIntensityfail"));
else
{
CStringstrTemp;
strTemp.Format(_T("ACbacklightintensity:%d,Batterybacklightintensity: %d"),dwValue1,

PT-9230 Mobile Computer SDK Programming Manual 13
dwValue2);
AfxMessageBox(strTemp);
}
Requirements
OSVersions:WindowsCE6.0orbeyond.
Header:sysapiax.h
LinkLibrary:sysapiax.lib
LinkDLL:sysapiax.dll
Device:PT90

PT-9230 Mobile Computer SDK Programming Manual 14
GetBacklightStatus
Togetscreenback-lightstatus.
DWORDGetBacklightStatus
{
}
Parameters
None.
ReturnedValues
Thereturnedvalueindicateswhetherscreenback-lightis:
1=screenback-lightisON;or
0=screenback-lightisoOFF.
Example
DWORDdwResult;
dwResult=GetBacklightStatus();
if(dwResult==1)
AfxMessageBox(_T("Backlighton"));
else
AfxMessageBox(_T("Backlightoff"));
Requirements
OSVersions:WindowsCE6.0orbeyond.
Header:sysapiax.h
LinkLibrary:sysapiax.lib
LinkDLL:sysapiax.dll
Device:PT90

PT-9230 Mobile Computer SDK Programming Manual 15
PowerOnLCD
ToturnONorOFFtheLCDscreenpower.
DWORDPowerOnLCD
{
BOOLbOn
}
Parameters
bOn
[in]FlagthatindicateswhetherturnonLCDpower(TRUE)orturnoffLCDpower(FALSE).
ReturnedValues
Ifthisactionsucceeds,thereturnedvalueisE_FUNC_SUCCEED.Ifthisactionfails,possiblereturnedvaluesare
E_FUNC_ERROR,E_FUNC_PAR_ERROR.
Remarks
Aftercallingthisfunctionwith“bOn”FALSE,terminalwillonlyturnOFFtheLCDpower.Itmeansthatterminal
isstillworking.YoushouldeithercallthisfunctionagaintoturnONtheLCDpowerortoresetterminaltousethe
terminalwiththeLCDscreenON.
Example
DWORDdwResult;
dwResult=PowerOnLCD(FALSE);//poweroffLCD
if(dwResult!=E_FUNC_SUCCEED)
AfxMessageBox(_T("PowerOnLCDfail"));
Sleep(3000);
dwResult=PowerOnLCD(TRUE);//poweronLCD
if(dwResult!=E_FUNC_SUCCEED)
AfxMessageBox(_T("PowerOnLCDfail"));
Requirements
OSVersions:WindowsCE6.0orbeyond.
Header:sysapiax.h
LinkLibrary:sysapiax.lib
LinkDLL:sysapiax.dll
Device:PT90
Table of contents
Other Argox Handheld manuals