Exemple #1
0
 // This is used to send a command via SSP to the validator
 public bool SendCommand(TextBox log)
 {
     if (!LibraryHandler.SendCommand(ref m_cmd, ref m_info))
     {
         m_Comms.UpdateLog(m_info, true);
         if (log != null)
         {
             log.AppendText("Sending command failed\r\nPort status: " + m_cmd.ResponseStatus.ToString() + "\r\n");
         }
         return(false);
     }
     // update the log after every command
     m_Comms.UpdateLog(m_info);
     return(true);
 }
Exemple #2
0
        // Non-Command functions

        // This is used to send a command via SSP to the validator
        public bool SendCommand(TextBox log)
        {
            // attempt to send the command
            if (m_eSSP.SSPSendCommand(m_cmd, m_info) == false)
            {
                m_eSSP.CloseComPort();
                m_Comms.UpdateLog(m_info, true);
                if (log != null)
                {
                    log.AppendText("Sending command failed\r\nPort status: " + m_cmd.ResponseStatus.ToString() + "\r\n");
                }
                return(false);
            }
            // update the log after every command
            m_Comms.UpdateLog(m_info);
            return(true);
        }
Exemple #3
0
        public bool SendCommand(TextBox log)
        {
            // Backup data and length in case we need to retry
            byte[] backup = new byte[255];
            cmd.CommandData.CopyTo(backup, 0);
            byte length = cmd.CommandDataLength;

            // attempt to send the command
            if (!LibraryHandler.SendCommand(ref cmd, ref info))
            {
                m_Comms.UpdateLog(info, true); // Update on fail
                if (log != null)
                {
                    log.AppendText("Sending command failed\r\nPort status: " + cmd.ResponseStatus.ToString() + "\r\n");
                }
                return(false);
            }

            // update the log after every command
            m_Comms.UpdateLog(info);
            return(true);
        }
Exemple #4
0
        public bool SendCommand(TextBox log = null)
        {
            // Backup data and length in case we need to retry
            byte[] backup = new byte[255];
            cmd.CommandData.CopyTo(backup, 0);
            byte length = cmd.CommandDataLength;

            // attempt to send the command
            if (eSSP.SSPSendCommand(cmd, info) == false)
            {
                eSSP.CloseComPort();
                m_Comms.UpdateLog(info, true);
                if (log != null)
                {
                    log.AppendText("Sending command failed\r\nPort status: " + cmd.ResponseStatus.ToString() + "\r\n");
                }
                return(false);
            }

            // update the log after every command
            m_Comms.UpdateLog(info);
            return(true);
        }