Esempio n. 1
0
        /// <summary>
        /// Send a handshake message to prove the connection is working.
        /// </summary>
        /// <returns>Returns true if the handshake was accepted.</returns>
        private bool handshake()
        {
            bool fHandshakeResult = false;

            // send heartbeat to reader
            Command      rpCommand = new Command("heartBeat");
            string       replyMsg  = execute(rpCommand.getXmlCommand(), rpCommand.CommandID);
            CommandReply rpReply   = CommandReply.DecodeXmlCommand(replyMsg);

            if (rpReply != null && rpReply.ResultCode == 0)
            {
                fHandshakeResult = true;
            }
            return(fHandshakeResult);
        }
        public static CommandReply DecodeXmlCommand(string replyMessage, string commandID)
        {
            CommandReply result = null;

            try{
                XmlBinding.XmlParser xmlParser = new XmlBinding.XmlParser();

                result = xmlParser.ParseReply(replyMessage);
            }
            catch (Exception ex)
            {
                RfReaderApi.CurrentApi.ProvideInformation("CmdReply", ex);
            }

            return(result);
        }
 public static CommandReply DecodeXmlCommand(string replyMessage, Command cmd)
 {
     return(CommandReply.DecodeXmlCommand(replyMessage, cmd.CommandID));
 }
 public static CommandReply DecodeXmlCommand(string replyMessage)
 {
     return(CommandReply.DecodeXmlCommand(replyMessage, ""));
 }