private void Rfid_Attach(object sender, AttachEventArgs e) { Phidgets.RFID attached = (Phidgets.RFID)sender; this.textBoxName.Text = attached.Name; this.textBoxVersion.Text = attached.Version.ToString(); this.checkBoxAttached.Checked = true; this.IsLocked = false; this.rfid.Antenna = true; this.rfid.LED = true; this.StatusMessage("RFID module attached"); }
private void Rfid_Detach(object sender, DetachEventArgs e) { Phidgets.RFID detached = (Phidgets.RFID)sender; this.textBoxName.Text = ""; this.textBoxVersion.Text = ""; this.textBoxTag.Text = ""; this.checkBoxAttached.Checked = false; this.IsLocked = false; this.tokenValidator.ID = ""; this.tokenValidator.UserName = ""; this.tokenValidator.IsValid = false; this.StatusMessage("RFID module detached"); }
/// <summary> /// Creates and waits for a connected RFID USB device. /// </summary> /// <param name="serial">Serialkey of the device as identitfier. Useful when multiple devices are connected.</param> /// <param name="waitForAttachment">If true, waits for attachment</param> public RadioFrequency(int serial, bool waitForAttachment = false) { // A cache for all the detected keys. Cache = new List <string>(); // Booting up the base API. BaseRFID = new P.RFID(); BaseRFID.open(serial); if (waitForAttachment) { BaseRFID.waitForAttachment(); InitRadioFrequency(); } else { BaseRFID.Attach += (sender, args) => InitRadioFrequency(); } }
private Phidgets.RFID rfid; //Declare an RFID object public UcRFID() { InitializeComponent(); this.rfid = new Phidgets.RFID(); this.rfid.Attach += Rfid_Attach; this.rfid.Detach += Rfid_Detach; this.rfid.Tag += Rfid_Tag; this.rfid.TagLost += Rfid_TagLost; this.rfid.open(); this.textBoxName.Text = ""; this.textBoxVersion.Text = ""; this.textBoxTag.Text = ""; this.checkBoxAttached.Checked = false; this.Disposed += UcRFID_Disposed; }
void rfid_Attach(object sender, AttachEventArgs e) { Phidgets.RFID phid = (Phidgets.RFID)sender; //lblAttached.Text = "Attached: " + phid.Name; }