Esempio n. 1
0
 void _tcpArmDevice_DeviceEvent(SDK_SC_RfidReader.rfidReaderArgs args)
 {
     switch (args.RN_Value)
     {
     case rfidReaderArgs.ReaderNotify.RN_EnrollmentSample:
         int sample = int.Parse(args.Message);
         backgroundWorkerEnroll.ReportProgress(sample);
         break;
     }
 }
        private void rfidDev_NotifyRFIDEvent(object sender, SDK_SC_RfidReader.rfidReaderArgs args)
        {
            switch (args.RN_Value)
            {
            case SDK_SC_RfidReader.rfidReaderArgs.ReaderNotify.RN_FailedToConnect:
            {
                isRfidConnected = false;
                if (eventEndConnection != null)
                {
                    eventEndConnection.Set();
                }
                break;
            }

            case SDK_SC_RfidReader.rfidReaderArgs.ReaderNotify.RN_Disconnected:
            {
                isRfidConnected = false;
            } break;

            case SDK_SC_RfidReader.rfidReaderArgs.ReaderNotify.RN_Connected:
            {
                isRfidConnected = true;
                FindAndConnectScale(args.SerialNumber, device.get_RFID_Device.StrCom);
                break;
            }

            case rfidReaderArgs.ReaderNotify.RN_ErrorDuringScan:
            case rfidReaderArgs.ReaderNotify.RN_ReaderFailToStartScan:
            {
                ret = retCode.RC_Error_RFID;
                if (eventEndRFID != null)
                {
                    eventEndRFID.Set();
                }
                break;
            }

            case rfidReaderArgs.ReaderNotify.RN_ScanStarted:
            {
                break;
            }

            case rfidReaderArgs.ReaderNotify.RN_ScanCompleted:
            {
                if (eventEndRFID != null)
                {
                    eventEndRFID.Set();
                }
                break;
            }
            }
        }
 private void deviceForDiscover_NotifyEvent(object sender, SDK_SC_RfidReader.rfidReaderArgs args)
 {
     switch (args.RN_Value)
     {
     case rfidReaderArgs.ReaderNotify.RN_Connected:
     case rfidReaderArgs.ReaderNotify.RN_Disconnected:
     case rfidReaderArgs.ReaderNotify.RN_FailedToConnect:
         if (eventEndDiscover != null)
         {
             eventEndDiscover.Set();
         }
         break;
     }
 }