M500 USER MANUAL AND PROGRAMMER SDK
Page 20
9.
C#
API
The C# API provides a simple interface to the M500. The C# developer should be able to use this interface
to quickly interface with the M500 without needing to interface with the M500 DLL unmanaged code
directly.
The DLL creates its own thread to poll the M500. The application should register for call back events at
initialization. The DLL will then call back the application on the DLLs thread when an event occurs. The
application should then synchronize the call back to its thread using the Invoke method in
FormM500demo.cs.
9.1
API
F
UNCTIONS
void
SetLogDir
(LOG_DIR) [Optional]
Call this function before Init() to override the default log directory. By default if this function is not called
the M500DLL will create the M500DLL.LOG file in the same directory it is running in. Pass this function the
string of the desired log directory. To disable logging pass the string “null”.
void
AutoFwUpgrade
(bool bAuto)
Call this function with false before Init() to override the default behavior (as of version 1.9) of automaticaly
updating the M500’s firmware if it is out of date. You do not have to call this function if you want the
default behavior of automatic firmware upgrade.
void
Init
()
Call this function at initialization such as during form load.
void
RegCB
(OnNewEvent)
Register event call back.
void
LastScan
(iLastScan) [Optional]
By default, cards are scanned using white, IR, and UV light.
To override the last scan pass iLastScan with the folling values after the RGB image is ready:
0 =
RGB-IR-UV (normal)
3 = RGB only
void
Close
()
Call this function before closing the application such as during form closed.
void
ClearData
(byte byGrey)
Call this function to clear the bitmap images, barcode, and magnetic stripe data. There is no need to do
this under normal circumstances but an application may wish to do this to after the scanned data has
been processed for maximum privacy.
The byte passed to ClearData() will be copied to every 24bit RGB pixels.
Passing 0 will results in black bitmaps (until the next scan)
Or passing 0x80 will result in medium gray.