Skip to content

Instantly share code, notes, and snippets.

@chrismckelt
Created March 10, 2020 02:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrismckelt/9b1a3923f31a657fa3a6ff9f1a9e417a to your computer and use it in GitHub Desktop.
Save chrismckelt/9b1a3923f31a657fa3a6ff9f1a9e417a to your computer and use it in GitHub Desktop.
Azure IoT Edge Demo DataRecorder.cs
ModuleClient ioTHubModuleClient;
var connectionSettings = new MqttTransportSettings(TransportType.Mqtt_Tcp_Only);
ITransportSettings[] settings = { connectionSettings };
ioTHubModuleClient = await ModuleClient.CreateFromEnvironmentAsync();
await ioTHubModuleClient.OpenAsync(); // Open a connection to the Edge runtime
// Register callback to be called when a message is received by the module
await ioTHubModuleClient.SetInputMessageHandlerAsync("input1", PipeMessage, ioTHubModuleClient);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment