コード例 #1
0
ファイル: Transaction.cs プロジェクト: icunning/fcvtc
 /// <summary>
 /// Construct an LLRP transaction object for the purpose of performing a transaction
 /// via LLRP.
 /// </summary>
 /// <param name="ci">The communications interface to use for the transaction</param>
 /// <param name="send_msg_id">the message ID of the sent message (also of the response)</param>
 /// <param name="response_type">the expected response type</param>
 public Transaction(CommunicationInterface ci, UInt32 send_msg_id, ENUM_LLRP_MSG_TYPE response_type)
 {
     msg_id            = send_msg_id;
     commIF            = ci;
     msg_response_type = response_type;
     rsp_event         = new ManualResetEvent(false);
     err_event         = new ManualResetEvent(false);
 }
コード例 #2
0
 public Transaction(
     CommunicationInterface ci,
     uint send_msg_id,
     ENUM_LLRP_MSG_TYPE response_type)
 {
     this.msg_id            = send_msg_id;
     this.commIF            = ci;
     this.msg_response_type = response_type;
     this.rsp_event         = new ManualResetEvent(false);
     this.err_event         = new ManualResetEvent(false);
 }
コード例 #3
0
    public static void ParseXMLToLLRPMessage(string xmlstr, out object msg, out ENUM_LLRP_MSG_TYPE type)
    {
        XmlDocument xdoc = new XmlDocument();

        xdoc.LoadXml(xmlstr);
        XmlNode node = (XmlNode)xdoc.DocumentElement;

        switch (node.Name)
        {
        case "CUSTOM_MESSAGE":
            msg  = (object)MSG_CUSTOM_MESSAGE.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.CUSTOM_MESSAGE;
            return;

        case "GET_READER_CAPABILITIES":
            msg  = (object)MSG_GET_READER_CAPABILITIES.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.GET_READER_CAPABILITIES;
            return;

        case "GET_READER_CAPABILITIES_RESPONSE":
            msg  = (object)MSG_GET_READER_CAPABILITIES_RESPONSE.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.GET_READER_CAPABILITIES_RESPONSE;
            return;

        case "ADD_ROSPEC":
            msg  = (object)MSG_ADD_ROSPEC.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.ADD_ROSPEC;
            return;

        case "ADD_ROSPEC_RESPONSE":
            msg  = (object)MSG_ADD_ROSPEC_RESPONSE.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.ADD_ROSPEC_RESPONSE;
            return;

        case "DELETE_ROSPEC":
            msg  = (object)MSG_DELETE_ROSPEC.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.DELETE_ROSPEC;
            return;

        case "DELETE_ROSPEC_RESPONSE":
            msg  = (object)MSG_DELETE_ROSPEC_RESPONSE.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.DELETE_ROSPEC_RESPONSE;
            return;

        case "START_ROSPEC":
            msg  = (object)MSG_START_ROSPEC.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.START_ROSPEC;
            return;

        case "START_ROSPEC_RESPONSE":
            msg  = (object)MSG_START_ROSPEC_RESPONSE.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.START_ROSPEC_RESPONSE;
            return;

        case "STOP_ROSPEC":
            msg  = (object)MSG_STOP_ROSPEC.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.STOP_ROSPEC;
            return;

        case "STOP_ROSPEC_RESPONSE":
            msg  = (object)MSG_STOP_ROSPEC_RESPONSE.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.STOP_ROSPEC_RESPONSE;
            return;

        case "ENABLE_ROSPEC":
            msg  = (object)MSG_ENABLE_ROSPEC.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.ENABLE_ROSPEC;
            return;

        case "ENABLE_ROSPEC_RESPONSE":
            msg  = (object)MSG_ENABLE_ROSPEC_RESPONSE.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.ENABLE_ROSPEC_RESPONSE;
            return;

        case "DISABLE_ROSPEC":
            msg  = (object)MSG_DISABLE_ROSPEC.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.DISABLE_ROSPEC;
            return;

        case "DISABLE_ROSPEC_RESPONSE":
            msg  = (object)MSG_DISABLE_ROSPEC_RESPONSE.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.DISABLE_ROSPEC_RESPONSE;
            return;

        case "GET_ROSPECS":
            msg  = (object)MSG_GET_ROSPECS.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.GET_ROSPECS;
            return;

        case "GET_ROSPECS_RESPONSE":
            msg  = (object)MSG_GET_ROSPECS_RESPONSE.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.GET_ROSPECS_RESPONSE;
            return;

        case "ADD_ACCESSSPEC":
            msg  = (object)MSG_ADD_ACCESSSPEC.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.ADD_ACCESSSPEC;
            return;

        case "ADD_ACCESSSPEC_RESPONSE":
            msg  = (object)MSG_ADD_ACCESSSPEC_RESPONSE.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.ADD_ACCESSSPEC_RESPONSE;
            return;

        case "DELETE_ACCESSSPEC":
            msg  = (object)MSG_DELETE_ACCESSSPEC.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.DELETE_ACCESSSPEC;
            return;

        case "DELETE_ACCESSSPEC_RESPONSE":
            msg  = (object)MSG_DELETE_ACCESSSPEC_RESPONSE.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.DELETE_ACCESSSPEC_RESPONSE;
            return;

        case "ENABLE_ACCESSSPEC":
            msg  = (object)MSG_ENABLE_ACCESSSPEC.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.ENABLE_ACCESSSPEC;
            return;

        case "ENABLE_ACCESSSPEC_RESPONSE":
            msg  = (object)MSG_ENABLE_ACCESSSPEC_RESPONSE.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.ENABLE_ACCESSSPEC_RESPONSE;
            return;

        case "DISABLE_ACCESSSPEC":
            msg  = (object)MSG_DISABLE_ACCESSSPEC.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.DISABLE_ACCESSSPEC;
            return;

        case "DISABLE_ACCESSSPEC_RESPONSE":
            msg  = (object)MSG_DISABLE_ACCESSSPEC_RESPONSE.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.DISABLE_ACCESSSPEC_RESPONSE;
            return;

        case "GET_ACCESSSPECS":
            msg  = (object)MSG_GET_ACCESSSPECS.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.GET_ACCESSSPECS;
            return;

        case "GET_ACCESSSPECS_RESPONSE":
            msg  = (object)MSG_GET_ACCESSSPECS_RESPONSE.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.GET_ACCESSSPECS_RESPONSE;
            return;

        case "GET_READER_CONFIG":
            msg  = (object)MSG_GET_READER_CONFIG.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.GET_READER_CONFIG;
            return;

        case "GET_READER_CONFIG_RESPONSE":
            msg  = (object)MSG_GET_READER_CONFIG_RESPONSE.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.GET_READER_CONFIG_RESPONSE;
            return;

        case "SET_READER_CONFIG":
            msg  = (object)MSG_SET_READER_CONFIG.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.SET_READER_CONFIG;
            return;

        case "SET_READER_CONFIG_RESPONSE":
            msg  = (object)MSG_SET_READER_CONFIG_RESPONSE.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.SET_READER_CONFIG_RESPONSE;
            return;

        case "CLOSE_CONNECTION":
            msg  = (object)MSG_CLOSE_CONNECTION.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.CLOSE_CONNECTION;
            return;

        case "CLOSE_CONNECTION_RESPONSE":
            msg  = (object)MSG_CLOSE_CONNECTION_RESPONSE.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.CLOSE_CONNECTION_RESPONSE;
            return;

        case "GET_REPORT":
            msg  = (object)MSG_GET_REPORT.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.GET_REPORT;
            return;

        case "RO_ACCESS_REPORT":
            msg  = (object)MSG_RO_ACCESS_REPORT.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.RO_ACCESS_REPORT;
            return;

        case "KEEPALIVE":
            msg  = (object)MSG_KEEPALIVE.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.KEEPALIVE;
            return;

        case "KEEPALIVE_ACK":
            msg  = (object)MSG_KEEPALIVE_ACK.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.KEEPALIVE_ACK;
            return;

        case "READER_EVENT_NOTIFICATION":
            msg  = (object)MSG_READER_EVENT_NOTIFICATION.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.READER_EVENT_NOTIFICATION;
            return;

        case "ENABLE_EVENTS_AND_REPORTS":
            msg  = (object)MSG_ENABLE_EVENTS_AND_REPORTS.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.ENABLE_EVENTS_AND_REPORTS;
            return;

        case "ERROR_MESSAGE":
            msg  = (object)MSG_ERROR_MESSAGE.FromString(xmlstr);
            type = ENUM_LLRP_MSG_TYPE.ERROR_MESSAGE;
            return;

        default:
            msg  = null;
            type = 0;
            return;
        }
    }
