Getac Software Development Kit Spec R17 20130314

Download as pdf or txt
Download as pdf or txt
You are on page 1of 79

Date: 2013/3/14

Getac Handheld Device


Page: 1
Software Development Kit
Total: 79

Getac Handheld Device

Software Development Kit


Date: 2013/3/14
Getac Handheld Device
Page: 2
Software Development Kit
Total: 79

Revision History

Title Getac Handheld Device Software Development Kit

Rev Date Page Sec Description


01 6/22/2010 All All Initial release.
02 9/29/2010 5 Revise PS535F1 to PS535F (WM6.5)
6 Remove version format 2 related information
03 10/04/2010 55-57 All Add FAQ x 3
04 3/4/2011 All All Integrate MH132 product
05 3/9/2011 Revise Appendix A for PS535 series API table
06 3/14/2011 6 Add PS236 Key mapping section
07 3/16/2011 19-21 All Add table for listing different product GPS port
56 All Remove ReplaceDefaultCameraApp()
57 All Remove Button_SetCameraKey()
08 05/05/2011 45 Revise the 2nd parameter of GetSerialNumber
09 07/27/2011 65 All Add Appendix B for demo application quick summary.
10 09/13/2011 All All Remove watermark for whole document
11 09/21/2011 63 All Add FAQ4
71 All Add Appendix C for Microsoft standard API
12 09/28/2011 58-61 All Add new APIs for PS236EXT Flexiconn expension port
68-69 All Add new APIs into table
13 12/02/2011 10-64 5 Update R08 SWV018 SDK
14 12/05/2011 76 7.4 Merge appendix C and FAQ4
15 11/12/2012 All All Add PS336 Support description
Support SetExpansionPOWER/
16 03/12/2013 68,78 All
GetExpansionPOWER For PS336
Modify “WM6.5” to “Windows Embeddeed Handheld 6.5”
17 03/14/2013 6 2
For PS336
Date: 2013/3/14
Getac Handheld Device
Page: 3
Software Development Kit
Total: 79

Table of Contents
Revision History ................................................................
................................................................................................
.......................................2
Table of Contents ................................................................................................................................
................................ .....................................3
1. Overview ................................................................
................................................................................................
..............................................6
2. System Support................................................................................................................................
................................ .....................................6
Hardware ................................................................
................................................................................................
..........................................6
What You Need to Get Started ................................................................................................
................................ ..........................................6
3. Naming Rule of OS Version Label ................................................................................................
................................ ........................................7
3.1 PS236/PS535/MH132 ................................................................................................
................................ ..............................................7
3.2 PS336 ................................................................
................................................................................................
......................................7
4. Architecture ................................................................
................................................................................................
..........................................8
ExternAPI.DLL ................................................................................................................................
................................ ................................8
GPSID ................................................................
................................................................................................
..............................................8
5. Getac APIs Reference ................................................................................................
................................ ......................................................... 10
5.1 E-compass/G-sensor API’s ................................................................................................
................................ ........................................ 10
EComAcc_InitDevice ................................................................................................
................................ ............................................. 10
EComAcc_DeinitDevice ................................................................................................
................................ ......................................... 11
EComAcc_GetData ................................................................................................
................................ ................................................. 12
ECompass_GetRawData ................................................................................................
................................ ......................................... 13
GSensor_GetData ................................................................................................
................................ ................................................... 14
GSensor_GetRawData ................................................................................................
................................ ............................................ 15
5.2 Pressure sensor API’s ................................................................................................
................................ ................................................ 16
Pressure_InitDevice ................................................................................................
................................ ................................................ 16
Pressure_DeinitDevice ................................................................................................
................................ ............................................ 17
Pressure_GetPaTemp ................................................................................................
................................ .............................................. 18
5.3 GPS API’s ................................................................................................................................
................................ ................................. 19
GPS with GPS Intermediate Driver ................................................................
......................................................... 19
GPS without GPS Intermediate Driver
Drive ................................................................
.................................................... 21
5.4 System Acoustic Control ................................................................................................
................................ ........................................... 23
Speaker_GetVolume ................................................................................................
................................ ................................................ 23
Speaker_SetVolume ................................................................................................
................................ ................................................ 24
Receiver_GetVolume ................................................................................................
................................ .............................................. 25
Receiver_SetVolume ................................................................................................
................................ ............................................... 26
Microphone Gain Control (Only for MH132) ................................................................
.......................................... 27
5.5 System LED control ................................................................................................
................................ .................................................. 28
Charging LED
ED Indicator Control .............................................................................................
............................. 28
Date: 2013/3/14
Getac Handheld Device
Page: 4
Software Development Kit
Total: 79

Camera Flash LED control ................................................................................................


................................ ...................................... 29
Set_BT_LED_ON ................................................................................................
................................ ................................................... 31
Set_WIFI_LED_ON ................................................................................................
................................ ............................................... 32
Set_3G_LED_ON ................................................................................................
................................ ................................................... 33
Set_GPS_LED_ON ................................................................................................
................................ ................................................. 33
5.6 System Backlight Control ................................................................................................
................................ ......................................... 34
Backlight_GetLevel ................................................................................................
................................ ................................................ 34
Backlight_SetLevel ................................................................................................
................................ ................................................. 35
5.7 Connectivity
ty Component APIs ................................................................................................
.................................. 36
Phone_OnOff ................................................................................................
................................ .......................................................... 36
WLAN_OnOff ................................................................................................
................................ ........................................................ 37
Bluetooth_OnOff ................................................................................................
................................ .................................................... 38
FlightMode_OnOff ................................................................................................
................................ ................................................. 39
5.8 System Information APIs ................................................................................................
................................ .......................................... 40
GetSystemUUID ................................................................................................
................................ ..................................................... 40
GetDeviceName ................................................................................................
................................ ...................................................... 41
GetDeviceSKUID ................................................................................................
................................ ................................................... 42
GetLanguageID ................................................................................................
................................ ....................................................... 43
GetOSVersion ................................................................................................
................................ ......................................................... 44
GetROMImageVersion ................................................................................................
................................ ............................................ 45
GetROMImageVersionMinor ................................................................................................
.................................. 46
GetOSImgVersion ................................................................................................
................................ ................................................... 47
GetMicroPVersion ................................................................................................
................................ ................................................... 48
GetPhoneVersion................................................................................................
................................ ..................................................... 49
GetSerialNumber ................................................................................................
................................ .................................................... 50
GetBluetoothMAC ................................................................................................
................................ .................................................. 51
GetWLANMAC................................................................................................
................................ ...................................................... 52
GetMemoryStatus ................................................................................................
................................ ................................................... 53
GetProcessorName ................................................................................................
................................ .................................................. 54
GetIMEI................................................................................................................................
................................ .................................. 55
GetCPUSpeed ................................................................................................
................................ ......................................................... 56
SystemReboot ................................................................................................
................................ ......................................................... 57
5.9 Personal Information APIs ................................................................................................
................................ ........................................ 58
GetOwnerName ................................................................................................
................................ ...................................................... 58
GetOwnerCompany................................
................................................................................................
................................................. 59
GetOwnerAddress ................................................................................................
................................ ................................................... 60
GetOwnerTelephone ................................................................................................
................................ ............................................... 61
GetOwnerEMail ................................................................................................
................................ ...................................................... 62
Date: 2013/3/14
Getac Handheld Device
Page: 5
Software Development Kit
Total: 79

5.10 MISC APIs..............................................................................................................................


