static LakeChabotReader( )
{
try
{
LakeChabotReader.MANAGED_ACCESS = new rfid.Linkage( );
}
catch ( Exception e )
{
throw e; // TODO: more resolution of error e.g. missing dll
}
if (rfid.Constants.Result.OK != LakeChabotReader.MANAGED_ACCESS.API_Startup(LakeChabotReader.LIBRARY_VERSION, LakeChabotReader.LIBRARY_MODE))
{
throw new rfidException( rfidErrorCode.LibraryFailedToInitialize );
}
LakeChabotReader.LIBRARY_Result = rfid.Constants.Result.OK;
// Track keyed by cookie ~ allow ( later ) to open and close radios
// dynamically during application execution - currently ALL OPEN
rfid.Structures.RadioEnumeration radioEnum = new rfid.Structures.RadioEnumeration( );
//clark 2011.05.20 Show Tracer no matter the device is disconneced.
// Let user to set comport.
LakeChabotReader.MANAGED_ACCESS.API_RetrieveAttachedRadiosList(radioEnum, 0);
//if
//(
// rfid.Constants.Result.OK !=
// LakeChabotReader.MANAGED_ACCESS.API_RetrieveAttachedRadiosList(radioEnum, 0)
//)
//{
// throw new rfidException( rfidErrorCode.LibraryFailedToInitialize );
//}
LakeChabotReader.LOCATED_READERS =
new Dictionary<UInt32, rfid.Structures.RadioInformation>( );
foreach ( rfid.Structures.RadioInformation radioInfo in radioEnum.radioInfo )
{
//clark 2011.3.23 not sure
uint uiUniqueId = BitConverter.ToUInt32( radioInfo.uniqueId, 0);
LakeChabotReader.LOCATED_READERS.Add(uiUniqueId, radioInfo);
//LakeChabotReader.LOCATED_READERS.Add(radioInfo.cookie, radioInfo);
}
LakeChabotReader.OPENED_READERS =
new Dictionary<UInt32, rfid.Structures.RadioInformation>( );
try
{
new PerformanceCounter( "Processor", "% Processor Time", "_Total", "." );
}
catch ( Exception ) { }
}