Argox PT-80 Owner's manual

PT-80 Mobile Computer
Programming Manual
DOC NO. UM-PT805-02
Aug. 2007
Version 1.0

Programming Manual II
Table of Contents
OVERVIEW....................................................................................................................................................................................................................................1
SDKFUNCTIONS......................................................................................................................................................................................................................2
SYSAPIAX.DLL............................................................................................................................................................................................................................3
AUDIORELATEDFUNCTIONS......................................................................................................................................................................................5
Audio_GetVolume..............................................................................................................................................................................5
Audio_SetVolume...............................................................................................................................................................................6
BATTERYRELATEDFUNCTION...................................................................................................................................................................................7
GetBatteryStatus..................................................................................................................................................................................7
DISPLAYRELATEDFUNCTIONS..................................................................................................................................................................................9
BacklightOn..........................................................................................................................................................................................9
Display_QueryBacklightIntensity.............................................................................................................................................10
GetBacklightStatus..........................................................................................................................................................................12
PowerOnLCD..................................................................................................................................................................................13
SetBacklightPWM...........................................................................................................................................................................14
KEYPADRELATEDFUNCTIONS...............................................................................................................................................................................15
EnablePowerButton.......................................................................................................................................................................15
GetKeypadAlphaMode................................................................................................................................................................16
SendKbdVisualKey.........................................................................................................................................................................17
SetKeypadAlphaMode..................................................................................................................................................................18
LEDRELATEDFUNCTIONS.......................................................................................................................................................................................19
GetKeypadLEDStatus...................................................................................................................................................................19
GoodReadLEDOn.........................................................................................................................................................................20
KeypadLEDOn................................................................................................................................................................................21
SYSTEMRELATEDFUNCTIONS................................................................................................................................................................................22
CallSuspend.......................................................................................................................................................................................22
EnableAutoConnect.......................................................................................................................................................................23
RegisterAlphaKeyNotification....................................................................................................................................................23
ShowChineseIME...........................................................................................................................................................................25
ShowDesktop....................................................................................................................................................................................26
ShowExploreToolbar.....................................................................................................................................................................27
ShowTaskbar.....................................................................................................................................................................................28
UnRegisterAlphaKeyNotification.............................................................................................................................................29

SCANAPIAX.DLL...................................................................................................................................................................................................................30
API_SCANRELATEDFUNCTIONS.......................................................................................................................................................................32
API_Register......................................................................................................................................................................................32
API_Unregister................................................................................................................................................................................33
API_GetBarData............................................................................................................................................................................34
API_GetBarDataLength..............................................................................................................................................................36
API_GetBarType.............................................................................................................................................................................37
API_GetError...................................................................................................................................................................................38
API_GetSysError............................................................................................................................................................................39
API_GoodRead...............................................................................................................................................................................40
API_LoadSettingsFromFile........................................................................................................................................................41
API_Reset...........................................................................................................................................................................................41
API_ResetBarData.........................................................................................................................................................................43
API_SaveSettingsToFile................................................................................................................................................................44
API_SaveSettingsToScanner......................................................................................................................................................45
S2K_IsLoad.......................................................................................................................................................................................46
S2K_Load...........................................................................................................................................................................................47
SCAN_QueryStatus........................................................................................................................................................................48
SCAN_SendCommand................................................................................................................................................................49
SCAN2KEYRELATEDFUNCTIONS.........................................................................................................................................................................50
PT_OpenScan2Key.......................................................................................................................................................................50
PT_CloseScan2Key.......................................................................................................................................................................51
PT_SetToDefault..............................................................................................................................................................................52
SCANNERRELATEDFUNCTIONS.............................................................................................................................................................................53
PT_EnableScanner........................................................................................................................................................................53
PT_DisableScanner.......................................................................................................................................................................54
PT_CheckBarcodeData...............................................................................................................................................................55
PT_GetBarcodeData....................................................................................................................................................................56
PT_SetDefault...................................................................................................................................................................................58
SCANKEYRELATEDFUNCTIONS...........................................................................................................................................................................59
EnableTriggerKey...........................................................................................................................................................................59
GetLibraryVersion...........................................................................................................................................................................60
GetTriggerKeyStatus......................................................................................................................................................................61
PressTriggerKey...............................................................................................................................................................................62
TriggerKeyStatus..............................................................................................................................................................................63
SCANCOMMANDTABLE.............................................................................................................................................................................................64
FUNCTIONRETURNVALUES...................................................................................................................................................................................73
Programming Manual III