コード例 #4
0
 public LLRPMessageTypePair(object msg, ENUM_LLRP_MSG_TYPE type)
 {
     this.msg = msg;
     this.type = type;
 }
コード例 #5
0
 public LLRPMessageTypePair(object msg, ENUM_LLRP_MSG_TYPE type)
 {
     this.msg  = msg;
     this.type = type;
 }
コード例 #6
0
ファイル: LLRPXmlParser.cs プロジェクト: mksmbrtsh/llrp
        public static void ParseXMLToLLRPMessage(
            string xmlstr,
            out Message msg,
            out ENUM_LLRP_MSG_TYPE type)
        {
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.LoadXml(xmlstr);
            XmlNode documentElement = (XmlNode)xmlDocument.DocumentElement;

            switch (documentElement.Name)
            {
            case "CUSTOM_MESSAGE":
                msg  = (Message)MSG_CUSTOM_MESSAGE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.CUSTOM_MESSAGE;
                break;

            case "GET_READER_CAPABILITIES":
                msg  = (Message)MSG_GET_READER_CAPABILITIES.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.GET_READER_CAPABILITIES;
                break;

            case "GET_READER_CAPABILITIES_RESPONSE":
                msg  = (Message)MSG_GET_READER_CAPABILITIES_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.GET_READER_CAPABILITIES_RESPONSE;
                break;

            case "ADD_ROSPEC":
                msg  = (Message)MSG_ADD_ROSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ADD_ROSPEC;
                break;

            case "ADD_ROSPEC_RESPONSE":
                msg  = (Message)MSG_ADD_ROSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ADD_ROSPEC_RESPONSE;
                break;

            case "DELETE_ROSPEC":
                msg  = (Message)MSG_DELETE_ROSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.DELETE_ROSPEC;
                break;

            case "DELETE_ROSPEC_RESPONSE":
                msg  = (Message)MSG_DELETE_ROSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.DELETE_ROSPEC_RESPONSE;
                break;

            case "START_ROSPEC":
                msg  = (Message)MSG_START_ROSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.START_ROSPEC;
                break;

            case "START_ROSPEC_RESPONSE":
                msg  = (Message)MSG_START_ROSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.START_ROSPEC_RESPONSE;
                break;

            case "STOP_ROSPEC":
                msg  = (Message)MSG_STOP_ROSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.STOP_ROSPEC;
                break;

            case "STOP_ROSPEC_RESPONSE":
                msg  = (Message)MSG_STOP_ROSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.STOP_ROSPEC_RESPONSE;
                break;

            case "ENABLE_ROSPEC":
                msg  = (Message)MSG_ENABLE_ROSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ENABLE_ROSPEC;
                break;

            case "ENABLE_ROSPEC_RESPONSE":
                msg  = (Message)MSG_ENABLE_ROSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ENABLE_ROSPEC_RESPONSE;
                break;

            case "DISABLE_ROSPEC":
                msg  = (Message)MSG_DISABLE_ROSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.DISABLE_ROSPEC;
                break;

            case "DISABLE_ROSPEC_RESPONSE":
                msg  = (Message)MSG_DISABLE_ROSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.DISABLE_ROSPEC_RESPONSE;
                break;

            case "GET_ROSPECS":
                msg  = (Message)MSG_GET_ROSPECS.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.GET_ROSPECS;
                break;

            case "GET_ROSPECS_RESPONSE":
                msg  = (Message)MSG_GET_ROSPECS_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.GET_ROSPECS_RESPONSE;
                break;

            case "ADD_ACCESSSPEC":
                msg  = (Message)MSG_ADD_ACCESSSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ADD_ACCESSSPEC;
                break;

            case "ADD_ACCESSSPEC_RESPONSE":
                msg  = (Message)MSG_ADD_ACCESSSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ADD_ACCESSSPEC_RESPONSE;
                break;

            case "DELETE_ACCESSSPEC":
                msg  = (Message)MSG_DELETE_ACCESSSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.DELETE_ACCESSSPEC;
                break;

            case "DELETE_ACCESSSPEC_RESPONSE":
                msg  = (Message)MSG_DELETE_ACCESSSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.DELETE_ACCESSSPEC_RESPONSE;
                break;

            case "ENABLE_ACCESSSPEC":
                msg  = (Message)MSG_ENABLE_ACCESSSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ENABLE_ACCESSSPEC;
                break;

            case "ENABLE_ACCESSSPEC_RESPONSE":
                msg  = (Message)MSG_ENABLE_ACCESSSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ENABLE_ACCESSSPEC_RESPONSE;
                break;

            case "DISABLE_ACCESSSPEC":
                msg  = (Message)MSG_DISABLE_ACCESSSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.DISABLE_ACCESSSPEC;
                break;

            case "DISABLE_ACCESSSPEC_RESPONSE":
                msg  = (Message)MSG_DISABLE_ACCESSSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.DISABLE_ACCESSSPEC_RESPONSE;
                break;

            case "GET_ACCESSSPECS":
                msg  = (Message)MSG_GET_ACCESSSPECS.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.GET_ACCESSSPECS;
                break;

            case "GET_ACCESSSPECS_RESPONSE":
                msg  = (Message)MSG_GET_ACCESSSPECS_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.GET_ACCESSSPECS_RESPONSE;
                break;

            case "GET_READER_CONFIG":
                msg  = (Message)MSG_GET_READER_CONFIG.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.GET_READER_CONFIG;
                break;

            case "GET_READER_CONFIG_RESPONSE":
                msg  = (Message)MSG_GET_READER_CONFIG_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.GET_READER_CONFIG_RESPONSE;
                break;

            case "SET_READER_CONFIG":
                msg  = (Message)MSG_SET_READER_CONFIG.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.SET_READER_CONFIG;
                break;

            case "SET_READER_CONFIG_RESPONSE":
                msg  = (Message)MSG_SET_READER_CONFIG_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.SET_READER_CONFIG_RESPONSE;
                break;

            case "CLOSE_CONNECTION":
                msg  = (Message)MSG_CLOSE_CONNECTION.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.CLOSE_CONNECTION;
                break;

            case "CLOSE_CONNECTION_RESPONSE":
                msg  = (Message)MSG_CLOSE_CONNECTION_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.CLOSE_CONNECTION_RESPONSE;
                break;

            case "GET_REPORT":
                msg  = (Message)MSG_GET_REPORT.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.GET_REPORT;
                break;

            case "RO_ACCESS_REPORT":
                msg  = (Message)MSG_RO_ACCESS_REPORT.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.RO_ACCESS_REPORT;
                break;

            case "KEEPALIVE":
                msg  = (Message)MSG_KEEPALIVE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.KEEPALIVE;
                break;

            case "KEEPALIVE_ACK":
                msg  = (Message)MSG_KEEPALIVE_ACK.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.KEEPALIVE_ACK;
                break;

            case "READER_EVENT_NOTIFICATION":
                msg  = (Message)MSG_READER_EVENT_NOTIFICATION.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.READER_EVENT_NOTIFICATION;
                break;

            case "ENABLE_EVENTS_AND_REPORTS":
                msg  = (Message)MSG_ENABLE_EVENTS_AND_REPORTS.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ENABLE_EVENTS_AND_REPORTS;
                break;

            case "ERROR_MESSAGE":
                msg  = (Message)MSG_ERROR_MESSAGE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ERROR_MESSAGE;
                break;

            default:
                type = (ENUM_LLRP_MSG_TYPE)0;
                msg  = (Message)CustomMsgDecodeFactory.DecodeXmlNodeToCustomMessage(documentElement, xmlstr);
                if (msg == null)
                {
                    break;
                }
                type = ENUM_LLRP_MSG_TYPE.CUSTOM_MESSAGE;
                break;
            }
        }