................................ .............................. 63
Button_SetFNKeyStatus................................
................................................................................................
.......................................... 63
Button_GetFNKeyStatus ................................................................................................
................................ ......................................... 64
SetExpansionUART ................................................................................................
................................ ................................................ 65
GetExpansionUART ................................................................................................
................................ ............................................... 66
SetExpansionPOWER ................................................................................................
................................ ............................................. 67
GetExpansionPOWER ................................................................................................
................................ ............................................ 68
IsUsingAABattery................................................................................................
................................ ................................................... 69
6. How to Remap Keypad Definition ................................................................................................
................................ ...................................... 70
6.1 Concept ................................................................................................................................
................................ .................................. 70
6.2 Pseudo-Code .............................................................................................................................
................................ ............................. 70
6.3 Example ................................................................
................................................................................................
.................................... 70
6.4 Camera Key (PS236/PS236 EXT/PS336 series) ................................................................
........................................ 71
7. Frequently Asked Questions ................................................................................................
................................ ............................................... 73
7.11 How can I run an application from SD card automatically? ................................
....................................................... 73
7.2 How can I rotate the system screen thru my application? ...........................................................
........................... 74
7.3 How can I pack my applications and settings for multiple units’ deployment? ........................... 75
7.4 How can I keep the unit awake if specific application running? ................................
................................................. 76
Appendix A : API List For Each Product................................................................................................
................................. 77
Appendix B : Sample Application Summary ...........................................................................................
........................... 79
B.1 SystemInfo ...............................................................................................................................
................................ ............................... 79
B.2 CameraCapture................................................................................................
................................ ......................................................... 79
B.3 Level Gauge .............................................................................................................................
................................ ............................. 79
B.4 GPS Sample Application ................................................................................................
................................ .......................................... 79
B.5 MenuChange ............................................................................................................................
................................ ............................ 79
B.6 SensorsDemo ...........................................................................................................................
................................ ........................... 79
Date: 2013/3/14
Getac Handheld Device
Page: 6
Software Development Kit
Total: 79

1. Overview
This document describes the architecture and functionalities of the Getac Handheld Device SDK
(Software Development Kit). The SDK will provide
pro the API set to access/control E-compass,
compass, G
G-sensor,
Pressure sensor, GPS data and system related information.

2. System Support
Hardware

This SDK supports the following Getac Handheld devices:


devices
• Getac PS236
• Getac PS236 EXT (Flexiconn port implementation)
• Getac PS535F/PS535F (Windows
indows Mobile 6.5)
• Getac PS535E
• Getac MH132 (Windows Mobile
obile 6.5)
• Getac PS336 (Windows Embeddded Handheld 6.5)

What You Need to Get Started

Since Getac Handheld Device is using Microsoft Windows Mobile Operating System, please m
make sure
the following software is installed on your development environment.
• Microsoft Visual Studio 2005/2008 or even higher
• Microsoft ActiveSync 4.5 (for XP) or Windows Mobile Device Center (for Vista/Win7)
• Related Platform SDKs which provided by Microsoft
Microsoft to support you to develop specific
application.

Getac Handheld Device Required SDK Developing Environment

Getac PS535E Microsoft Windows Mobile Visual Studio 2005/2008


5.0 SDK for Pocket PC
Getac PS535F Microsoft Windows Mobile Visual Studio 2005/2008
6.0 Professional SDK
Getac PS535F (WM6.5) Microsoft Windows Mobile Visual Studio 2005/2008
6.5 DTK
Getac PS236 W/O 3G Microsoft Windows Mobile Visual Studio 2005/2008
6.0 Professional SDK
Getac PS236 W/ 3G Microsoft Windows Mobile Visual Studio 2005/2008
6.0 Professional SDK
Date: 2013/3/14
Getac Handheld Device
Page: 7
Software Development Kit
Total: 79

Getac PS236 EXT W/O 3G Microsoft Windows Mobile Visual Studio 2005/2008
6.0 Professional SDK
Getac PS236 EXT W/3G Microsoft Windows Mobile Visual Studio 2005/2008
6.0 Professional SDK
Getac MH132 (WM 6.5) Microsoft Windows Mobile Visual Studio 2005/2008
6.5 DTK
Getac PS336 (WEH6.5) Microsoft Windows Mobile Visual Studio 2005/2008
6.5 DTK

3. Naming Rule of OS Version Label


3.1 PS236/PS535/MH132
The version number of Getac Handheld Product
Produ has general naming rule. The format of section
is 1.XXX.LLL.

XXX: Means Getac OS image version record

LLL: Means language abbreviation

3.2 PS336
The version number of Getac Handheld Product
Produ has general naming rule. The format of section
is 1.XXX.YYY.LLL.

XXX: SKU No.


YYY: Means Getac OS image version record

LLL: Means language abbreviation

No. Language Description Language Code


1 World Wide English ENG/EN
2 Traditional Chinese CHT/TC
3 Simplified Chinese CHS/SC
4 German GER/GE
5 Spanish ESP/ES
6 Italian ITA/IT
7 Japanese JPN/JP
8 French FRA/FR
Date: 2013/3/14
Getac Handheld Device
Page: 8
Software Development Kit
Total: 79

4. Architecture

ExternAPI.DLL
This DLL will be shipped as part of the ROM image on Getac PS236/PS336/PS535 and it will have to
support all functions referenced by this document. The header file will be published to expose all APIs
defined within the DLL. The intention of this DLL is to allow other applications to query and set
characteristics for the Getac PS236/PS336/PS535
/PS336/PS535 hardware and software.

GPSID

The GPS Intermediate Driver that proposed by Microsoft is useful


useful to developers writing applications
that use GPS (Global Positioning System) devices as well as to GPS hardware manufacturers. It is useful
because it provides an intermediate layer that abstracts the actual GPS device from developers and
manufacturers.

- GPS Without the GPS Intermediate Driver

Without the GPS Intermediate Driver, applications generally access GPS hardware directly through a
Date: 2013/3/14
Getac Handheld Device
Page: 9
Software Development Kit
Total: 79

COM port.
Applications interact directly with the GPS hardware by calling CreateFile to obtain a handle to the
device. With most GPS devices, this connection is exclusive, so only
only one application at a time can
interact with the GPS hardware.
Applications then call ReadFile repeatedly to retrieve GPS location data encoded using the National
Marine Electronics Association (NMEA) standard or GPS raw data.

- Benefits of the GPS Intermediate Driver

With the GPS Intermediate Driver, applications use


use the GPS Intermediate Driver instead of
interacting with the GPS hardware directly. The GPS Intermediate Driver is the only code that
interacts directly with GPS hardware.

The GPS Intermediate Driver provides two main advantages:

• Enable multiple applications to use GPS hardware at the same time. The GPS Intermediate
Driver makes it appear that each application has its own dedicated GPS hardware.

• Remove the need for applications to parse NMEA strings to obtain meaningful data. The GPS
Intermediate Driver internally parses the NMEA strings obtained from the GPS hardware and
makes the parsed information available through a friendly API that contains structures like
GPS_POSITION and calls like GPSGetLocation. Applications can also use a
ReadFile interface. This ability provides an easy way for existing
backward-compatible stream/ReadFile
applications to use the GPS Intermediate Driver
Driver without requiring modification.

For more detail information, please refer to the MSDN documentation.


Date: 2013/3/14
Getac Handheld Device
Page: 10
Software Development Kit
Total: 79

5. Getac APIs Reference

5.1 E-compass/G-sensor API’s

EComAcc_InitDevice

Syntax
INT16 EComAcc_InitDevice(void)

Description
This function will initialize E-compass/G-sensor
E hardware and related software memory
handling. It has to be called prior to get the data.

Parameters
None

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 11
Software Development Kit
Total: 79

EComAcc_DeinitDevice

Syntax
INT16 EcomAcc_DeinitDevice(void)