Overview
The Argox Mobile Computer Software Developer Kit (SDK) Help is intended to assist
programmers with the creation of applications for Argox Mobile Computers running a Microsoft®
Windows® .NET CE4.2 Operating System. It gives all of the details necessary for calling
functions which control the devices on the Argox Mobile Computer or access the Value-added
device module, such as Scanning and Wireless.
The help file is organized into two sections, one is the system related, and the other one is the
value-added scanning functions providing the following information:
•Argox Mobile Computer standard Application Programming Interface (API) Definitions
for system related.
Audio
Display
Keypad
Led Indicators
Battery Status
System Settings
•Argox Scanning device Application Programming Interface (API) Definitions
API definitions illustrate how to call a given function. The API definitions are structed with some
information including prototypes, parameters, return values, examples and requirements for each
API. The “Requirements” section gives the information on whether or not a device supports a
specific API function and the files to be included.
Programming Manual 1

SDKFunctions
When user wants to use SDK to develop their own program, they should link DLL file or LIB file,
and include header file SYSAPIAX.H.
There are two examples to show how to use LIB file and DLL file on their project. We will use
Visual Studio 2005 to explain.
Example 1: Using LIB file.
At first you should include sysapiax.lib in your 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);
}
Programming Manual 2

SYSAPIAX.DLL
In this SDK, we supply SYSAPIAX.DLL which includes 18 functions to allow programmer to
control device drivers and system functions. User can use WINCE develop tool like Visual Studio
2005 to develop application program. The function description is given below.
Audio Related Functions
zAudio_GetVolume – Query the current volume setting.
zAudio_SetVolume – Set the volume setting.
Battery Related Function
zGetBatteryStatus – Gets main battery status.
Display Related Functions
zBacklightOn – Turn on or off screen backlight.
zDisplay_QueryBacklightIntensity – Query backlight intensity.
zGetBacklightStatus – Gets screen backlight status.
zPowerOnLCD – Turn on or off LCD power.
zSetBacklightPWM – Adjusts screen backlight brightness.
KeyPad Related Functions
zEnablePowerButton – Enable and disable power button.
zGetAlphaMode – Get the current input mode.
zSendKbdVisualKey – Sends a visual key to key buffer.
zSetAlphaMode – Change input mode.
LED Related Functions
zGetKeypadLEDStatus – Gets keypad LED status.
zGoodReadLEDOn – Turn on and off good read LED.
zKeypadLEDOn – Turn on or off keypad LED.
System Related Functions
zCallSuspend – Enter suspend mode.
zEnableAutoConnect – Turn auto-connect on and off.
zRegisterAlphaKeyNotification – Register a request with send a message when
the alpha key pressed.
zShowChineseIME – Display and hide the Chinese IME.
Programming Manual 3

zShowDeskTop – Display and hide all icons on desktop.
zShowExploreToolbar – Display and hide toolbar on windows explorer.
zShowTaskbar – Display and hide taskbar.
zUnregisterAlphaKeyNotification – Unregister message request.
Programming Manual 4

AudioRelatedFunctions
Audio_GetVolume
Thisfunctionqueriesthecurrentvolumesetting.
DWORDAudio_GetVolume
{
LPDWORDlpdwVolume
}
Parameters
lpdwVolume
[out]Thecurrentvolumesetting.
ReturnValues
Iffunctionsucceeds,thereturnvalueisE_FUNC_SUCCEED.Iffunctionfails,thereturnvalueis
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:WindowsCE4.2andlater.
Header:sysapiax.h
LinkLibrary:sysapiax.lib
LinkDLL:sysapiax.dll
Device:PT80
Programming Manual 5

Audio_SetVolume
Thisfunctionsetsthecurrentvolumesetting.
DWORDAudio_SetVolume
{
DWORDdwVolume
}
Parameters
dwVolume
[in]Specifiesanewvolumesetting.Thedefaultsettingis0x99999999.
ReturnValues
Iffunctionsucceeds,thereturnvalueisE_FUNC_SUCCEED.Iffunctionfails,thereturnvalueis
E_FUNC_ERROR.
Example
DWORDdwResult,dwVolume;
dwVolume=0x11111111;
dwResult=Audio_SetVolume(dwVolume);
if(dwResult!=E_FUNC_SUCCEED)
AfxMessageBox(_T("Audio_SetVolumefail"));
Requirements
OSVersions:WindowsCE4.2andlater.
Header:sysapiax.h
LinkLibrary:sysapiax.lib
LinkDLL:sysapiax.dll
Device:PT80
Programming Manual 6

