Пример #1
0
 private void OnDeviceConnectionLost(object sender, DeviceErrorEventArgs e)
 {
     if (_device.Equals(e.Device))
     {
         Debug.WriteLine("Device connection lost!");
         _characteristics.Clear();
         ConnectionLost.Invoke(this, null);
     }
 }
Пример #2
0
        private void OnDeviceConnectionLost(object sender, DeviceErrorEventArgs args)
        {
            System.Diagnostics.Debug.WriteLine("Connection lost with " + args.Device.Name);

            // Resert device connected
            _findMeConnected = null;

            // Send message
            MessagingCenter.Send <BLEService>(this, "deviceConnectionLost");
        }
Пример #3
0
 void activeScanner_ErrorEvent(object sender, DeviceErrorEventArgs e)
 {
     try
     {
         // re-enable the data event for subsequent scans
         activeScanner.DataEventEnabled = true;
     }
     catch (PosControlException)
     { }
 }
Пример #4
0
        private void RispondiAErrorEvent(object o, DeviceErrorEventArgs e)
        {
            //ErrorEvent su gestione asincrona.
            string risposta;
            string rispostaEX;

            risposta   = e.ErrorCode.ToString();
            rispostaEX = e.ErrorCodeExtended.ToString();
            updateForm("ErrorEvent: " + risposta + " " + rispostaEX);
        }
Пример #5
0
        private void _cco_ErrorEvent(int ResultCode, int ResultCodeExtended, int ErrorLocus, ref int pErrorResponse)
        {
            if (this.ErrorEvent != null)
            {
                ErrorCode eCode = (ErrorCode)InteropEnum <ErrorCode> .ToEnumFromInteger(ResultCode);

                ErrorLocus eLocus = (ErrorLocus)InteropEnum <ErrorLocus> .ToEnumFromInteger(ErrorLocus);

                ErrorResponse eResponse = (ErrorResponse)InteropEnum <ErrorResponse> .ToEnumFromInteger(pErrorResponse);

                DeviceErrorEventArgs eEE = new DeviceErrorEventArgs(eCode, ResultCodeExtended, eLocus, eResponse);
                ErrorEvent(this, eEE);
                pErrorResponse = (int)eEE.ErrorResponse;
            }
        }
Пример #6
0
        private async void OnDeviceConnectionLost(object sender, DeviceErrorEventArgs e)
        {
            _band = null;

            ((AnimationDrawable)_heartRateIcon.Icon).Stop();

            Log.Debug("MAIN", $"##### Device {e.Device.Name} disconnected :(");
            Log.Debug("MAIN", "##### Trying to reconnect...");

            try {
                await CheckConnection();
            }
            catch (Exception ex) {
                Log.Error("MAIN", $"Error connecting to device: {ex.Message}");
            }
        }
Пример #7
0
        void activeScanner_ErrorEvent(object sender, DeviceErrorEventArgs e)
        {
            UpdateEventHistory("Error Event");

            try

            {
                // re-enable the data event for subsequent scans

                activeScanner.DataEventEnabled = true;
            }

            catch (PosControlException)
            {
                // Log any errors
                UpdateEventHistory("ErrorEvent Operation Failed");
            }
        }
Пример #8
0
        private void LostDeviceEvent(object sender, DeviceErrorEventArgs e)
        {
            if (!StartStop.Equals(INICIAR))
            {
                StartStop = REANUDAR;
            }
            else
            {
                StartStop = INICIAR;
            }

            ColorFrame = "#e6475f";
            Debug.WriteLine("Dispositivo desconectado: " + e.Device.Name + " ID: " + e.Device.Id);

            Device.BeginInvokeOnMainThread(async() =>
            {
                await Application.Current.MainPage.DisplayAlert("Atención", "Se ha perdido la conexión con el dispositivo " + e.Device.Name + ". Reintente de nuevo la conexión", "Aceptar");
                await DisconnectAll();
            });
        }
