Ejemplo n.º 1
0
        public void Heartbeat(WebClient agent, StationDetail detail)
        {
            Dictionary <object, object> parameters = new Dictionary <object, object>
            {
                { CloudServer.PARAM_SESSION_TOKEN, this.Token },
                { CloudServer.PARAM_STATION_ID, this.Id },
                { CloudServer.PARAM_API_KEY, CloudServer.APIKey },
                { CloudServer.PARAM_DETAIL, detail.ToFastJSON() }
            };

            StationHeartbeatResponse res =
                CloudServer.requestPath <StationHeartbeatResponse>(agent, "stations/heartbeat", parameters);
        }
Ejemplo n.º 2
0
        public StationLogOnResponse LogOn(WebClient agent, StationDetail detail)
        {
            Dictionary <object, object> parameters = new Dictionary <object, object>
            {
                { CloudServer.PARAM_SESSION_TOKEN, this.Token },
                { CloudServer.PARAM_STATION_ID, this.Id },
                { CloudServer.PARAM_API_KEY, CloudServer.APIKey },
                { CloudServer.PARAM_DETAIL, detail.ToFastJSON() }
            };

            StationLogOnResponse res =
                CloudServer.requestPath <StationLogOnResponse>(agent, "stations/logOn", parameters);

            this.Token = res.session_token;
            return(res);
        }
Ejemplo n.º 3
0
        public static StationLogOnResponse LogOn(WebClient agent, string stationId, string email, string passwd, StationDetail detail)
        {
            Dictionary <object, object> param = new Dictionary <object, object>
            {
                { CloudServer.PARAM_EMAIL, email },
                { CloudServer.PARAM_PASSWORD, passwd },
                { CloudServer.PARAM_STATION_ID, stationId },
                { CloudServer.PARAM_API_KEY, CloudServer.APIKey },
                { CloudServer.PARAM_DETAIL, detail.ToFastJSON() }
            };

            StationLogOnResponse res = CloudServer.requestPath <StationLogOnResponse>(agent, "stations/logOn", param);

            return(res);
        }