BatteryRelatedFunction
GetBatteryStatus
Thisfunctiongetsmainbatterystatus.
intGetBatteryStatus
{
}
Parameters
None.
ReturnValues
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"));
Programming Manual 7

break;
case4:
AfxMessageBox(_T("NoBattery"));
break;
case5:
AfxMessageBox(_T("BatteryUnknown"));
break;
}
Requirements
OSVersions:WindowsCE4.2andlater.
Header:sysapiax.h
LinkLibrary:sysapiax.lib
LinkDLL:sysapiax.dll
Device:PT80
Programming Manual 8

DisplayRelatedFunctions
BacklightOn
Thisfunctionwillalwaysturnonoroffscreenbacklight.
DWORDBacklightOn
{
BOOLbOn
}
Parameters
bOn
[in]Flagthatindicateswhetherturnonscreenbacklight(TRUE)orturnoffscreenbacklight(FALSE).
ReturnValues
Iffunctionsucceeds,thereturnvalueisE_FUNC_SUCCEED.Iffunctionfails,possiblereturnvalueare
E_FUNC_ERROR,E_FUNC_PAR_ERROR.
Remarks
Afterthisfunctionturnonoroffbacklight,thebacklightwillalwaysonoroff.Thebacklightsettingofdisplay
propertiesincontrolpaneldoesnotworkuntilterminalresets.
Example
DWORDdwResult;
dwResult=BacklightOn(TRUE);
if(dwResult!=E_FUNC_SUCCEED)
AfxMessageBox(_T("BacklightOnfail"));
Requirements
OSVersions:WindowsCE4.2andlater.
Header:sysapiax.h
LinkLibrary:sysapiax.lib
LinkDLL:sysapiax.dll
Device:PT80
Programming Manual 9

Display_QueryBacklightIntensity
Thisfunctionwillreturnthebacklightintensityofexternalpowerandbatterypower.
DWORDDisplay_QueryBacklightIntensity
{
LPDWORDlpdwACBacklight,
LPDWORDlpdwBatteryBacklight
}
Parameters
lpdwACBacklight
[out]Thebacklightintensityofexternalpower.
lpdwBatteryBacklight
[out]Thebacklightintensityofbatterypower.
ReturnValues
Iffunctionsucceeds,thereturnvalueisE_FUNC_SUCCEED.Iffunctionfails,possiblereturnvalueare
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,
Programming Manual 10

dwValue2);
AfxMessageBox(strTemp);
}
Requirements
OSVersions:WindowsCE4.2andlater.
Header:sysapiax.h
LinkLibrary:sysapiax.lib
LinkDLL:sysapiax.dll
Device:PT80
Programming Manual 11

GetBacklightStatus
Thisfunctiongetsscreenbacklightstatus.
DWORDGetBacklightStatus
{
}
Parameters
None.
ReturnValues
Thereturnvalueindicateswhetherscreenbacklightis1=screenbacklightonorscreenbacklightis0=screen
backlightoff.
Example
DWORDdwResult;
dwResult=GetBacklightStatus();
if(dwResult==1)
AfxMessageBox(_T("Backlighton"));
else
AfxMessageBox(_T("Backlightoff"));
Requirements
OSVersions:WindowsCE4.2andlater.
Header:sysapiax.h
LinkLibrary:sysapiax.lib
LinkDLL:sysapiax.dll
Device:PT80
Programming Manual 12

PowerOnLCD
ThisfunctionturnsonoroffLCDpower.
DWORDPowerOnLCD
{
BOOLbOn
}
Parameters
bOn
[in]FlagthatindicateswhetherturnonLCDpower(TRUE)orturnoffLCDpower(FALSE).
ReturnValues
Iffunctionsucceeds,thereturnvalueisE_FUNC_SUCCEED.Iffunctionfails,possiblereturnvalueare
E_FUNC_ERROR,E_FUNC_PAR_ERROR.
Remarks
AftercallingthisfunctionwithbOnisFALSE,terminalwillonlyturnoffLCDpower.Itmeansthatterminalstill
works.YoushouldcallthisfunctiontoturnonLCDpowerorresetterminal.
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:WindowsCE4.2andlater.
Header:sysapiax.h
LinkLibrary:sysapiax.lib
LinkDLL:sysapiax.dll
Device:PT80
Programming Manual 13

