How to use the azure-iot-common.results.Connected function in azure-iot-common

To help you get started, we’ve selected a few azure-iot-common 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 / node-red-contrib-azure / iot-hub / node_modules / azure-iot-amqp-base / lib / amqp.js View on Github external
.then(function (result) {
        debug('AMQP transport connected.');
        this._connected = true;
        /*Codes_SRS_NODE_COMMON_AMQP_16_002: [The connect method shall establish a connection with the IoT hub instance and call the done() callback if given as argument] */
        if (done) done(null, new results.Connected(result));
        return null;
      }.bind(this))
      .catch(function (err) {
github Azure / azure-iot-sdk-node / service / src / amqp.ts View on Github external
_onEnter: (applicationSuppliedSas, callback) => {
            if (!applicationSuppliedSas) {
              this._renewalTimeout = setTimeout(this._handleSASRenewal.bind(this), this._renewalNumberOfMilliseconds);
            }
            callback(null, new results.Connected());
          },
          _onExit: (callback) => {
github Azure / azure-iot-sdk-node / common / transport / amqp / lib / amqp.js View on Github external
.then(function (result) {
        debug('AMQP transport connected.');
        this._connected = true;
        /*Codes_SRS_NODE_COMMON_AMQP_16_002: [The `connect` method shall establish a connection with the IoT hub instance and if given as argument call the `done` callback with a null error object in the case of success and a `results.Connected` object.]*/
        safeCallback(done, null, new results.Connected(result));
        return null;
      }.bind(this))
      .catch(function (err) {
github Azure / azure-iot-sdk-node / device / transport / mqtt / src / mqtt.ts View on Github external
_onEnter: (connectedCallback, connectResult) => {
            /*Codes_SRS_NODE_DEVICE_MQTT_16_020: [The `connect` method shall call its callback with a `null` error parameter and a `results.Connected` response if `MqttBase` successfully connects.]*/
            if (connectedCallback) connectedCallback(null, new results.Connected(connectResult));
          },
          /*Codes_SRS_NODE_DEVICE_MQTT_16_018: [The `connect` method shall call its callback immediately if `MqttBase` is already connected.]*/
github Azure / azure-iot-sdk-node / common / transport / amqp / src / amqp.ts View on Github external
_onEnter: (connectCallback, result) => {
            /*Codes_SRS_NODE_COMMON_AMQP_16_002: [The `connect` method shall establish a connection with the IoT hub instance and if given as argument call the `done` callback with a null error object in the case of success and a `results.Connected` object.]*/
            this._safeCallback(connectCallback, null, new results.Connected(result));
          },
          session_error: (context: EventContext) => {
github Azure / azure-iot-sdk-node / common / transport / amqp / src / amqp.ts View on Github external
          connect: (policyOverride, callback) => callback(null, new results.Connected()),
          disconnect: (disconnectCallback) => {
github Azure / azure-iot-sdk-node / service / src / amqp.ts View on Github external
this._fsm.handle('connect', (err) => {
      if (err) {
        done(translateError('AMQP Transport: Could not connect', err));
      } else {
        done(null, new results.Connected());
      }
    });
  }
github Azure / azure-iot-sdk-node / device / transport / mqtt / src / mqtt.ts View on Github external
          connect: (connectCallback) => connectCallback(null, new results.Connected()),
          disconnect: (disconnectCallback) => {
github Azure / azure-iot-sdk-node / common / transport / amqp / lib / amqp.js View on Github external
.then(function (result) {
        debug('AMQP transport connected.');
        this._connected = true;
        /*Codes_SRS_NODE_COMMON_AMQP_16_002: [The `connect` method shall establish a connection with the IoT hub instance and if given as argument call the `done` callback with a null error object in the case of success and a `results.Connected` object.]*/
        safeCallback(done, null, new results.Connected(result));
        return null;
      }.bind(this))
      .catch(function (err) {
        this._amqp.removeListener('client:errorReceived', connectErrorHander);
        this._connected = false;
        /*Codes_SRS_NODE_COMMON_AMQP_16_003: [The `connect` method shall call the `done` callback if the connection fails.] */
        safeCallback(done, connectError || err);
      }.bind(this));
  } else {
    debug('connect called when already connected.');
    safeCallback(done, null, new results.Connected());
  }
};
github Azure / azure-iot-sdk-node / device / transport / amqp / src / amqp.ts View on Github external
          connect: (connectCallback) => connectCallback(null, new results.Connected()),
          disconnect: (disconnectCallback) => this._fsm.transition('disconnecting', disconnectCallback),