Exemple #1
0
        protected override void DoGet(CoapExchange exchange)
        {
            st.Start();
            string path = exchange.Request.UriQuery;

            string[] tokens         = path.Split('/');
            string   deviceName     = tokens[0];
            string   requstdatasize = tokens[1];

            // Devices di = new Devices(eviceName,requstdatasize,"GET",null);
            _content = GenerateResponseData(Int32.Parse(requstdatasize));
            if (_content != null)
            {
                exchange.Respond(_content);
            }
            else
            {
                String subtree = LinkFormat.Serialize(this, null);
                exchange.Respond(StatusCode.Content, subtree, MediaType.ApplicationLinkFormat);
            }
            st.Stop();
            int responseSize = exchange.getResponseSize();

            st.WriteLogServer("GET", deviceName, requstdatasize);
        }