The text of a manual · part 5 of 5
PA600 Programming Manual, pages 37 to 41
Pages 37 to 41 of 41
The original document is the PDF (301 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Unitech PA600
Page 37
6.7. WiFi module related functions 6.7.1. Inquire WiFi module status Function Description:
This function returns WiFi module enable/disable status. Function call:
BOOL GetWLANStatus() Return BOOL:
TRUE = module is enabled. FALSE = module is disable.
6.7.2. Enable/Disable WiFi module status Function Description:
This function enables/disables WiFi module. Function call:
void WLANPowerEnable( BOOL fOn) Parameters(Input)
fOn:
-
BOOL:
TRUE = enable module. FALSE = disable module.
Page 38
6.8. Bluetooth related API Note : Not like Unitech’s PA9xx series, Bluetooth related APIs are implemented on SysIOAPI.DLL. It is suggested to use those API from SysIOAPI. But, we still keep the same function call on BTAPI.DLL for backward compatible issue.
6.8.1. Enable/Disable Bluetooth Power status Function Description:
Enable Bluetooth Module Power ON/OFF Function call:
void BT_PowerEnable ( BOOL bEnable ) Parameter (Input)
bON: BOOL: FALSE
TRUE
= Enable
= Disable
Return code:
None 6.8.2. Get BT Power Status Function Description: Get Bluetooth Module Power Status Function call: BYTE BT_PowerStatus ( void ) Return code: BYTE: 1 = Bluetooth Module is Power ON
0 = Bluetooth Module is Power OFF
-
Page 39
7. BlueTooth relative API - BTAPI.DLL This DLL provide BlueTooth relative API. Two files are essential and provided in SDK, BTAPI.LIB and BTAPI.H. 7.1. Enable/Disable Bluetooth Power status Function Description:
Enable Bluetooth Module Power ON/OFF Function call:
void BT_PowerEnable ( BOOL bEnable ) Parameter (Input)
bON: BOOL: FALSE
TRUE
= Enable
= Disable
Return code:
NONE 7.2. Get BT Power Status Function Description: Get Bluetooth Module Power Status Function call: BYTE BT_PowerStatus ( void ) Return code: BYTE: 1 = Bluetooth Module is Power ON
0 = Bluetooth Module is Power OFF
-
Page 40
8. Dynamic Load DLL Compiler would not load the DLL while use dynamic load DLL, it help user to load the DLL if it exists while the application executed. The follow is the example. Note: Even user does not need include the header and lib file but need to know the function definition. ////////////////////////////////////////////////////////////////////////////////////////// HINSTANCE g_hUSIDLL; typedef BOOL (*lpfnUSI_GetScannerVersion)(LPTSTR model, LPTSTR firmware, LPTSTR sdk, int blen); lpfnUSI_GetScannerVersion USI_GetScannerVersion; g_hUSIDLL = LoadLibrary(L"\\Windows\\USI.dll"); if (g_hUSIDLL != NULL) { USI_GetScannerVersion = (lpfnUSI_GetScannerVersion)GetProcAddress(g_hUSIDLL, TEXT("USI_GetScannerVersion")); } else { MessageBox(_T("Load library USI.dll fail"), NULL, MB_OK); return; } TCHAR lstrmodel[50], lstrfirmware[50], lstrsdk[50]; if (USI_GetScannerVersion != NULL) rc = USI_GetScannerVersion(lstrmodel, lstrfirmware, lstrsdk, sizeof(lstrmodel) + sizeof(lstrfirmware) + sizeof(lstrsdk)); else MessageBox(_T("USI_GetScanerVersion does not find"), NULL, MB_OK); if (g_hUSIDLL != NULL) FreeLibrary(g_hUSIDLL); //////////////////////////////////////////////////////////////////////////////////////////
-
Page 41
9. Useful function call - without include SysIOAPI.DLL 9.1. Warm-boot, Cold-boot and power off #include <pkfuncs.h> #include "oemioctl.h" // Warn boot KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL); // Cold boot KernelIoControl(IOCTL_COLD_BOOT, NULL, 0, NULL, 0, NULL); // Power off { DWORD dwExtraInfo=0; BYTE bScan=0; keybd_event( VK_OFF, bScan, KEYEVENTF_SILENT, dwExtraInfo ); keybd_event( VK_OFF, bScan, KEYEVENTF_KEYUP, dwExtraInfo ); }
9.2. Get Device ID In PA600, an unique ID had been burnt into terminal, user can check it by pressing “Func”+”9”. The sample code for read device ID as follow, //////////////////////////////////////////////////////////////// HWND hDeviceId = GetDlgItem(hWnd, IDC_DEVICEID); PDEVICE_ID pDeviceID = NULL; TCHAR outBuf[512], szProductID[100], stringBuffer[100]; BYTE szBuff[255]; DWORD bytesReturned; char platformID[64]; pDeviceID = (PDEVICE_ID)outBuf; pDeviceID->dwSize = sizeof(outBuf); if (KernelIoControl(IOCTL_HAL_GET_DEVICEID, NULL, 0, outBuf, sizeof(outBuf), &bytesReturned)) { // Platform ID memcpy((PBYTE)platformID, (PBYTE)pDeviceID + pDeviceID->dwPlatformIDOffset, pDeviceID->dwPlatformIDBytes); // Device ID for WinCE version memcpy((PBYTE)stringBuffer, (PBYTE)pDeviceID + pDeviceID->dwPresetIDOffset, pDeviceID->dwPresetIDBytes); swprintf(szProductID, _T("%s"), stringBuffer); // Device ID for Mobile version memcpy((PBYTE) szBuff, (PBYTE)pDeviceID + pDeviceID->dwPresetIDOffset, pDeviceID->dwPresetIDBytes); swprintf(szProductID, TEXT("%X%X%X%X%X%X%X%X"), szBuff [0], szBuff [1], szBuff [2], szBuff [3], szBuff [4], szBuff [5], szBuff [6], szBuff [7]); } ///////////////////////////////////////////////////////// The code will have platformID holds Platform ID, and deviceID holds Device ID.
-