コード例 #1
0
        // For some reason, calls to this function takes 1 minute.
        public async Task UpdateReportedPropertiesAsync(string name, object value, LogDelegateType Log)
        {
            Log("Updating '" + name + "'...");

            TwinCollection azureCollection = new TwinCollection();

            azureCollection[name] = value;

            try
            {
                await _deviceClient.UpdateReportedPropertiesAsync(azureCollection);
            }
            catch (Exception e)
            {
                Log("Error: failed to update reported properties. " + e.Message);
            }
        }
コード例 #2
0
        public async Task UpdateReportedPropertiesAsync(JObject reportedObject, LogDelegateType Log)
        {
            Log("Updating reported properties...");

            TwinCollection azureCollection = new TwinCollection();

            foreach (JProperty p in reportedObject.Children())
            {
                azureCollection[p.Name] = p.Value;
            }

            try
            {
                await _deviceClient.UpdateReportedPropertiesAsync(azureCollection);
            }
            catch (Exception e)
            {
                Log("Error: failed to update reported properties. " + e.Message);
            }
        }
コード例 #3
0
 public IrcLogger(LogDelegateType logDelegate)
 {
     this.logDelegate = logDelegate;
 }