-
-
Save ztirom/9858a6022b0af134fcd9e51854fa8dac to your computer and use it in GitHub Desktop.
FirstStepsWithAzureIoTHub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async static Task AddDeviceAsync(string deviceId) { | |
regManager = RegistryManager.CreateFromConnectionString(IOTHUBSTRING); | |
try | |
{ | |
device = await regManager.AddDeviceAsync(new Device(deviceId)); | |
} | |
catch (DeviceAlreadyExistsException) | |
{ | |
device = await regManager.GetDeviceAsync(deviceId); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment