private void OnDeviceConnectionLost(object sender, DeviceErrorEventArgs e) { if (_device.Equals(e.Device)) { Debug.WriteLine("Device connection lost!"); _characteristics.Clear(); ConnectionLost.Invoke(this, null); } }
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"); }
void activeScanner_ErrorEvent(object sender, DeviceErrorEventArgs e) { try { // re-enable the data event for subsequent scans activeScanner.DataEventEnabled = true; } catch (PosControlException) { } }
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); }
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; } }
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}"); } }
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"); } }
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(); }); }
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); }
void _msr_ErrorEvent(object sender, DeviceErrorEventArgs e) { if (_msr.ErrorReportingType == MsrErrorReporting.Track) DisplayMessage(GetMsrData(e.ErrorCodeExtended)); }
private static void Discovery_DeviceError(object sender, DeviceErrorEventArgs e) { Log.Error($"Device Error: {e.ErrorMessage}"); }
void _discovery_DeviceError(object sender, DeviceErrorEventArgs e) { BeginInvoke((Action)(() => ShowError(e.ErrorMessage))); }
private void OnDeviceConnectionLost(object sender, DeviceErrorEventArgs e) { //Devices.FirstOrDefault(d => d.Id == e.Device.Id)?.Update(); }
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"); }
private void OnDeviceConnectionLost(object sender, DeviceErrorEventArgs e) { RefreshLayout(false); RefreshToast("Device Connection Lost"); }
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(); }
void pinpad_ErrorEvent(object sender, DeviceErrorEventArgs e) { if (e.ErrorCode == ErrorCode.Extended || e.ErrorCodeExtended == PinPad.ExtendedErrorBadKey) { DisplayMessage("An encryption key is corrupted or missing."); } }
private void posKeyboard_ErrorEvent(object sender, DeviceErrorEventArgs e) { MessageBox.Show("Keyboard error"); }
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"); } }
private void AdapterOnDeviceConnectionLost(object sender, DeviceErrorEventArgs deviceErrorEventArgs) { OnDisconnected("Connection to device was lost"); OnError("Bluetooth device", "Connection to the device was lost"); }
/// <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}"); }
private void OnDeviceConnectionLost(object sender, DeviceErrorEventArgs e) { }
private void scanner_ErrorEvent(object sender, DeviceErrorEventArgs e) { throw new NotImplementedException(); }
private void msr_ErrorEvent(object sender, DeviceErrorEventArgs e) { MessageBox.Show("Error event activated"); }
/// <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); }
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 ); } }