Esempio n. 1
0
 static void Rfid_TagDetected(Object sender, TagDetectedEventArgs e)
 {
     _lcd.BackLight = true;
     Hardware.Led1.Write(GpioPinValue.High);
     Debug.WriteLine("Tag detected : " + e.TagID);
     _lcd.Write(1, 3, e.TagID.ToString());
     _lcd.Write(1, 4, e.TagIDHex + "  #" + e.CRC);
     _timerLcd.Change(new TimeSpan(0, 0, 15), new TimeSpan(0, 0, 0));    // Dim Backlight after 15 seconds
 }
        private void OnRfidTransceiverTagDetected(object?sender, TagDetectedEventArgs e)
        {
            if (this.tag?.RawData.SequenceEqual(e.Tag.RawData) == true)
            {
                this.detectionCount++;
            }
            else
            {
                this.detectionCount = 0;
            }

            this.tag = e.Tag;
            this.invalidater?.Invalidate();
        }
Esempio n. 3
0
 private void XnfcOnTagDetected(object sender, TagDetectedEventArgs e)
 {
     Console.WriteLine("Receipt of " + Encoding.ASCII.GetString(e.Records[0].Payload));
     Device.BeginInvokeOnMainThread(async() =>
     {
         var x = await DisplayAlert("NFC", Encoding.ASCII.GetString(e.Records[0].Payload), "Write", "Ok");
         if (x)
         {
             e.Tag.Write(new NfcDefRecord()
             {
                 Payload        = new byte[] { 0x44, 0x79, 0x6c, 0x61, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x6b, 0x73 },
                 TypeNameFormat = NDefTypeNameFormat.Unknown
             });
         }
     });
 }