Unitech PA500 manual Get Device ID

Page 29

8. Useful function call - without include SysIOAPI.DLL

8.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 );

}

8.2.Get Device ID

In PA500, 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.

-

Image 29
Contents PA500 Programming Manual USI.DLL Unitech Scanner Interface DLL Automatically enable scanner beam with pressing trigger keySCANKEY3.DLL Backward Compatible API for PT930/PT930S’S GET Device ID Update Notes Introduction How to download data from scanner COM definition for PA500 Parameter input Function callReset Scanner Enable / Disable ScannerGet error code Returns the system error codeParameter output Get scan dataFunction Description Get length of scanned data Get Symbology nameWait for acknowledgement of the last sent command Good read indicatorSave setting to profiles Clear scan data system bufferChange scanner setting from specified setting profile Save scanner setting into specified fileAutomatically enable scanner beam with pressing trigger key Parameter output ReturnTest if Scan2Key is enabled Check if auto scanning is enableStop auto scanning function Check if Scan2Key.exe program is running or notSend scanner command to decoding chip Enable/Disable Scan2KeyOnly send single command decoding chip Esc, 0x80+cmd Function callEsc, parameter1, parameter2, …, BCC Send command to decoding chipControl command for decoder chip Special Command for controlEnable in Communication Code32set TRACK1,5 TRACK2,6 TRACK3Labelcode CodabarsetUpcaset UpcesetUPC a PTEnableBarcode Function call Disable DecoderCheck barcode input Return codeGet DLL version no Reset all symbologies to defaultRead barcode data Enable laser trigger key Disable laser trigger keyPTEnableBarToKey Function call for VC INT PTVersionvoid Return IntegerKeypad Related Functions SysIOAPI.DLLReturn code Bool True Caps lock False Caps unlock Return code True Shift lock False Shift unlockParameterInput Scanner Related FunctionsExample LED related functionParametersInput LCD/Backlight related functionDynamic Load DLL Get Device ID Update notes
Related manuals
Manual 84 pages 14.34 Kb