public static void SetConnectivity(HoloLensConnectedBy connectivity, String adress = EMPTY_IP)
 {
     DiagInfos.WriteDebug("Changing Connectivity", connectivity.ToString() + " " + adress);
     connectedBy = connectivity;
     Adress      = adress;
     DiagInfos.WriteDebug("Connectivity changed", connectedBy.ToString() + " " + Adress);
 }
 public async Task <String> GetInfosASync(string command, string parameter = "")
 {
     try
     {
         StartCoroutine(GetInfos(command, parameter));
         while (result == String.Empty)
         {
             await Task.Delay(1000);
         }
     }
     catch (Exception e)
     {
         DiagInfos.WriteDebug("exception", e.StackTrace);
     }
     return(result);
 }
        public static IEnumerator GetInfos(string command, string parameter = "")
        {
            DiagInfos.WriteDebug("UnityWebRequest", "accessing");
            WaitForSeconds waitTime = new WaitForSeconds(2f); //Do the memory allocation once

            string authorization = authenticate(API_LOGIN, API_PASSWORD);

            StringBuilder sb = new StringBuilder(HTTP).Append(Adress).Append(API_COMMAND_PREFIX).Append(command).Append((String.IsNullOrWhiteSpace(parameter) ? String.Empty : API_PARAMETER_PREFIX + parameter));

            DiagInfos.WriteDebug("UnityWebRequest - Url", sb.ToString());

            UnityWebRequest request = UnityWebRequest.Get(sb.ToString());

            request.SetRequestHeader("AUTHORIZATION", authorization);
            UnityWebRequestAsyncOperation asyncOperation = request.SendWebRequest();

            result = request.downloadHandler.text;
            DiagInfos.WriteDebug("Result", result);
            yield return(result);
        }