2.2.4
Compile and Run
Even if tags cannot be read yet, you can create an application to prove that it can at least
start up and shut down. You can improve the visual appearance by indicating the status of
the functions which you called in the results window of your application; The code for starting
the RFID Reader Interface:
private void menuReaderStart_Click(object sender, EventArgs e)
{
try
{
}
catch (RfReaderApiException rfidException)
{
}
}
...
Mobile Reader
Function Manual, 02/2009, J31069-D0198-U001-A1-0076
// First, we add an event handler to catch alarm notifications
RfReaderApi.Current.Alarms +=
new RfAlarmHandler(rfmIntegration.AlarmHandler);
// We want to create and start an instance of the RFID
// reader interface for a handheld device with a default name.
RfReaderInitData initData = new RfReaderInitData();
// Initialize the appropriate reader type (RF610M, RF310M)
// and reader mode
initData.Type = „RF610M";
initData.Mode = RfReaderInitData.ReaderMode.Standalone;
// With RfReaderApi.Current we address the current
// RFID reader interface instance
// or initiate the creation of a new instance.
// StartReader connects to an existing reader service
// or creates a new reader service.
RfReaderApi.Current.StartReader(initData);
WriteInformationLine("Reader started successfully");
// Something went wrong while starting the reader.
// More information is available by inspecting the
// RfReaderApiException's members ResultCode, Error,
// Cause and Description.
WriteInformationLine(string.Format("ERROR: {0} - {1}, cause:
{2}, desc: {3}\r\n",
rfidException.ResultCode, rfidException.Error,
rfidException.Cause, rfidException.Description));
RFID Reader Interface User's Guide
2.2 How Do I Use the Reader Interface?
15