private static List<rfidReaderID> EnumerateReaders( rfidReaderID whereToLook )
{
if ( rfid.Constants.Result.OK != LakeChabotReader.LIBRARY_Result )
{
throw new rfidException( rfidErrorCode.LibraryFailedToInitialize );
}
//if ( Mode == rfidReader.OperationMode.Static )
//{
// throw new rfidException( rfidErrorCode.CannotBindToStaticReader );
//}
if ( whereToLook == null )
{
throw new ArgumentNullException( "whereToLook" );
}
if ( whereToLook.LocationType != rfidReaderID.LocationTypeID.LocalDevice )
{
throw new rfidException( rfidErrorCode.LocationTypeNotSupported, String.Format( "reader does not support {0} location type", Enum.GetName( typeof( rfidReaderID.LocationTypeID ), whereToLook.LocationType ) ) );
}
List<rfidReaderID> readers = new List<rfidReaderID>( );
foreach ( KeyValuePair<UInt32, rfid.Structures.RadioInformation> pair in LakeChabotReader.LOCATED_READERS )
{
readers.Add
(
new rfidReaderID
(
rfidReaderID.ReaderType.MTI,
0, // bad handle ~ unknown handle
System.Text.Encoding.ASCII.GetString( pair.Value.uniqueId, 0, pair.Value.uniqueId.Length ),
"RFID reader ",
"local attached reader",
rfidReaderID.LocationTypeID.LocalDevice
)
);
}
return readers;
}