Пример #9
0
        public ErrorEventDlg(DeviceErrorEventArgs d, PosCommon co)
        {
            if (d == null)
            {
                throw new ArgumentNullException("d");
            }

            if (co == null)
            {
                throw new ArgumentNullException("co");
            }

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            deviceErrorArgs = d;

            ErrorText.Text = "An ErrorEvent occurred with the following parameters:\r\n" +
                             "\tError Code: " + d.ErrorCode.ToString() + "\r\n" +
                             "\tExtended Error Code: " + d.ErrorCodeExtended.ToString(System.Globalization.CultureInfo.CurrentCulture) + "\r\n" +
                             "\tError Locus: " + d.ErrorLocus.ToString() + "\r\n" +
                             "\tError Response: " + d.ErrorResponse.ToString();

            if (co is PosPrinter)
            {
                string s;
                s  = "\r\n\r\nErrorLevel: " + ((PosPrinter)co).ErrorLevel.ToString() + "\r\n";
                s += "ErrorStation: " + ((PosPrinter)co).ErrorStation.ToString() + "\r\n";
                s += "ErrorString: " + ((PosPrinter)co).ErrorString.ToString();

                ErrorText.Text += s;
            }

            RetryradioButton.Checked         = (d.ErrorResponse == ErrorResponse.Retry);
            ClearradioButton.Checked         = (d.ErrorResponse == ErrorResponse.Clear);
            ContinueInputradioButton.Checked = (d.ErrorResponse == ErrorResponse.ContinueInput);
        }
Пример #10
0
 void _msr_ErrorEvent(object sender, DeviceErrorEventArgs e)
 {
     if (_msr.ErrorReportingType == MsrErrorReporting.Track)
         DisplayMessage(GetMsrData(e.ErrorCodeExtended));
 }
Пример #11
0
 private static void Discovery_DeviceError(object sender, DeviceErrorEventArgs e)
 {
     Log.Error($"Device Error: {e.ErrorMessage}");
 }
Пример #12
0
 void _discovery_DeviceError(object sender, DeviceErrorEventArgs e)
 {
     BeginInvoke((Action)(() => ShowError(e.ErrorMessage)));
 }
Пример #13
0
 private void OnDeviceConnectionLost(object sender, DeviceErrorEventArgs e)
 {
     //Devices.FirstOrDefault(d => d.Id == e.Device.Id)?.Update();
 }
Пример #14
0
        private void OnDeviceConnectionLost(object sender, DeviceErrorEventArgs e)
        {
            bleprofile.Devices.FirstOrDefault(d => d.Id == e.Device.Id)?.Update();

            //DisplayAlert("connection lost", "Try again ur disconnected", "Ok");
        }
Пример #15
0
 private void OnDeviceConnectionLost(object sender, DeviceErrorEventArgs e)
 {
     RefreshLayout(false);
     RefreshToast("Device Connection Lost");
 }
Пример #16
0
        protected void OnErrorEvent(object source, DeviceErrorEventArgs e)  //错误事件
        {
            string strMessage = "打印错误原因: \n";

            switch (e.ErrorCodeExtended)
            {
            case PosPrinter.ExtendedErrorBadFormat:
                strMessage += "不支持的打印格式或打印格式中有错,请查看订单详情";
                break;

            case PosPrinter.ExtendedErrorCoverOpen:
                strMessage += "打印机上盖未盖好,请盖好打印机上盖";
                break;

            case PosPrinter.ExtendedErrorFirmwareBadFile:
                strMessage += "打印机固件文件损坏";
                strMessage += " ";
                break;

            case PosPrinter.ExtendedErrorJournalCartridgeEmpty:
            case PosPrinter.ExtendedErrorReceiptCartridgeEmpty:
            case PosPrinter.ExtendedErrorSlipCartridgeEmpty:
                strMessage += "无打印头";
                break;

            case PosPrinter.ExtendedErrorJournalCartridgeRemoved:
            case PosPrinter.ExtendedErrorReceiptCartridgeRemoved:
            case PosPrinter.ExtendedErrorSlipCartridgeRemoved:
                strMessage += "打印头已被拆卸";
                break;

            case PosPrinter.ExtendedErrorJournalHeadCleaning:
            case PosPrinter.ExtendedErrorReceiptHeadCleaning:
            case PosPrinter.ExtendedErrorSlipHeadCleaning:
                strMessage += "打印头正在清洗";
                break;

            case PosPrinter.ExtendedErrorJournalEmpty:
            case PosPrinter.ExtendedErrorReceiptEmpty:
            case PosPrinter.ExtendedErrorSlipEmpty:
                strMessage += "打印纸耗尽,请更换纸卷并点击<重试>,重新打印该订单";
                break;

            case PosPrinter.ExtendedErrorSlipForm:
                strMessage += "a form is present while the printer is being taken out of from removal mode";
                break;

            case PosPrinter.ExtendedErrorStatistics:
                strMessage += "打印机的打印统计数据不能复位或更新";
                break;

            case PosPrinter.ExtendedErrorStatisticsDependency:
                strMessage += "打印机的打印统计数据的依赖发生错误";
                break;

            case PosPrinter.ExtendedErrorTooBig:
                strMessage += "用于打印的位图太大";
                break;


            default:
                strMessage += "请检查线缆连接、打印机纸张及打印机上盖 并重启打印机.\n" +
                              "等待十几秒后,重试.\n";
                break;
            }
            OutputOverHandle();
        }
