23.12.2012 Views

Digital Forensics in Small Devices: RFID Tag Investigation

Digital Forensics in Small Devices: RFID Tag Investigation

Digital Forensics in Small Devices: RFID Tag Investigation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

MessageBox.Show(this, "Connection to Reader has been lost or Reader has<br />

been turned off!", "Notification", MessageBoxButtons.OK,<br />

MessageBoxIcon.Exclamation);<br />

}<br />

}<br />

usb<strong>RFID</strong>.OnConnectionLost -= OnConnectionLost;<br />

usb<strong>RFID</strong>.OnAsyncRead -= OnAsyncRead;<br />

btnConnect.Enabled = true;<br />

btnDisConnect.Enabled = false;<br />

btnDownloadLog.Enabled = false;<br />

btnEraseLog.Enabled = false;<br />

tmrHalfSec.Enabled = false;<br />

// Our delegate that gets called by the RfidUsb class<br />

void OnConnectionLost(System.IntPtr cyDevice)<br />

{ // Note that the callback is made from the <strong>RFID</strong> DLLs worker thread,<br />

}<br />

<strong>Tag</strong>ID);<br />

// and it <strong>in</strong>vokes this delegate on a Thread from the Thread Pool.<br />

// So we don't have direct access to the Form here, we have to use<br />

// another delegate to get to the Form.<br />

this.Invoke(new ConnectionLostDelegate(ConnectionLostMethod),<br />

new Object [] { cyDevice });<br />

// Def<strong>in</strong>e the Delegate and Method for detect<strong>in</strong>g asynchronous reads<br />

// from our callback (made <strong>in</strong> a different thread).<br />

private delegate void AsyncReadDelegate(System.IntPtr cyDevice, str<strong>in</strong>g<br />

// Our method for updat<strong>in</strong>g the Example1 class<br />

29

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!