SetBacklightPWM
Thisfunctionadjustsscreenbacklightbrightness.
DWORDSetBacklightPWM
{
intnACPowerPercent,
intnBatteryPercent
}
Parameters
nACPowerPercent,nBatteryPercent
[in]OneisbrightnesssettingusingACpowerandtheotherisbrightnesssettingusingbattery.Thesetwo
membersmustbeoneofthevaluesinthefollowingtable.
nPercent Backlightbrightness
100 super
75 normal
50 fine
25 micro
0 off
ReturnValues
Iffunctionsucceeds,thereturnvalueisE_FUNC_SUCCEED.Iffunctionfails,possiblereturnvalueare
E_FUNC_ERROR,E_FUNC_PAR_ERROR.
Remarks
TheBacklightSettingprograminControlPanelsetsscreen backlightbrightness.Calledthisfunctionwill also
changethebrightnessinBacklightSetting.YoucanusethisfunctionorBacklightSettingprograminControlPanel
toadjustbacklightbrightness.
Example
DWORDdwResult=SetBacklightPWM(100,100);
if(dwResult!=E_FUNC_SUCCEED)
AfxMessageBox(_T("SetBacklightPWMfail"));
Requirements
OSVersions:WindowsCE4.2andlater.
Header:sysapiax.h
LinkLibrary:sysapiax.lib
LinkDLL:sysapiax.dll
Device:PT80
Programming Manual 14

KeyPadRelatedFunctions
EnablePowerButton
Thisfunctionwillenableordisablepowerbutton.
DWORDEnablePowerButton
{
BOOLbOn
}
Parameters
bOn
[in]Flagthatindicateswhetherenablepowerbutton(TRUE)ordisablepowerbutton(FALSE).
ReturnValues
Iffunctionsucceeds,thereturnvalueisE_FUNC_SUCCEED.Iffunctionfails,possiblereturnvalueare
E_FUNC_ERROR,E_FUNC_PAR_ERROR.
Remarks
IfthebOnparameterisFALSE,powerbuttonisdisabled.Thepowerbuttonwillnotworkwhenpowerbutton
pressed.Ifterminalenterssuspendmode,thepowerbuttonwillworkoncetowakeup.Whenterminalwakesup,
thepowerbuttonisstilldisabled.UntilthisfunctioncallswithparameterTRUEtoenablepowerbutton.
Example
DWORDdwResult;
dwResult=EnablePowerButton(FALSE);
if(dwResult!=E_FUNC_SUCCEED)
AfxMessageBox(_T("EnablePowerButtonfail"));
Requirements
OSVersions:WindowsCE4.2andlater.
Header:sysapiax.h
LinkLibrary:sysapiax.lib
LinkDLL:sysapiax.dll
Device:PT80
Programming Manual 15

GetKeypadAlphaMode
Thisfunctionwillgetthecurrentinputmode.
DWORDGetKeypadAlphaMode
{
}
Parameters
None.
ReturnValues
Thereturnvaluecanbeoneofthevaluesinthefollowingtable.
Returnvalue Alphamode
0 numericmode
1 lowercaselettermode
2 uppercaselettemode
Example
DWORDdwResult;
dwResult=GetKeypadAlphaMode();
switch(dwResult){
case0:
AfxMessageBox(_T("Numericmode"));
break;
case1:
AfxMessageBox(_T("Lowercaselettermode"));
break;
case2:
AfxMessageBox(_T("Uppercaselettermode"));
break;
}
Requirements
OSVersions:WindowsCE4.2andlater.
Header:sysapiax.h
LinkLibrary:sysapiax.lib
LinkDLL:sysapiax.dll
Device:PT80
Programming Manual 16

SendKbdVisualKey
Thisfunctionsendsavisualkeytokeybuffer.
DWORDSendKbdVisualKey
{
BYTEKey
}
Parameters
Key
[in]Specifiesavirtual-keycode.
ReturnValues
Iffunctionsucceeds,thereturnvalueisE_FUNC_SUCCEED.Iffunctionfails,possiblereturnvalueare
E_FUNC_ERROR,E_FUNC_PAR_ERROR.
Example
CStringstrTemp;
strTemp="VisualKey";
for(inti=0;i<strTemp.GetLength();i++)
SendKbdVisualKey((unsignedchar)strTemp.GetAt(i));
Requirements
OSVersions:WindowsCE4.2andlater.
Header:sysapiax.h
LinkLibrary:sysapiax.lib
LinkDLL:sysapiax.dll
Device:PT80
Programming Manual 17
Other manuals for PT-80
2
Table of contents
Other Argox Handheld manuals