Пример #17
0
 void pinpad_ErrorEvent(object sender, DeviceErrorEventArgs e)
 {
     if (e.ErrorCode == ErrorCode.Extended || e.ErrorCodeExtended == PinPad.ExtendedErrorBadKey)
     {
         DisplayMessage("An encryption key is corrupted or missing.");
     }
 }
Пример #18
0
 private void posKeyboard_ErrorEvent(object sender, DeviceErrorEventArgs e)
 {
     MessageBox.Show("Keyboard error");
 }
Пример #19
0
 private void activeScanner_ErrorDataEvent(object sender, DeviceErrorEventArgs e)
 {
     MessageBox.Show(e.ErrorCode.ToString());
 }
        private void activeScanner_ErrorEvent(object sender, DeviceErrorEventArgs e)
        {
            UpdateEventHistory("Error Event");
            try
            {
                activeScanner.DataEventEnabled = true;

            }
            catch (PosControlException)
            {
                UpdateEventHistory("ErrorEventArgs Operation Failed");

            }
        }
Пример #21
0
 private void AdapterOnDeviceConnectionLost(object sender, DeviceErrorEventArgs deviceErrorEventArgs)
 {
     OnDisconnected("Connection to device was lost");
     OnError("Bluetooth device", "Connection to the device was lost");
 }
Пример #22
0
 /// <summary>
 /// SDK reports an error from SDK or device layer
 /// </summary>
 private void Clover_DeviceError(object sender, DeviceErrorEventArgs e)
 {
     e.Handled = true;
     Output($"Device Error: {e}");
 }
Пример #23
0
 private void OnDeviceConnectionLost(object sender, DeviceErrorEventArgs e)
 {
 }
Пример #24
0
 private void scanner_ErrorEvent(object sender, DeviceErrorEventArgs e)
 {
     throw new NotImplementedException();
 }
Пример #25
0
 private void msr_ErrorEvent(object sender, DeviceErrorEventArgs e)
 {
     MessageBox.Show("Error event activated");
 }
Пример #26
0
 /// <summary>
 /// Called when the scanner caught an errornous situation.
 /// </summary>
 /// <param name="sender">The sender of the event.</param>
 /// <param name="e">The <see cref="DeviceErrorEventArgs" /> instance containing the event data.</param>
 void OnErrorEvent(object sender, DeviceErrorEventArgs e)
 {
     this.ReleaseScanner();
     this.ClaimScanner(s_objScanner.DeviceName);
 }
Пример #27
0
        private void co_OnErrorEvent(object source, DeviceErrorEventArgs d)
        {
            PosCommon posCommon = source as PosCommon;
            if (posCommon == null)
                return;

            string str = d.ToString();
            
            ErrorEventDlg err = new ErrorEventDlg(d, posCommon);
            err.ShowDialog(this);


            str += "\r\nUser returned ErrorResponse(" + d.ErrorResponse + ")\r\n";

            
            Output.Text = str;
            

            PropertyInfo dataEventEnabled = posCommon.GetType().GetProperty("DataEventEnabled");
            if( dataEventEnabled != null)
            {
                chkDataEventEnabled.Checked = (bool) dataEventEnabled.GetValue( posCommon, null );
            }
        }