in Hands-on lab/lab-files/starter-project/SmartMeterSimulator/DeviceManager.cs [22:46]
public async static Task<SmartMeterDevice> RegisterDeviceAsync(string enrollmentKey, string idScope, string deviceId)
{
var globalEndpoint = "global.azure-devices-provisioning.net";
SmartMeterDevice device = null;
//TODO: 1. Derive a device key from a combination of the group enrollment key and the device id
//var primaryKey = ...
//TODO: 2. Create symmetric key with the generated primary key
//using (var security = ...
using (var transportHandler = new ProvisioningTransportHandlerMqtt())
{
//TODO: 3. Create a Provisioning Device Client
//var client = ...
//TODO: 4. Register the device using the symmetric key and MQTT
//DeviceRegistrationResult result = ...
//TODO: 5. Populate the device provisioning details
//device = new SmartMeterDevice()...
}
//return the device
return device;
}