Ejemplo n.º 1
0
        private bool CheckForErrorsOrTimeout(ResponseFrame frame, Exception e)
        {
            if (e != null)
            {
                if (e.GetType() == typeof(HardwareException))
                {
                    ShowFailStatus("Tappy is not connected");
                }
                else
                {
                    ShowFailStatus("An error occured");
                }

                return(true);
            }
            else if (!TcmpFrame.IsValidFrame(frame))
            {
                ShowFailStatus("An error occured");

                return(true);
            }
            else if (frame.IsApplicationErrorFrame())
            {
                ApplicationErrorFrame errorFrame = (ApplicationErrorFrame)frame;
                ShowFailStatus(errorFrame.ErrorString);
                return(true);
            }
            else if (frame.CommandFamily0 == 0 && frame.CommandFamily1 == 0 && frame.ResponseCode < 0x05)
            {
                ShowFailStatus(TappyError.LookUp(frame.CommandFamily, frame.ResponseCode));
                return(true);
            }
            else if (frame.ResponseCode == 0x03)
            {
                ShowFailStatus("No tag detected");
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        private void ConfigSuccess(ResponseFrame frame, Exception e)
        {
            if (e != null)
            {
                return;
            }
            else if (!TcmpFrame.IsValidFrame(frame))
            {
                ShowFailStatus("Error occured");
                return;
            }
            else if (frame.IsApplicationErrorFrame())
            {
                ShowFailStatus(((ApplicationErrorFrame)frame).ErrorString);
                return;
            }

            Tag tag = new Tag(frame.Data);

            string uid = BitConverter.ToString(tag.UID).Replace("-", "");

            Process.Start(string.Format($"https://members.taptrack.com/x.php?tag_code={uid}"));
        }