Description
This function will de-initialize
initialize E-compass/G-sensor
E sensor hardware and related software memory
handling. It has to be called after finishing data query procedure. Otherwise, it might have memory
leakage or handle leakage problem.

Parameters
None

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 12
Software Development Kit
Total: 79

EComAcc_GetData

Syntax
BOOL EComAcc_GetData(int data[])

Description
This function will used to get E
E-compass/G-sensor Theta, Pitch, Roll angle data, and HDST
status.

Parameters
 data
[out] Pointer to an array that receives the output data for the operation.

data[0]  Theta
data[1]  Pitch
data[2]  Roll angle
data[3]  HDST, 0 and 1 means calibration is NOT completed
2 and 3 means calibration is completed
Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 13
Software Development Kit
Total: 79

ECompass_GetRawData

Syntax
BOOL ECompass_GetRawData(int data[],eDataType eType)

Description
This function will used to get E
E-compass raw Theta, Pitch and Roll
oll angle data
data.

Parameters
 eType
[in] Data type MEASUREMENT_RAW_DATA
 data
[out] Pointer to an array that receives the output data for the operation.

data[0]  Theta
data[1]  Pitch
data[2]  Roll angle

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 14
Software Development Kit
Total: 79

GSensor_GetData

Syntax
BOOL GSensor_GetData(int
_GetData(int data[])

Description
This function will used to get G
G-sensor Pitch and Roll angle data.

Parameters
 data
[out] Pointer to an array that receives the output data for the operation.

data[0]  Reserved, set 0


data[1]  Pitch
data[2]  Roll angle
data[3]  Reserved, set 0
Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 15
Software Development Kit
Total: 79

GSensor_GetRawData

Syntax
BOOL GSensor_GetRawData (int data[])

Description
This function will used to get G
G-sensor Pitch and Roll angle data.

Parameters
 data
[out] Pointer to an array that receives the output data for the operation.

data[0]  Theta
data[1]  Pitch
data[2]  Roll angle

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 16
Software Development Kit
Total: 79

5.2 Pressure sensor API’s

Pressure_InitDevice

Syntax
BOOL Pressure_InitDevice(void)

Description
This function will initialize Pressure sensor hardware and related software memory handling.
It has to be called prior to get the data.

Parameters
None

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 17
Software Development Kit
Total: 79

Pressure_DeinitDevice

Syntax
BOOL Pressure_DeinitDevice(void)

Description
This function will de-initialize
initialize Pressure sensor hardware and related software memory
handling. It has to be called after finishing data query procedure. Otherwise, it might have memory
leakage or handle leakagee problem.

Parameters
None

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 18
Software Development Kit
Total: 79

Pressure_GetPaTemp

Syntax
BOOL Pressure_GetPaTemp(float
Pressure_GetPaTemp( data[])

Description
This function will used to get Pressure sensor PA and Temperature raw data.

Parameters
 data
[out] Pointer to an array that receives the output data for the operation.

data[0]  PA raw data


data[1]  Temperature raw data

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 19
Software Development Kit
Total: 79

5.3 GPS API’s

GPS with GPS Intermediate Driver

CreateFile

Syntax
HANDLE CreateFile( LPCTSTR lpFileName,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes,
HANDLE hTemplateFile)

Description
This API is provided by Microsoft which is used for opening a GPS device po
port.
It returns
ns a handle to access the device.
device

Parameters
lpFileName
[in] Pointer to a null-terminated
null terminated string that specifies the name of the object. It has to
be set as GPD1 for GPS usage

Note: The table list as below describes the different setting during Getac Products.

Model GPS Intermediate Driver


PS535E/F GPD1:
PS236 GPD1:
MH132 N/A
PS336 GPD1:

dwDesiredAccess
[in] Type of access to the object. It has to be (GENERIC_READ |
GENERIC_WRITE) for GPS usage.
dwShareMode
[in] Share mode for the object. It has to be (FILE_SHARE_READ | FILE_SHARE_
WRITE) for GPS usage.
Date: 2013/3/14
Getac Handheld Device
Page: 20
Software Development Kit
Total: 79

lpSecurityAttributes
[in] Not used. It has to be set as NULL for GPS usage.
dwCreationDisposition
[in] Action to take on files that exist, and which action to take when files do not exist. It
has to be OPEN_EXISTING for GPS usage.
dwFlagsAndAttributes
[in] File attributes and flags for the file. It has to be FILE_ATTRIBUTE_NORMAL for
GPS usage.
hTemplateFile
[in] Ignored. It has to be set as NULL for GPS usage.

Return value
An openned handle to the specified file indicates success.
success. If the specified file exists before the
function call and dwCreationDisposition is set to CREATE_ALWAYS or OPEN_ALWAYS, a
call to GetLastError returns ERROR_ALREADY_EXISTS, even though the function has
succeeded. If the file does not exist before the call, GetLastError returns zero.
INVALID_HANDLE_VALUE indicates failure. To get extended error information, call
GetLastError.

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 21
Software Development Kit
Total: 79

GPS without GPS Intermediate Driver

CreateFile

Syntax
HANDLE CreateFile( LPCTSTR lpFileName,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes,
HANDLE hTemplateFile)

Description
This API is provided by Microsoft which is used for opening a GPS device po
port.
It returns
ns a handle to access the device.
device
Parameters
lpFileName
[in] Pointer to a null-terminated
null terminated string that specifies the name of the objec
object

Note: The table list as below describes the different setting during Getac Products.

Model Direct Access


PS535E/F COM2:
PS236 COM4:
MH132 COM7:
PS336 COM4:

dwDesiredAccess
[in] Type of access to the object. It has to be (GENERIC_READ |
GENERIC_WRITE) for GPS usage.
dwShareMode
[in] Share mode for the object. It has to be (FILE_SHARE_READ | FILE_SHARE_
WRITE) for GPS usage.
lpSecurityAttributes
[in] Not used. It has to be set as NULL for GPS usage.
dwCreationDisposition
[in] Action to take on files that exist, and which action to
to take when files do not exist.
Date: 2013/3/14
Getac Handheld Device
Page: 22
Software Development Kit
Total: 79

It has to be OPEN_EXISTING for GPS usage.


dwFlagsAndAttributes
[in] File attributes and flags for the file. It has to be FILE_ATTRIBUTE_NORMAL
for GPS usage.
hTemplateFile
[in] Ignored. It has to be set as NULL for GPS usage.
Return value
An openned handle to the specified file indicates success. If the specified file exists before the
function call and dwCreationDisposition is set to CREATE_ALWAYS or OPEN_ALWAYS, a
call to GetLastError returns ERROR_ALREADY_EXISTS, even though the function has
succeeded. If the file does not exist before the call, GetLastError returns zero.
INVALID_HANDLE_VALUE indicates failure. To get extended error information, call
GetLastError.

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 23
Software Development Kit
Total: 79

5.4 System Acoustic Control

Speaker_GetVolume

Syntax
BOOL Speaker_GetVolume(DWORD*
Volume(DWORD* pdwLevel)

Description
This function will used to get the volume level of system speaker.

Parameters
 pdwLevel
[out] Pointer that receives the current volume level of system speaker. The range of
volume level will be 0 to 5.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 24
Software Development Kit
Total: 79

Speaker_SetVolume

Syntax
BOOL Speaker_SetVolume(DWORD
Volume(DWORD dwLevel)

Description
This function will used to set the volume level of system speaker.

Parameters
 dwLevel
[in] DWORD parameter contains the speaker level value from 0 to 5. 0 means system
speaker mute.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 25
Software Development Kit
Total: 79

Receiver_GetVolume

Syntax
BOOL Receiver_GetVolume(DWORD*
Volume(DWORD* pdwLevel)

Description
This function will used to get the volume level of system receiver.

Parameters
 pdwLevel
[out] Pointer that receives the current volume level of system receiver. The range of
volume level will be 0 to 5.

Remark
This API is supported in Phone SKU (ID = 50) only.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 26
Software Development Kit
Total: 79

Receiver_SetVolume

Syntax
BOOL Receiver_SetVolume(DWORD
Volume(DWORD dwLevel)

Description
This function will used to set the volume level of system receiver.

Parameters
 dwLevel
[in] DWORD parameter contains the receiver level value from 0 to 5. 0 means system
receiver mute.

Remark
This API is supported in Phone SKU (ID = 50) only.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 27
Software Development Kit
Total: 79

Microphone Gain Control (Only for MH132)


Description
The settings for system microphone gain control
[HKEY_LOCAL_MACHINE
[HKEY_LOCAL_MACHINE\Software\APP\MTC\MICVOL]
"VOL"=dword:B
"VolumeSliderIndex"=dword:5

Range of VOL is 0x00~0x1F(


0x00~0x1F(-16.5dB~+30dB, 1.5dB per step).
Users can define their own "VolumeSliderIndex" for applet UI.

Note: For Getac MH132H, range of VOL is 0x00 ~ 0x18(-12dB


0x18( 12dB ~ 12dB, 1 dB per step).

Example Sample Code


Change registry and send an event can make the setting working.

#define MIC_OEM_REGISTRY_PATH L"Software\\APP\\MTC\\MICVOL"


L"Software
#define MIC_OEM_VOLUME_REGSKEY L"VOL"
#define MIC_OEM_VOLUME_SLIDER_INX_REGSKEY L"VolumeSliderIndex"
static DWORD dwMicVolume;
static DWORD dwSliderMicVolumeIndex;
HANDLE ghevNotCameraMode = NULL;

tCameraMode = OpenEvent(EVENT_ALL_ACCESS, FALSE, L"SYSTEM/NotCameraMode");


ghevNotCameraMode
dwMicVolume = 0x01;
dwSliderMicVolumeIndex = 0x00;

WriteToRegistry(MIC_OEM_REGISTRY_PATH, MIC_OEM_VOLUME_REGSKEY, dwMicVolume);


WriteToRegistry(MIC_OEM_REGISTRY_PATH, MIC_OEM_VOLUME_SLIDER_INX_REGSKEY,
MIC_OEM_VOLUME_SLIDER_INX_REGSKEY,
dwSliderMicVolumeIndex);

SetEvent(ghevNotCameraMode);
Date: 2013/3/14
Getac Handheld Device
Page: 28
Software Development Kit
Total: 79

5.5 System LED control


Charging LED Indicator Control

Syntax
BOOL WINAPI NLedSetDevice( UINT nDeviceId,
void* pInput);

Description
This function allows user to control Charging LED for On, Off or Blinking.

The ID number of Charging LED Indicator is 0.

Parameters
 nDeviceId
[in] Integer that specifies what information to set. You can set it to
NLED_SETTINGS_INFO_ID to indicate that the pInput buffer contains information
about the current settings for the notification LED.
 pInput
[in] Pointer to the buffer that contains the NLED_SETTINGS_INFO structure. This
structure contains the new settings for the notification LED.

Example Sample Code

NLED_SETTINGS_INFO *pNLED;

// Turn the charging LED On


pNLED->LedNum = 0;
pNLED->OffOnBlink = 1;
NLedSetDevice(NLED_SETTINGS_INFO_ID, pNLED);

// Turn the charging LED Off


pNLED->OffOnBlink = 0;
NLedSetDevice(NLED_SETTINGS_INFO_ID, pNLED);

// Blink the charging LED


pNLED->OffOnBlink = 2;
NLedSetDevice(NLED_SETTINGS_INFO_ID, pNLED);
Date: 2013/3/14
Getac Handheld Device
Page: 29
Software Development Kit
Total: 79

Camera Flash LED control

Syntax
BOOL WINAPI NLedSetDevice( UINT nDeviceId,
void* pInput);

Description
This function allows user to control Camera Flash LED in the back side for On and Off only.
Camera Flash LED does not support Blinking feature.

The ID number of Camera Flash LED is 1.


The ID number of Camera Flash LED is 4 For PS336.

Parameters
 nDeviceId
[in] Integer that specifies what information to set. You can set it to
NLED_SETTINGS_INFO_ID to indicate that the pInput buffer contains information
about the current settings for the notification LED.
 pInput
[in] Pointer to the buffer that contains the NLED_SETTINGS_INFO structure. This
structure contains
tains the new settings for the notification LED.

Example Sample Code

NLED_SETTINGS_INFO *pNLED;
pNLED;

// Turn the Camera Flash LED On


pNLED->LedNum = 1;
pNLED->OffOnBlink = 1;
NLedSetDevice(NLED_SETTINGS_INFO_ID, pNLED);

// Turn the Camera Flash LED Off


pNLED->OffOnBlink = 0;
NLedSetDevice(NLED_SETTINGS_INFO_ID, pNLED);
Date: 2013/3/14
Getac Handheld Device
Page: 30
Software Development Kit
Total: 79

Note : For Getac MH132H,, the definition of nDeviceId shall be NLED_SETTINGS_INFO_ID


NLED_SETTINGS_INFO_ID.
And pInput contains the NLED_SETTINTS_INFO structure, where:where
pInput->LedNum 0 : Red LED
1 : Green LED
2 : White LED
Date: 2013/3/14
Getac Handheld Device
Page: 31
Software Development Kit
Total: 79

Set_BT_LED_ON

Syntax
BOOL Set_BT_LED_ON(BOOL OnOff)

Description
This function will used to set
et the bluetooth LED indicator on/off.

Parameters
 OnOff
[in] Set LED on/off.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 32
Software Development Kit
Total: 79

Set_WIFI_LED_ON

Syntax
BOOL Set_WIFI_LED_ON(BOOL OnOff)

Description
This function will used to set
et the WiFi LED indicator on/off.

Parameters
 OnOff
[in] Set LED on/off.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 33
Software Development Kit
Total: 79

Set_3G_LED_ON

Syntax
BOOL Set_3G_LED_ON(BOOL OnOff)

Description
This function will used to set
et the 3G LED indicator on/off.

Parameters
 OnOff
[in] Set LED on/off.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code

Set_GPS_LED_ON

Syntax
BOOL Set_GPS_LED_ON(BOOL
_LED_ON(BOOL OnOff)

Description
This function will used to set
et the GPS LED indicator on/off.

Parameters
 OnOff
[in] Set LED on/off.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 34
Software Development Kit
Total: 79

5.6 System Backlight Control

Backlight_GetLevel

Syntax
BOOL Backlight_GetLevel(DWORD*
Level(DWORD* pdwLevel)

Description
This function will used to get the brightness level of backlight.

Parameters
 pdwLevel
[out] Pointer that receives the current brightness level of system receiver
receiver. The range of
level will be 0 to 9. Zero means turn off backlight.

Note: For Getac MH132, pdwLevel will be 0 to 10. Return False if out of this range.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 35
Software Development Kit
Total: 79

Backlight_SetLevel

Syntax
BOOL Backlight_SetLevel(DWORD
SetLevel(DWORD dwLevel)

Description
This function will used to set the brightness level of backlight.

Parameters
 dwLevel
[in] DWORD that contains the brightness level for backlight control. The range of level
will
ll be 0 to 9. Zero means turn off backlight.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 36
Software Development Kit
Total: 79

5.7 Connectivity Component APIs

Phone_OnOff

Syntax
BOOL Phone_OnOff(BOOL bPowerOn)

Description
This function will be used to turn On/Off the power of the phone module.

Parameters
 bPowerOn
[in] Boolean that controls the power state of the Phone module. TRUE will turn on and
FALSE will turn off the Phone module.

Remark
This API is supported in Phone SKU (ID = 50) only.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 37
Software Development Kit
Total: 79

WLAN_OnOff

Syntax
BOOL WLAN_OnOff(BOOL bPowerOn)

Description
This function will be used to turn On/Off the power of the WLAN module.

Parameters
 bPowerOn
[in] Boolean that controls the power state of the WLAN module. TRUE will turn on and
FALSE will turn off the WLAN module.

Remark
This API is supported in WLAN module integrated product only.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 38
Software Development Kit
Total: 79

Bluetooth_OnOff

Syntax
BOOL Bluetooth_OnOff(BOOL bPowerOn)

Description
This function will be used to turn On/Off the power of the Bluetooth module
module.

Parameters
 bPowerOn
[in] Boolean value that controls the power state of the Bluetooth module.
module TRUE will turn
on and FALSE will turn off the Bluetooth module.

Remark
This API is supported in Bluetooth module integrated product only.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 39
Software Development Kit
Total: 79

FlightMode_OnOff

Syntax
BOOL FlightMode_OnOff(BOOL bModeOn)

Description
This function will be used to enter/exit Flight mode. It will turn off all RF components to meet
the aviation regulatory and back on according to the previous status.

Parameters
 bModeOn
[in] Boolean value that controls the power state of all RF components which contain
Phone, WLAN, Bluetooth & GPS modules.
modules TRUE will force system to enter Flight mode
and turn the power off. FALSE will turn back on the power of RF components accord
according
to the previous state.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 40
Software Development Kit
Total: 79

5.8 System Information APIs

GetSystemUUID

Syntax
BOOL GetSystemUUID(BYTE* lpUUID, DWORD dwSize)
BOOL GetSystemUUID(BYTE* lpUUID) for MH132

Description
This function will be used to receive the UUID of this device. UUID, is a unique, 128-bit
128
value used to identify objects.
objects. User must allocate enough memory for 16 bytes at least.

Parameters
 lpUUID
[out] The pointer to an UUID value must allocated
alloc 16 bytes at least.

 dwSize
[in] The buffer size of lpUUID, must bigger than 16.
16 MH132 doesn’t have this parameter.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 41
Software Development Kit
Total: 79

GetDeviceName

Syntax
BOOL GetDeviceName(TCHAR* lpszName, DWORD dwSize)
BOOL GetDeviceName(TCHAR* lpszName) for MH132

Description
This function will get the product name of this device. User must allocate enough memory for
20 characters wide string at least.

Parameters
 lpszName
[out] The pointer to a string with allocated memory of 20 characters wide string at least.

 dwSize
[in] The buffer size of lpszName,
lpszName must bigger than 20. MH132 doesn’t have this
parameter.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 42
Software Development Kit
Total: 79

GetDeviceSKUID

Syntax
BOOL GetDeviceSKUID(TCHAR* lpszID)
lpszID

Description
This function will get the product SKU ID of this device.

Parameters
 lpszID
[out] The pointer to a string with allocated memory of 5 characters wide string at least.

Note: For Getac MH132, the definitions of lpszID as follow:


lpszID “10”: EU Bband
“11”: US Bband

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 43
Software Development Kit
Total: 79

GetLanguageID

Syntax
BOOL GetLanguageID(TCHAR* lpszID)
lpszID
int GetLanguageID(TCHAR* lpszID, DWORD dwSize) For PS336

Description
This function will get the product language ID of this device.

Parameters
 lpszID
[out] The pointer to a string with allocated memory of 5 characters wide string at least.

 dwSize
[in] The buffer size of lpszID.
lpszID

Return value
TRUE indicates success. FALSE indicates failure
Buffer size for PS336

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 44
Software Development Kit
Total: 79

GetOSVersion

Syntax
BOOL GetOSVersion(TCHAR* lpszVersion, DWORD dwSize)
BOOL GetOSVersion(TCHAR* lpszVersion)
lpszVersion for MH132

Description
This function will get the version string of OS platform of this device.

Parameters
 lpszVersion
[out] The pointer to a string with allocated memory of 30 characters wide string at least
.
 dwSize
[in] The buffer size of lpszVersion,
lpszVersion must bigger than 30. MH132 doesn’t have this
parameter.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 45
Software Development Kit
Total: 79

GetROMImageVersion

Syntax
BOOL GetROMImageVersion(TCHAR* lpszVersion, DWORD dwSize)
BOOL GetROMImageVersion(TCHAR* lpszVersion)
lpszVersion for MH132

Description
This function will get the version string of ROM Image of this device.

Parameters
 lpszVersion
[out] The pointer to a string with allocated memory of 30 characters wide string at least.

 dwSize
[in] The buffer size of lpszVersion,
lpszVersion must bigger than 30. MH132 doesn’t have this
parameter.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 46
Software Development Kit
Total: 79

GetROMImageVersionMinor

Syntax
BOOL GetROMImageVersionMinor(TCHAR* lpszVersion,
lpszVersion, DWORD dwSize)

Description
This function will get the minor version string of ROM Image of this device.

Parameters
 lpszVersion
[out] The pointer to a string with allocated memory of 10 characters wide string at least.

 dwSize
[in] The buffer size of lpszVersion,
lpszVersion must bigger than 10.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 47
Software Development Kit
Total: 79

GetOSImgVersion

Syntax
int GetOSImgVersion(char* pVersionInfo, DWORD dwSize)

Description
This function will get the PS236 R02 version string of ROM Image of this device.

Parameters
 lpszVersion
[out] The pointer to a string with allocated memory of 10 characters wide string at least.

 dwSize
[in] The buffer size of lpszVersion,
lpszVersion must bigger than 10.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 48
Software Development Kit
Total: 79

GetMicroPVersion

Syntax
BOOL GetMicroPVersion(TCHAR* lpszVersion)
lpszVersion

Description
This function will get the version string of Micro
Micro-controller
controller firmware of this device.

Parameters
 lpszVersion
[out] The pointer to a string with allocated memory of 10 characters wide string at least.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 49
Software Development Kit
Total: 79

GetPhoneVersion

Syntax
BOOL GetPhoneVersion(TCHAR* lpszVersion, DWORD dwSize)
BOOL GetPhoneVersion(TCHAR* lpszVersion)
lpszVersion for MH132

Description
This function will get the version string of WCDMA firmware of this device.

Parameters
 lpszVersion
[out] The pointer to a string with allocated memory of 10 characters wide string at least.
 dwSize
[in] The buffer size of lpszVersion,
lpszVersion must bigger than 10. MH132 doesn’t have this
parameter.

Remark
This API is supported in Phone SKU (ID = 50) only.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 50
Software Development Kit
Total: 79

GetSerialNumber

Syntax
BOOL GetSerialNumber(TCHAR* lpszSN, DWORD dwSize, DWORD dwMode) for PS236
R07 / PS236 EXT / PS336
BOOL GetSerialNumber(TCHAR* lpszSN, DWORD dwSize) for MH132 and PS236 R02

Description
This function will get the serial number string of this device.

Parameters
 lpszSN
[out] The pointer to a string with allocated memory of 20 characters wide string at least.
 dwSize
[In] Allocated buffer size of lpszSN. Upper layer application has to allocate enough
memory buffer for usage. This value must be greater or equal to 8.
 dwMode
[In] dwMode = 0, get PCB SN. dwMode = 1, dwSize = 10, get System
System SN. Only for
PS236 R07 / EXT / PS336
PS336.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 51
Software Development Kit
Total: 79

GetBluetoothMAC

Syntax
BOOL GetBTMac(BYTE* pBTMac, BYTE dwSize)
BOOL GetBluetoothMAC(TCHAR* lpszMAC)
lpszMAC for MH132

Description
This function will get the Bluetooth MAC address string of this device.

Parameters
 lpszMAC
[out] The pointer to a string with allocated memory of 20 characters wide string at least.
For MH312.

 pBTMac
[out] The pointer
inter to a 6 bytes array to indicate the BT MAC.

 dwSize
[in] size = 6.

Remark
This API is supported in Bluetooth module integrated device only.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 52
Software Development Kit
Total: 79

GetWLANMAC

Syntax
BOOL GetWLANMAC(BYTE* pWLANMac, BYTE dwSize)
BOOL GetWLANMAC(TCHAR* lpszMAC)
lpszMAC for MH132

Description
This function will get the WLAN MAC address string of this device.

Parameters
 lpszMAC
[out] The pointer to a string with allocated memory of 20 characters wide string at least.
 dwSize
[in] The buffer size of lpszMAC,
lpszMAC must bigger than 20. MH132 doesn’t have this

Remark
This API is supported in WLAN module integrated device only.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 53
Software Development Kit
Total: 79

GetMemoryStatus

Syntax
BOOL GetMemoryStatus(MEM_STATUS* lpNAND, MEM_STATUS* lpRAM
lpRAM)

Description
This function will get the memory status of the device.

Parameters
 lpNAND
[out] The pointer to a MEM_STATUS structure includes total NAND size and available
size.

 lpRAM
[out]] The pointer to a MEM_STATUS
MEM structure includes total RAM size and available
size.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code

Typedef struct {
DWORD dwTotalSize;
DWORD dwAvailable;
} MEM_STATUS, *PMEM_STATUS;

MEM_STATUS* lpNAND;
MEM_STATUS* lpRAM;

GetMemoryStatus(lpNAND, lpRAM);
Date: 2013/3/14
Getac Handheld Device
Page: 54
Software Development Kit
Total: 79

GetProcessorName

Syntax
int GetProcessorName(TCHAR* lpszName, DWORD dwSize)
BOOL GetProcessorName(TCHAR* lpszName)
lpszName for MH132

Description
This function will get the string of the chip vendor and model of this device. User must
allocate enough memory for 30 characters wide string at least.

Parameters
 lpszName
[out] The pointer to a string with allocated memory of 30 characters wide string at least.
 dwSize
[in] The buffer size of lpszName,
lpszName must bigger than 30. MH132 doesn’t have this

Return value
Return a integer indicates its name length for PS236.
TRUE indicates success. FALSE indicates failure for MH132.

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 55
Software Development Kit
Total: 79

GetIMEI

Syntax
BOOL GetIMEI(TCHAR* lpszIMEI, DWORD dwSize)
BOOL GetIMEI(TCHAR* lpszIMEI)
lpszIMEI for MH132

Description
This function will get the IMEI string of this device. User must allocate enough memory for
30 characters wide string at least.

Parameters
 lpszIMEI
[out] The pointer to a string with allocated memory of 30 characters wide string at least.

 dwSize
[in] The buffer size of lpszIMEI,
lpszIMEI must bigger than 30. MH132 doesn’t have this

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 56
Software Development Kit
Total: 79

GetCPUSpeed

Syntax
BOOL GetCPUSpeed(DWORD* Speed)

Description
This function will get the CPU speed of system.

Parameters
 Speed
[out] A double word pointer for CPU speed.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 57
Software Development Kit
Total: 79

SystemReboot

Syntax
void SystemReboot(void)

Description
Reboot System.

Parameters
 None

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 58
Software Development Kit
Total: 79

5.9 Personal Information APIs

GetOwnerName

Syntax
BOOL GetOwnerName(TCHAR* lpszName, DWORD dwSize)
BOOL GetOwnerName(TCHAR* lpszName)
lpszName for MH132

Description
This function will get the name string of the owner of this device. User must allocate enough
memory for 40 characters wide string at least.

Parameters
 lpszName
[out] The pointer to a string with allocated memory of 40 characters wide string at least.

 dwSize
[in] The buffer size of lpszName,
lpszName must bigger than 40. MH132 doesn’t have this.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 59
Software Development Kit
Total: 79

GetOwnerCompany

Syntax
BOOL GetOwnerCompany(TCHAR* lpszName, DWORD dwSize)
BOOL GetOwnerCompany(TCHAR* lpszName)
lpszName for MH132

Description
This function will get the name string of the owner company of this device. User must allocate
enough memory for 40 characters wide string at least.

Parameters
 lpszName
[out] The pointer to a string with allocated memory of 40 characters wide string at least.

 dwSize
[in] The buffer size of lpszName,
lpszName must bigger than 40. MH132 doesn’t have this.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 60
Software Development Kit
Total: 79

GetOwnerAddress

Syntax
BOOL GetOwnerAddress(TCHAR* lpszAddress, DWORD dwSize)
BOOL GetOwnerAddress(TCHAR* lpszAddress)
lpszAddress for MH132

Description
This function will get the name string of the owner company of this device. User must allocate
enough memory for 128 characters wide string at least.

Parameters
 lpszAddress
[out] The pointer to a string with allocated memory of 128 characters wide string at least.

 dwSize
[in] The buffer size of lpszAddress,
lpszAddress must bigger than 128. MH132 doesn’t have this.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 61
Software Development Kit
Total: 79

GetOwnerTelephone

Syntax
BOOL GetOwnerTelephone(TCHAR* lpszTel, DWORD dwSize)
BOOL GetOwnerTelephone(TCHAR* lpszTel
lpszTel) for MH132

Description
This function will get the string of the owner telephone of this device. User must allocate
enough memory for 30 characters wide string at least.

Parameters
 lpszTel
[out] The pointer to a string with allocated memory of 30 characters wide string at least.

 dwSize
[in] The buffer size of lpszTel,
lpszTel must bigger than 30. MH132 doesn’t have this.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 62
Software Development Kit
Total: 79

GetOwnerEMail

Syntax
BOOL GetOwnerEMail(TCHAR* lpszEMail, DWORD dwSize)
BOOL GetOwnerEMail(TCHAR* lpszEMail
lpszEMail) for MH132

Description
This function will get the string of the owner ee-mail address of this device. User must allocate
enough memory for 54 characters wide string at least.

Parameters
 lpszEMail
[out] The pointer to a string with allocated memory of 54 characters wide string at least.

 dwSize
[in] The buffer size of lpszEMail,
lpszEMail must bigger than 54. MH132 doesn’t have this.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 63
Software Development Kit
Total: 79

5.10 MISC APIs

Button_SetFNKeyStatus

Syntax
BOOL Button_SetFNKeyStatus(BOOL bLock
bLock)

Description
This function will allow user to lock or unlock the FN button in the application.

Parameters
 bLock
[in] Boolean TRUE to lock the FN button to enable alternately keyboard function.
FALSE to unlock the FN button and the keyboard function will back to normal setting.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 64
Software Development Kit
Total: 79

Button_GetFNKeyStatus

Syntax
BYTE Button_GetFNKeyStatus(void)
Button_GetFNKeyStatus(void

Description
This function will allow user to check the status of FN button in the application.

Parameters
None

Return value
1 indicates FN key is locked. 0 indicates unlock.

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 65
Software Development Kit
Total: 79

SetExpansionUART

Syntax
BOOL SetExpansionUART(BOOL bMode)
bMode

Description
This function will allow user to inform system switching the UART port between the
Flexiconn UART port or the bottom side UART port.1

Parameters
 bMode
[in] Boolean
TRUE to set the bottom side UART port to the upper side Flexiconn UART port.
FALSE to set the Flexiconn UART port back to bottom side UART port.

Return value
TRUE indicates success. FALS
FALSE indicates failure

Example Sample Code

1
No matter using upper side Flexiconn UART port or bottom side UART, from software developer point of view, it is
“COM1:” in the system.
Date: 2013/3/14
Getac Handheld Device
Page: 66
Software Development Kit
Total: 79

GetExpansionUART

Syntax
BOOL GetExpansionUART(BYTE* lpMode)
lpMode

Description
This function will allow user to check the status of which UART port can be used in current
system configuration.

Parameters
 lpMode
[out] pointer to a byte
*lpMode = 0; means the system configuration has been switched to the bottom side
External UART
*lpMode=1; means the system configuration has been switched the upper side Flexiconn
UART port.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 67
Software Development Kit
Total: 79

SetExpansionPOWER

Syntax
BOOL SetExpansionPOWER(BOOL bEnable)

Description
This function will enable the power for Flexiconn port device.

Parameters
 bMode
[in] Boolean
TRUE to enable the power for Flexiconn port.
FALSE to disable the power of Flexiconn port.

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 68
Software Development Kit
Total: 79

GetExpansionPOWER

Syntax
BOOL GetExpansionPOWER(DWORD*
GetExpansionPOWER( bEnable) For PS336
BOOL GetExpansionPOWER(BOOL*
GetExpansionPOWER( bEnable) For PS236EXT,PS236R07

Description
This function will allow user to check the power status of Flexiconn port.

Parameters
 lpEnable
[out] Boolean
0, means the power of Flexiconn port is OFF.
1; means the power of Flexiconn port is ON.
ON

Return value
TRUE indicates success. FALSE indicates failure

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 69
Software Development Kit
Total: 79

IsUsingAABattery

Syntax
BOOL IsUsingAABattery(void)

Description
This function can get if using AA battery.

Parameters
 None

Return value
TRUE indicates using AA battery.
battery FALSE indicates not using AA battery.

Example Sample Code


Date: 2013/3/14
Getac Handheld Device
Page: 70
Software Development Kit
Total: 79

6. How to Remap Keypad Definition


6.1 Concept
When key is pressed, keypad driver sent a virtual-key
virtual key to OS except camera key. So, if we want to
define each key for other purpose, we need to use the Windows API “hook” to achieve this.
6.2 Pseudo-Code
Here are the steps to create a hook for keypad.
1 Create a thread for keypad hook.
hook
2 Setting up hook function and key processing.
processing
2.1 Call Windows API to activate a hook.
2.2 Catch keys we want, and handle it.
3 Handle Windows message
6.3 Example
static HINSTANCE g_hHookApiDLL = NULL; //handle to coredll.dll, where all the hook related APIs are present
static HHOOK g_hInstalledLLKBDhook = NULL; //g_hInstalledLLKBDhook represents handle to the installed KB hook

CreateThread(NULL,
eateThread(NULL, 0, HookThread, &g_hInst, 0, &dwThreadID)

DWORD WINAPI HookThread(LPVOID lpNull)


{
MSG message;
ActivateKBHook(g_hInst, HookProc);
while(GetMessage(&message, NULL, 0, 0))
{
TranslateMessage(&message);
DispatchMessage(&message);
}

DeactivateKBHook();
return 1
}

BOOL ActivateKBHook(HINSTANCE hInstance, HOOKPROC LLKeyboardHookCallbackFunction)


{
//we need to manually load these standard Win32 API calls
//MSDN states that these aren't supported in WinCE
HINSTANCE SetWindowsHookEx = NULL;
HHOOK CallNextHookEx = NULL;
HANDLE UnhookWindowsHookEx = NULL;

// load the coredll.dll


g_hHookApiDLL = LoadLibrary(_T("coredll.dll"));
//load the SetWindowsHookEx API call
//the SetWindowsHookEx function installs an application-defined
application hook procedure into a hook chain.
//You would install a hook procedure to monitor the system for certain types of events.
//here we use use the hook to monitor kyeboard events
SetWindowsHookEx okEx = (_SetWindowsHookExW)GetProcAddress(g_hHookApiDLL, _T("SetWindowsHookExW"));
//install the KB hook
//the handle e needs to be saved for default processing of the events and to uninstall the hook, once we are done with it
g_hInstalledLLKBDhook = SetWindowsHookEx(WH_KEYBOARD_LL,
indowsHookEx(WH_KEYBOARD_LL, LLKeyboardHookCallbackFunction, hInstance, 0);
//load CallNextHookEx() API call
//the CallNextHookEx function passes the hook information to the next hook procedure in the current hook chain.
//we use this call for default processing
rocessing of events.
CallNextHookEx = (_CallNextHookEx)GetProcAddress(g_hHookApiDLL, _T("CallNextHookEx"));
Date: 2013/3/14
Getac Handheld Device
Page: 71
Software Development Kit
Total: 79

//load UnhookWindowsHookEx() API


//the UnhookWindowsHookEx function removes a hook procedure installed in a hook chain by the SetWindowsHookEx fu
function.
//we use this call to unistall the hook.
UnhookWindowsHookEx = (_UnhookWindowsHookEx)GetProcAddress(g_hHookApiDLL, _T("UnhookWindowsHookEx"));
//all the APIs are loaded and the application is hooked
return true;
}

LRESULT HookProc(int code, WPARAM wParam, LPARAM lParam)


{
if (code < 0)
{
CallNextHookEx(NULL, code, wParam, lParam);
}
//here, we add process for keys we want to modify
switch (wParam)
{
case WM_KEYDOWN://catch //catch key down message
switch((((KBDLLHOOKSTRUCT*)lParam)
switch((((KBDLLHOOKSTRUCT*)lParam)->vkCode))
{
case VKF2://if VK_ _F2 is down, remap VK_F2 to VK_TSTAR
keybd_event(VK_TSTAR, 0, KEYEVENTF_SILENT, 0);
keybd_event(VK_TSTAR, 0, KEYEVENTF_SILENT|KEYEVENTF_KEYDOWN
KEYEVENTF_SILENT|KEYEVENTF_KEYDOWN, 0);
return 1;
break;
}
break;
case WM_KEYUP://catch
//catch key up message
switch((((KBDLLHOOKSTRUCT*)lParam)
switch((((KBDLLHOOKSTRUCT*)lParam)->vkCode))
{
case VKF2://if VK_ _F2 is up, remap VK_F2 to VK_TSTAR
keybd_event(VK_TSTAR, 0, KEYEVENTF_SILENT, 0);
keybd_event(VK_TSTAR, 0, KEYEVENTF_SILENT|KEYEVENTF_KEYUP, 0);
return 1;
break;
}
default:
break;
}
//pass control to next hook in the hook chain.
return ( CallNextHookEx(NULL, code, wParam, lParam) );
}

BOOL DeactivateKBHook()
{
//unload the hook
if(g_hInstalledLLKBDhook != NULL)
{
UnhookWindowsHookEx(g_hInstalledLLKBDhook);
g_hInstalledLLKBDhook = NULL;
}

//unload the coredll.dll


if(g_hHookApiDLL != NULL)
{
FreeLibrary(g_hHookApiDLL);
g_hHookApiDLL = NULL;
}

//we have terminated gracefully


return true;
}
6.4 Camera Key (PS236/PS236 EXT/PS336
EXT series)
Camera key use independent GPIO pin to trigger, So we cannot use hook function to remap it. If
we want to use camera key for other purpose, we may need to modify the keypad driver.
Date: 2013/3/14
Getac Handheld Device
Page: 72
Software Development Kit
Total: 79
Date: 2013/3/14
Getac Handheld Device
Page: 73
Software Development Kit
Total: 79

7. Frequently Asked Questions


7.1
.1 How can I run an application from SD card automatically?

Microsoft Windows Mobile Operation System has provided the “Autorun” feature to assist
user executing specific application automatically. To take the advantage of this feature,
please follow these steps to configure your SD card.

Step1 – Prepare a SD card


Step2 – Create a folder which named “2577” in the SD card
Step3 – Copy all the related files into “2577” including the executable file
Step4 – Rename the executable
le file to “autorun.exe”
Step5 – Insert the SD card into the SD slot of Getac’s handheld product.
Step6 – Press the power button to resume the system. (PS236 series does not support
Auto-wake by SD card)

For more detail information, please refer to Microsoft


Micros MSDN website:
http://msdn.microsoft.com/en-us/library/bb159776.aspx
us/library/bb159776.aspx
Date: 2013/3/14
Getac Handheld Device
Page: 74
Software Development Kit
Total: 79

7.2
.2 How can I rotate the system screen thru my application?

For some specific scenarios, landscape mode might be a better mode to provide
information to the end user. Microsoft Windows Mobile Operation System has provided
“Screen Rotation” feature as part of it. To implement this feature into your application,
please refer to the implementation guide on the Microsoft MSDN website.
http://msdn.microsoft.com/en-us/library/ms911017.aspx
us/library/ms911017.aspx
Date: 2013/3/14
Getac Handheld Device
Page: 75
Software Development Kit
Total: 79

7.3
.3 How can I pack my applications and settings for multiple units’ deployment?

For some Enterprise users, the easier way to deploy specific application and related
system settings into Windows Mobile device is creating a “Customized Cab file”.
Microsoft has provided this feature in Visual Studio 2005/2008 and makes the Cab file
creation easily.
Please refer to the MSDN website for detail information.
http://msdn.microsoft.com/en-us/library/bb158529.aspx
us/library/bb158529.aspx
Date: 2013/3/14
Getac Handheld Device
Page: 76
Software Development Kit
Total: 79

7.4 How can I keep the unit awake if specific application running?

For some specific scenarios, avoid


avoid enter suspend mode when specific application running
is necessary. Microsoft Windows Mobile Operation System has provided
“SystemIdleTimerReset” function to reset idle timer to avoid unit enter suspend mode.

This function resets a system timer that co


controls
ntrols whether or not the device will
automatically go into a suspended state

Syntax
void WINAPI SystemIdleTimerReset(void);

Parameter
None.

Return
None

Notes
This function must be use appropriately. On battery-powered
battery devices, a program that
never suspends (or sleeps) by continually calling SystemIdleTimerReset can quickly
drain the batteries.
Date: 2013/3/14
Getac Handheld Device
Page: 77
Software Development Kit
Total: 79

Appendix A : API List For Each Product


Getac Handheld
PS236 PS236 PS236 PS535F MH132 PS336
PS535E
R02 EXT R07 (WM 6.5) (WM 6.5) (WEH6.5)
EComAcc_InitDevice ○ ○ ○ ○ ○ X ○
EComAcc_DeinitDevice ○ ○ ○ ○ ○ X ○
EComAcc_GetData ○ ○ ○ ○ ○ X ○
2
GSensor_InitDevice X X X X X X X
GSensor_DeinitDevice X X X X X X X
GSensor_GetData X X X X X ○ X
GSensor_GetRawData ○ ○ ○ X X X ○
Pressure_InitDevice ○ ○ ○ ○ ○ X ○
Pressure_DeinitDevice ○ ○ ○ ○ ○ X ○
Pressure_GetPaTemp ○ ○ ○ ○ ○ X ○
3
CreateFile ○ ○ ○ ○ ○ ○ ○
Speaker_GetVolume X ○ ○ X X ○ ○
Speaker_SetVolume X ○ ○ X X ○ ○
Receiver_GetVolume X ○ ○ X X ○ ○
Receiver_SetVolume X ○ ○ X X ○ ○
Microphone Gain Control X X X X X ○ X
Charging LED Indicator
○ ○ ○ X X ○ X
Control
Camera Flash LED control ○ ○ ○ X X X ○
Set_BT_LED_ON ○ ○ ○ X X X ○
Set_WIFI_LED_ON ○ ○ ○ X X X ○
Set_3G_LED_ON ○ ○ ○ X X X ○
Set_GPS_LED_ON X X X X X X ○
Backlight_GetLevel X ○ ○ X X ○ ○
Backlight_SetLevel X ○ ○ X X ○ ○
Phone_OnOff X ○ ○ X X ○ ○
WLAN_OnOff X ○ ○ X X ○ ○
Bluetooth_OnOff X ○ ○ X X ○ ○
FlightMode_OnOff X ○ ○ X X ○ ○
GetSystemUUID X ○ ○ X X ○ ○
GetDeviceName X ○ ○ X X ○ ○
GetDeviceSKUID X X X X X ○ ○
GetLanguageID X X X X X ○ ○
GetOSVersion X ○ ○ X X ○ ○
GetROMImageVersion X ○ ○ X X ○ ○
GetROMImageVersionMinor X ○ ○ X X X ○
GetOSImgVersion ○ X X X X X X
GetMicroPVersion ○ ○ ○ X X X ○
GetPhoneVersion X ○ ○ X X ○ ○
GetSerialNumber ○ ○ ○ X X ○ ○
GetBluetoothMAC
○ ○ ○ X X ○ ○
(GetBTMac)

2
For MH132, G-Sensor
Sensor is initialized in system boot, developer need not to do this.
3
GPS without GPS Intermediate Driver,, For PS236/PS236EXT, please use COM4; For PS535F/PS535E, please use COM2;
When develop with MH132, please use COM7
Date: 2013/3/14
Getac Handheld Device
Page: 78
Software Development Kit
Total: 79

GetWLANMAC X ○ ○ X X ○ ○
GetMemoryStatus X ○ ○ X X ○ ○
GetProcessorName X ○ ○ X X ○ ○
GetIMEI X ○ ○ X X ○ ○
GetCPUSpeed ○ ○ ○ X X X ○
SystemReboot ○ ○ ○ X X X ○
GetOwnerName X ○ ○ X X ○ ○
GetOwnerCompany X ○ ○ X X ○ ○
GetOwnerAddress X ○ ○ X X ○ ○
GetOwnerTelephone X ○ ○ X X ○ ○
GetOwnerEMail X ○ ○ X X ○ ○
Button_SetFNKeyStatus X ○ ○ X X X ○
Button_GetFNKeyStatus X ○ ○ X X X ○
SetExpansionUART X ○ ○ X X X X
GetExpansionUART X ○ ○ X X X X
SetExpansionPOWER X ○ ○ X X X ○
GetExpansionPOWER X ○ ○ X X X ○
IsUsingAABattery X ○ ○ X X X X
Date: 2013/3/14
Getac Handheld Device
Page: 79
Software Development Kit
Total: 79

Appendix B : Sample Application Summary


B.1 SystemInfo
This demo application is designed for how to use Getac APIs to access product information.
B.2 CameraCapture
This demo application is provided by Microsoft for how to use DirectShow to create a camera
application.
B.3 Level Gauge
This demo application is designed for how to use G-sensor
G sensor data to design a level gauge application.
B.4 GPS Sample Application
This demo application is designed for how to access data from built-in
built in GPS module in Getac’s
product.
B.5 MenuChange
This demo application is designed for how to change system menu display on the taskbar
dynamically.
B.6 SensorsDemo
This demo
o application is designed for how to access MEMS data from the built-in
built in sensor in Getac
Product.

You might also like