IdentityTranslationModule init
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
ModuleClient.fromEnvironment(Transport, function (err, moduleClient) { | |
if (err) { | |
throw err; | |
} else { | |
moduleClient.on('error', function (err) { | |
throw err; | |
}); | |
// connect to the Edge instance | |
moduleClient.open(function (err) { | |
if (err) { | |
throw err; | |
} else { | |
console.log('IoT Hub module client initialized'); | |
const simulatedTemperatureClientConnectionString = process.env.simulatedTemperatureClientConnectionString; | |
if (simulatedTemperatureClientConnectionString) { | |
console.log("Device Connection string", simulatedTemperatureClientConnectionString); | |
simulatedTemperatureClient = DeviceClient.fromConnectionString(simulatedTemperatureClientConnectionString, Transport); | |
} | |
else { | |
console.log("Please configure the device connection string in environment variables"); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment