Argox PT-61 Owner's manual

PT-61 Mobile Computer
Programming Manual
DOC NO. UM-PT605-02
July 2010
Version 1.0
© 2002-2010 by ARGOX Information Co., Ltd.
http://www.argox.com

Programming Manual II
Table of Contents
OVERVIEW............................................................................................................................................................................................................2
SDK FUNCTIONS................................................................................................................................................................................................3
SYSAPIAX.DLL....................................................................................................................................................................................................4
AUDIO RELATED FUNCTIONS..................................................................................................................................................................6
Audio_GetVolume...........................................................................................................................................................6
Audio_SetVolume.............................................................................................................................................................7
BATTERY RELATED FUNCTION................................................................................................................................................................8
GetBatteryStatus...............................................................................................................................................................8
DISPLAY RELATED FUNCTIONS.............................................................................................................................................................10
BacklightOn....................................................................................................................................................................10
Display_QueryBacklightIntensity...............................................................................................................................11
GetBacklightStatus.........................................................................................................................................................13
PowerOnLCD...............................................................................................................................................................14
SetBacklightPWM.........................................................................................................................................................15
KEYPAD RELATED FUNCTIONS.............................................................................................................................................................16
EnablePowerButton......................................................................................................................................................16
GetKeypadAlphaMode................................................................................................................................................17
SendKbdVisualKey........................................................................................................................................................18
SetKeypadAlphaMode.................................................................................................................................................19
LED RELATED FUNCTIONS....................................................................................................................................................................20
GetKeypadLEDStatus..................................................................................................................................................20
GoodReadLEDOn.......................................................................................................................................................21
KeypadLEDOn..............................................................................................................................................................22
SYSTEM RELATED FUNCTIONS..............................................................................................................................................................23
CallSuspend....................................................................................................................................................................23
EnableAutoConnect......................................................................................................................................................24
RegisterAlphaKeyNotification.....................................................................................................................................25
ShowChineseIME.........................................................................................................................................................26
ShowDesktop..................................................................................................................................................................27
ShowExploreToolbar....................................................................................................................................................28
ShowTaskbar..................................................................................................................................................................29
UnRegisterAlphaKeyNotification...............................................................................................................................30
VIBRATOR RELATED FUNCTIONS..........................................................................................................................................................31
VibratorOn......................................................................................................................................................................31

Programming Manual III
BLUETOOTH RELATED FUNCTION........................................................................................................................................................32
BT_Enable......................................................................................................................................................................32
BT_Disable.....................................................................................................................................................................33
WIRELESS RELATED FUNCTION............................................................................................................................................................34
WL_Enable.....................................................................................................................................................................34
WL_Disable....................................................................................................................................................................35
SCANAPIAX.DLL..............................................................................................................................................................................................36
API_SCAN RELATED FUNCTIONS......................................................................................................................................................38
API_Register...................................................................................................................................................................38
API_Unregister..............................................................................................................................................................39
API_GetBarData..........................................................................................................................................................40
API_GetBarDataLength.............................................................................................................................................42
API_GetBarType...........................................................................................................................................................43
API_GetError.................................................................................................................................................................45
API_GetSysError...........................................................................................................................................................46
API_GoodRead.............................................................................................................................................................47
API_LoadSettingsFromFile........................................................................................................................................48
API_Reset........................................................................................................................................................................49
API_ResetBarData.......................................................................................................................................................50
API_SaveSettingsToFile...............................................................................................................................................51
API_SaveSettingsToScanner.......................................................................................................................................52
S2K_IsLoad....................................................................................................................................................................53
S2K_Load.......................................................................................................................................................................54
SCAN_QueryStatus......................................................................................................................................................55
SCAN_SendCommand................................................................................................................................................56
SCAN_ResumeSystem.................................................................................................................................................57
SCAN_BatchSetting......................................................................................................................................................58
SCAN_BatchRead........................................................................................................................................................59
SCAN2KEY RELATED FUNCTIONS.......................................................................................................................................................60
PT_OpenScan2Key......................................................................................................................................................60
PT_CloseScan2Key......................................................................................................................................................61
PT_SetToDefault............................................................................................................................................................62
SCANNER RELATED FUNCTIONS...........................................................................................................................................................63
PT_EnableScanner.......................................................................................................................................................63
PT_DisableScanner......................................................................................................................................................64
PT_CheckBarcodeData..............................................................................................................................................65
PT_GetBarcodeData...................................................................................................................................................66
PT_SetDefault................................................................................................................................................................68

