How to use the azure-iot-device-http.Http function in azure-iot-device-http

To help you get started, we’ve selected a few azure-iot-device-http examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure-Samples / iot-hub-node-intel-edison-getstartedkit / remote_monitoring / remote_monitoring.js View on Github external
var hostName        = '';
var deviceId        = '';
var sharedAccessKey = '';

// String containing Hostname, Device Id & Device Key in the following formats:
//  "HostName=;DeviceId=;SharedAccessKey="
var connectionString = 'HostName=' + hostName + ';DeviceId=' + deviceId + ';SharedAccessKey=' + sharedAccessKey;

// Sensor data
var temperature = 0;
var humidity = 0;
var externalTemperature = 0;

// Create IoT Hub client
var client = Client.fromConnectionString(connectionString, Protocol);

// Helper function to print results for an operation
function printErrorFor(op) {
  return function printError(err) {
    if (err) console.log(op + ' error: ' + err.toString());
  };
}

// Send device meta data
var deviceMetaData = {
  'ObjectType': 'DeviceInfo',
  'IsSimulatedDevice': 0,
  'Version': '1.0',
  'DeviceProperties': {
    'DeviceID': deviceId,
    'HubEnabledState': 1,

azure-iot-device-http

HTTP transport for Azure IoT device SDK

MIT
Latest version published 11 months ago

Package Health Score

65 / 100
Full package analysis

Similar packages