コード例 #7
0
    public static void ParseXMLToLLRPMessage(string xmlstr, out object msg, out ENUM_LLRP_MSG_TYPE type)
    {
        XmlDocument xdoc = new XmlDocument();
        xdoc.LoadXml(xmlstr);
        XmlNode node = (XmlNode)xdoc.DocumentElement;

        switch (node.Name)
        {

            case "CUSTOM_MESSAGE":
                msg = (object)MSG_CUSTOM_MESSAGE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.CUSTOM_MESSAGE;
                return;

            case "GET_READER_CAPABILITIES":
                msg = (object)MSG_GET_READER_CAPABILITIES.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.GET_READER_CAPABILITIES;
                return;

            case "GET_READER_CAPABILITIES_RESPONSE":
                msg = (object)MSG_GET_READER_CAPABILITIES_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.GET_READER_CAPABILITIES_RESPONSE;
                return;

            case "ADD_ROSPEC":
                msg = (object)MSG_ADD_ROSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ADD_ROSPEC;
                return;

            case "ADD_ROSPEC_RESPONSE":
                msg = (object)MSG_ADD_ROSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ADD_ROSPEC_RESPONSE;
                return;

            case "DELETE_ROSPEC":
                msg = (object)MSG_DELETE_ROSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.DELETE_ROSPEC;
                return;

            case "DELETE_ROSPEC_RESPONSE":
                msg = (object)MSG_DELETE_ROSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.DELETE_ROSPEC_RESPONSE;
                return;

            case "START_ROSPEC":
                msg = (object)MSG_START_ROSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.START_ROSPEC;
                return;

            case "START_ROSPEC_RESPONSE":
                msg = (object)MSG_START_ROSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.START_ROSPEC_RESPONSE;
                return;

            case "STOP_ROSPEC":
                msg = (object)MSG_STOP_ROSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.STOP_ROSPEC;
                return;

            case "STOP_ROSPEC_RESPONSE":
                msg = (object)MSG_STOP_ROSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.STOP_ROSPEC_RESPONSE;
                return;

            case "ENABLE_ROSPEC":
                msg = (object)MSG_ENABLE_ROSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ENABLE_ROSPEC;
                return;

            case "ENABLE_ROSPEC_RESPONSE":
                msg = (object)MSG_ENABLE_ROSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ENABLE_ROSPEC_RESPONSE;
                return;

            case "DISABLE_ROSPEC":
                msg = (object)MSG_DISABLE_ROSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.DISABLE_ROSPEC;
                return;

            case "DISABLE_ROSPEC_RESPONSE":
                msg = (object)MSG_DISABLE_ROSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.DISABLE_ROSPEC_RESPONSE;
                return;

            case "GET_ROSPECS":
                msg = (object)MSG_GET_ROSPECS.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.GET_ROSPECS;
                return;

            case "GET_ROSPECS_RESPONSE":
                msg = (object)MSG_GET_ROSPECS_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.GET_ROSPECS_RESPONSE;
                return;

            case "ADD_ACCESSSPEC":
                msg = (object)MSG_ADD_ACCESSSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ADD_ACCESSSPEC;
                return;

            case "ADD_ACCESSSPEC_RESPONSE":
                msg = (object)MSG_ADD_ACCESSSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ADD_ACCESSSPEC_RESPONSE;
                return;

            case "DELETE_ACCESSSPEC":
                msg = (object)MSG_DELETE_ACCESSSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.DELETE_ACCESSSPEC;
                return;

            case "DELETE_ACCESSSPEC_RESPONSE":
                msg = (object)MSG_DELETE_ACCESSSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.DELETE_ACCESSSPEC_RESPONSE;
                return;

            case "ENABLE_ACCESSSPEC":
                msg = (object)MSG_ENABLE_ACCESSSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ENABLE_ACCESSSPEC;
                return;

            case "ENABLE_ACCESSSPEC_RESPONSE":
                msg = (object)MSG_ENABLE_ACCESSSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ENABLE_ACCESSSPEC_RESPONSE;
                return;

            case "DISABLE_ACCESSSPEC":
                msg = (object)MSG_DISABLE_ACCESSSPEC.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.DISABLE_ACCESSSPEC;
                return;

            case "DISABLE_ACCESSSPEC_RESPONSE":
                msg = (object)MSG_DISABLE_ACCESSSPEC_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.DISABLE_ACCESSSPEC_RESPONSE;
                return;

            case "GET_ACCESSSPECS":
                msg = (object)MSG_GET_ACCESSSPECS.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.GET_ACCESSSPECS;
                return;

            case "GET_ACCESSSPECS_RESPONSE":
                msg = (object)MSG_GET_ACCESSSPECS_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.GET_ACCESSSPECS_RESPONSE;
                return;

            case "GET_READER_CONFIG":
                msg = (object)MSG_GET_READER_CONFIG.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.GET_READER_CONFIG;
                return;

            case "GET_READER_CONFIG_RESPONSE":
                msg = (object)MSG_GET_READER_CONFIG_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.GET_READER_CONFIG_RESPONSE;
                return;

            case "SET_READER_CONFIG":
                msg = (object)MSG_SET_READER_CONFIG.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.SET_READER_CONFIG;
                return;

            case "SET_READER_CONFIG_RESPONSE":
                msg = (object)MSG_SET_READER_CONFIG_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.SET_READER_CONFIG_RESPONSE;
                return;

            case "CLOSE_CONNECTION":
                msg = (object)MSG_CLOSE_CONNECTION.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.CLOSE_CONNECTION;
                return;

            case "CLOSE_CONNECTION_RESPONSE":
                msg = (object)MSG_CLOSE_CONNECTION_RESPONSE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.CLOSE_CONNECTION_RESPONSE;
                return;

            case "GET_REPORT":
                msg = (object)MSG_GET_REPORT.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.GET_REPORT;
                return;

            case "RO_ACCESS_REPORT":
                msg = (object)MSG_RO_ACCESS_REPORT.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.RO_ACCESS_REPORT;
                return;

            case "KEEPALIVE":
                msg = (object)MSG_KEEPALIVE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.KEEPALIVE;
                return;

            case "KEEPALIVE_ACK":
                msg = (object)MSG_KEEPALIVE_ACK.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.KEEPALIVE_ACK;
                return;

            case "READER_EVENT_NOTIFICATION":
                msg = (object)MSG_READER_EVENT_NOTIFICATION.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.READER_EVENT_NOTIFICATION;
                return;

            case "ENABLE_EVENTS_AND_REPORTS":
                msg = (object)MSG_ENABLE_EVENTS_AND_REPORTS.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ENABLE_EVENTS_AND_REPORTS;
                return;

            case "ERROR_MESSAGE":
                msg = (object)MSG_ERROR_MESSAGE.FromString(xmlstr);
                type = ENUM_LLRP_MSG_TYPE.ERROR_MESSAGE;
                return;

            default:
                msg = null;
                type = 0;
                return;
        }
    }