// Send device serial number over property update.
        private async Task SendDeviceSerialNumberAsync(CancellationToken cancellationToken)
        {
            const string   propertyName       = "serialNumber";
            TwinCollection reportedProperties = PnpConvention.CreatePropertyPatch(propertyName, SerialNumber);

            await _deviceClient.UpdateReportedPropertiesAsync(reportedProperties, cancellationToken);

            _logger.LogDebug($"Property: Update - {{ \"{propertyName}\": \"{SerialNumber}\" }} is complete.");
        }
예제 #2
0
파일: Program.cs 프로젝트: ericmitt/IotPnp
 private static async Task UpdateProperty(string propertyName, string v)
 {
     TwinCollection reportedProperties = PnpConvention.CreatePropertyPatch(propertyName, v);
     await deviceClient.UpdateReportedPropertiesAsync(reportedProperties);
 }