sendMessage(message) {
    return new Promise((resolve, reject) => {
      var dgram = require('dgram');
      var buffer = new Buffer(message);

      var client = dgram.createSocket('udp4');
      client.send(
        buffer,
        0,
        buffer.length,
        this.port,
        this.host,
        (err, bytes) => {
          // Close connection
          client.close();

          if (err) {
            reject(err);
          } else {
            resolve(bytes);
          }
        });
    });
  }
/**
  * Send a Message to Gateway
  * @private
  * @param {String} message Message to be send
  */
Send a Message to Gateway
@private
@param {String} message Message to be send
Send a Message to Gateway @private @param { String } message Message to be send
sendMessage(message) {
    return new Promise((resolve, reject) => {
      var dgram = require('dgram');
      var buffer = new Buffer(message);
      var client = dgram.createSocket('udp4');
      client.send(
        buffer,
        0,
        buffer.length,
        this.port,
        this.host,
        (err, bytes) => {
          client.close();
          if (err) {
            reject(err);
          } else {
            resolve(bytes);
          }
        });
    });
  }
sendMessage ( message ) { return new Promise ( ( resolve , reject ) => { var dgram = require ( 'dgram' ) ; var buffer = new Buffer ( message ) ; var client = dgram . createSocket ( 'udp4' ) ; client . send ( buffer , 0 , buffer . length , this . port , this . host , ( err , bytes ) => { client . close ( ) ; if ( err ) { reject ( err ) ; } else { resolve ( bytes ) ; } } ) ; } ) ; }
Send a Message to Gateway
 @private
 @param {String} message Message to be send
Send a Message to Gateway @private @param { String } message Message to be send
// Close connection