コード例 #1
0
        public StatusUpdateModel GetStatus()
        {
            var request  = CreateRequestFromAction("STATUS");
            var response = ExecuteRequestAndGetResponse(request);

            if (response.Contains("limit"))
            {
                return(StatusUpdateModel.MakeUnAvailableModel());
            }
            try {
                var parser = new StatusParser(response);
                var model  = parser.GetModel();
                return(model);
            } catch (Exception e) {
                return(StatusUpdateModel.MakeUnAvailableModel());
            }
        }
コード例 #2
0
        public StatusUpdateModel Scan(double x, double y)
        {
            var request  = CreateRequestFromAction($"SCAN {x} {y}");
            var response = ExecuteRequestAndGetResponse(request);

            if (response.Contains("ERROR"))
            {
                return(StatusUpdateModel.MakeUnAvailableModel());
            }
            else
            {
                try {
                    var parser = new StatusParser(response);
                    var model  = parser.GetModel();
                    return(model);
                } catch (Exception ex) {
                    return(StatusUpdateModel.MakeUnAvailableModel());
                }
            }
        }