protected static async Task <T> GetInfo <T>(string command, string parameter = "")
        {
            var rawResult = await DevicePortalAPIHelper.GetInfosAsync(command, parameter);

            T result = JsonConvert.DeserializeObject <T>(rawResult);

            return(result);
        }
        protected static async Task <Dictionary <string, string> > GetInfo <T>(Dictionary <string, string> returnedInfo, ObjectToDico <T> converter, string command, string parameter = "")
        {
            var rawResult = await DevicePortalAPIHelper.GetInfosAsync(command, parameter);

            T result = JsonConvert.DeserializeObject <T>(rawResult);

            return(await converter(returnedInfo, result));
        }
예제 #3
0
 /// <summary>
 /// Set the credentials to access API
 /// </summary>
 /// <param name="_login"></param>
 /// <param name="_password"></param>
 public void SetCredentials(string _login, string _password)
 {
     DevicePortalAPIHelper.SetCredentials(_login, _password);
 }
예제 #4
0
 public void SetConnectivity(DeviceConnectedBy connectedBy, String Adress = DevicePortalAPIHelper.EMPTY_IP)
 {
     DevicePortalAPIHelper.SetConnectivity(connectedBy, Adress);
 }