Example #1
0
        private void InitializeHubs()
        {
            _weatherDevice = new WeatherDevice();

            _weatherDevice.AddTelemetry(new TelemetryFormat {
                Name = "temperature", DisplayName = "Temp", Type = "Double"
            },
                                        (double)0);
            _weatherDevice.AddTelemetry(new TelemetryFormat {
                Name = "pressure", DisplayName = "hPa", Type = "Double"
            },
                                        (double)0);

            _weatherDevice.AddTelemetry(new TelemetryFormat {
                Name = "humidity", DisplayName = "g", Type = "Double"
            },
                                        (double)0);



            _weatherDevice.DeviceId  = "[DeviceId]";
            _weatherDevice.DeviceKey = "[DeviceKey]";
            _weatherDevice.HostName  = "[HostName]";

            _weatherDevice.SendTelemetryFreq = 60000;
            _weatherDevice.Connect();


            _weatherDevice.onReceivedMessage += WeatherDevice_onReceivedMessage;
        }
Example #2
0
        private void InitializeHubs()
        {
            _weatherDevice = new WeatherDevice();

            _weatherDevice.AddTelemetry(new TelemetryFormat {
                Name = "temperature", DisplayName = "Temp", Type = "Double"
            },
                                        (double)0);
            _weatherDevice.AddTelemetry(new TelemetryFormat {
                Name = "pressure", DisplayName = "hPa", Type = "Double"
            },
                                        (double)0);

            _weatherDevice.AddTelemetry(new TelemetryFormat {
                Name = "humidity", DisplayName = "g", Type = "Double"
            },
                                        (double)0);



            _weatherDevice.DeviceId  = "IgniteJhbThings";
            _weatherDevice.DeviceKey = "uJLwieHWZubfji7/TXoybKXbrSxdyFQgdYNl0YwZJA8=";
            _weatherDevice.HostName  = "AzureIotEdgeJhbMsDugHub.azure-devices.net";

            _weatherDevice.SendTelemetryFreq = 60000;
            _weatherDevice.Connect();


            _weatherDevice.onReceivedMessage += WeatherDevice_onReceivedMessage;
        }
        private void InitializeHubs()
        {
            _weatherDevice = new WeatherDevice();

            _weatherDevice.DeviceId  = "[DeviceId]";
            _weatherDevice.DeviceKey = "[DeviceKey]";
            _weatherDevice.HostName  = "[HostName]";

            _weatherDevice.SendTelemetryFreq = 10000;
            _weatherDevice.Connect();
        }