Programming Manual IV
SCAN KEY RELATED FUNCTIONS.........................................................................................................................................................69
EnableTriggerKey.........................................................................................................................................................69
GetLibraryVersion.........................................................................................................................................................70
GetTriggerKeyStatus.....................................................................................................................................................71
PressTriggerKey.............................................................................................................................................................72
TriggerKeyStatus............................................................................................................................................................73
SCAN COMMAND TABLE.........................................................................................................................................................................74
FUNCTION RETURN VALUES.................................................................................................................................................................82

Programming Manual 2
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 CE5.0 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 and Vibrator 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 3
SDK Functions
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 4
SYSAPIAX.DLL
In this SDK, we supply SYSAPIAX.DLL which includes several 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
Audio_GetVolume – Query the current volume setting.
Audio_SetVolume – Set the volume setting.
Battery Related Function
GetBatteryStatus – Gets main battery status.
Display Related Functions
BacklightOn – Turn on or off screen backlight.
Display_QueryBacklightIntensity – Query backlight intensity.
GetBacklightStatus – Gets screen backlight status.
PowerOnLCD – Turn on or off LCD power.
SetBacklightPWM – Adjusts screen backlight brightness.
KeyPad Related Functions
EnablePowerButton – Enable and disable power button.
GetAlphaMode – Get the current input mode.
SendKbdVisualKey – Sends a visual key to key buffer.
SetAlphaMode – Change input mode.
LED Related Functions
GetKeypadLEDStatus – Gets keypad LED status.
GoodReadLEDOn – Turn on and off good read LED.
KeypadLEDOn – Turn on or off keypad LED.
System Related Functions
CallSuspend – Enter suspend mode.
EnableAutoConnect – Turn auto-connect on and off.
RegisterAlphaKeyNotification – Register a request with send a message when
the alpha key pressed.
ShowChineseIME – Display and hide the Chinese IME.

Programming Manual 5
ShowDeskTop – Display and hide all icons on desktop.
ShowExploreToolbar – Display and hide toolbar on windows explorer.
ShowTaskbar – Display and hide taskbar.
UnregisterAlphaKeyNotification – Unregister message request.
Vibrator Related Functions
VibratorOn – On and off vibration indicator.

Programming Manual 6
Audio Related Functions
Audio_GetVolume
This function queries the current volume setting.
DWORD Audio_GetVolume
{
LPDWORD lpdwVolume
}
Parameters
lpdwVolume
[out] The current volume setting.
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, the return value is
E_FUNC_ERROR.
Example
DWORD dwResult, dwVolume;
dwResult = Audio_GetVolume(&dwVolume);
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("Audio_GetVolume fail"));
else
{
CString strTemp;
strTemp.Format(_T("Volume: %d"),dwVolume);
AfxMessageBox(strTemp);
}
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT61

Programming Manual 7
Audio_SetVolume
This function sets the current volume setting.
DWORD Audio_SetVolume
{
DWORD dwVolume
}
Parameters
dwVolume
[in] Specifies a new volume setting. The default setting is 0x99999999.
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, the return value is
E_FUNC_ERROR.
Example
DWORD dwResult,dwVolume;
dwVolume = 0x11111111;
dwResult = Audio_SetVolume(dwVolume);
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("Audio_SetVolume fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT61

Programming Manual 8
Battery Related Function
GetBatteryStatus
This function gets main battery status.
int GetBatteryStatus
{
}
Parameters
None.
Return Values
The return value can be one of the values in the following table.
Return value Description
0 battery high
1 battery low
2 battery critical
3 battery charging
4 no battery
5 battery unknown
Example
switch (GetBatteryStatus())
{
case 0:
AfxMessageBox(_T("Battery High"));
break;
case 1:
AfxMessageBox(_T("Battery Low"));
break;
case 2:
AfxMessageBox(_T("Battery Critical"));
break;
case 3:
AfxMessageBox(_T("Battery Charging"));

Programming Manual 9
break;
case 4:
AfxMessageBox(_T("No Battery"));
break;
case 5:
AfxMessageBox(_T("Battery Unknown"));
break;
}
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT61

Programming Manual 10
Display Related Functions
BacklightOn
This function will always turn on or off screen backlight.
DWORD BacklightOn
{
BOOL bOn
}
Parameters
bOn
[in] Flag that indicates whether turn on screen backlight(TRUE) or turn off screen backlight(FALSE).
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, possible return value are
E_FUNC_ERROR, E_FUNC_PAR_ERROR.
Remarks
After this function turn on or off backlight, the backlight will always on or off. The backlight setting of display
properties in control panel does not work until terminal resets.
Example
DWORD dwResult;
dwResult = BacklightOn(TRUE);
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("BacklightOn fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT61

Programming Manual 11
Display_QueryBacklightIntensity
This function will return the backlight intensity of external power and battery power.
DWORD Display_QueryBacklightIntensity
{
LPDWORD lpdwACBacklight,
LPDWORD lpdwBatteryBacklight
}
Parameters
lpdwACBacklight
[out] The backlight intensity of external power.
lpdwBatteryBacklight
[out] The backlight intensity of battery power.
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, possible return value are
E_FUNC_ERROR, E_FUNC_NULLPTR.
Remarks
The parameters will be one of the values in the following table.
Backlight intensity Backlight brightness
4 super
3 normal
2 fine
1 micro
0 off
Example
DWORD dwResult, dwValue1, dwValue2;
dwResult = Display_QueryBacklightIntensity(&dwValue1, &dwValue2);
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("Display_QueryBacklightIntensity fail"));
else
{
CString strTemp;
strTemp.Format(_T("AC backlight intensity: %d, Battery backlight intensity: %d"), dwValue1,

Programming Manual 12
dwValue2);
AfxMessageBox(strTemp);
}
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT61

Programming Manual 13
GetBacklightStatus
This function gets screen backlight status.
DWORD GetBacklightStatus
{
}
Parameters
None.
Return Values
The return value indicates whether screen backlight is 1 = screen backlight on or screen backlight is 0 = screen
backlight off.
Example
DWORD dwResult;
dwResult = GetBacklightStatus();
if(dwResult == 1)
AfxMessageBox(_T("Backlight on"));
else
AfxMessageBox(_T("Backlight off"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT61

Programming Manual 14
PowerOnLCD
This function turns on or off LCD power.
DWORD PowerOnLCD
{
BOOL bOn
}
Parameters
bOn
[in] Flag that indicates whether turn on LCD power(TRUE) or turn off LCD power(FALSE).
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, possible return value are
E_FUNC_ERROR, E_FUNC_PAR_ERROR.
Remarks
After calling this function with bOn is FALSE, terminal will only turn off LCD power. It means that terminal still
works. You should call this function to turn on LCD power or reset terminal.
Example
DWORD dwResult;
dwResult = PowerOnLCD(FALSE); //power off LCD
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("PowerOnLCD fail"));
Sleep(3000);
dwResult = PowerOnLCD(TRUE); //power on LCD
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("PowerOnLCD fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT61

Programming Manual 15
SetBacklightPWM
This function adjusts screen backlight brightness.
DWORD SetBacklightPWM
{
int nACPowerPercent,
int nBatteryPercent
}
Parameters
nACPowerPercent,nBatteryPercent
[in] One is brightness setting using AC power and the other is brightness setting using battery. These two
members must be one of the values in the following table.
nPercent Backlight brightness
100 super
75 normal
50 fine
25 micro
0 off
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, possible return value are
E_FUNC_ERROR, E_FUNC_PAR_ERROR.
Remarks
The Backlight Setting program in Control Panel sets screen backlight brightness. Called this function will also
change the brightness in Backlight Setting. You can use this function or Backlight Setting program in Control Panel
to adjust backlight brightness.
Example
DWORD dwResult = SetBacklightPWM(100,100);
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("SetBacklightPWM fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT61

Programming Manual 16
KeyPad Related Functions
EnablePowerButton
This function will enable or disable power button.
DWORD EnablePowerButton
{
BOOL bOn
}
Parameters
bOn
[in] Flag that indicates whether enable power button(TRUE) or disable power button(FALSE).
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, possible return value are
E_FUNC_ERROR, E_FUNC_PAR_ERROR.
Remarks
If the bOn parameter is FALSE, power button is disabled. The power button will not work when power button
pressed. If terminal enters suspend mode, the power button will work once to wake up. When terminal wakes up,
the power button is still disabled. Until this function calls with parameter TRUE to enable power button.
Example
DWORD dwResult;
dwResult = EnablePowerButton(FALSE);
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("EnablePowerButton fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT61

Programming Manual 17
GetKeypadAlphaMode
This function will get the current input mode.
DWORD GetKeypadAlphaMode
{
}
Parameters
None.
Return Values
The return value can be one of the values in the following table.
Return value
Alpha mode
0 numeric mode
1 lowercase letter mode
2 uppercase lette mode
Example
DWORD dwResult;
dwResult = GetKeypadAlphaMode();
switch (dwResult){
case 0:
AfxMessageBox(_T("Numeric mode"));
break;
case 1:
AfxMessageBox(_T("Lowercase letter mode"));
break;
case 2:
AfxMessageBox(_T("Uppercase letter mode"));
break;
}
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT61
Table of contents
Other Argox PDA manuals