CSL CS101-2 EPC CLASS 1 GEN 2 RFID HANDHELD READER
USER'S MANUAL, VERSION 1.0
Copyright © Convergence Systems Limited, All Rights Reserved
152
ResetDevice();
}
////////////////////////////////////////////////////////////////////////////////////
public const uint FILE_DEVICE_HAL = 0x00000101;
public const uint METHOD_BUFFERED = 0;
public const uint FILE_ANY_ACCESS = 0;
[DllImport("Coredll.dll")]
public extern static uint KernelIoControl
( uint dwIoControlCode,
IntPtr lpInBuf,
uint nInBufSize,
IntPtr lpOutBuf,
uint nOutBufSize,
ref uint lpBytesReturned
);
//void GwesPowerOffSystem(void); //This API is OEM implementation dependent
[DllImport("Coredll.dll")] // a suspend operation on GslPos pda
public extern static void GwesPowerOffSystem();
public uint ResetPocketPC()
{ /// KernelIo may be called by CF .NET only.
uint bytesReturned = 0;
uint IOCTL_HAL_REBOOT = CTL_CODE(FILE_DEVICE_HAL, 15,
METHOD_BUFFERED, FILE_ANY_ACCESS);
return KernelIoControl(IOCTL_HAL_REBOOT, IntPtr.Zero, 0,
IntPtr.Zero, 0, ref bytesReturned);
}
private void ResetDevice()
{
DialogResult r = MessageBox.Show( "Execute reset(Yes) or PowerDown(No)?", "Test",
MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2 );
if (r == DialogResult.Yes)
{ ResetPocketPC();
}else{
GwesPowerOffSystem();
}
}
}