code: function authenticate(tenantOrSupertenantId, logmetToken, isSuperTenant) {
      // Identification frame:
      // 1 | I | id_size | id
      var idFrameTypeAndVersion = '1I';
      var clientIdString = 'standalone_dlms_data_client_v0.0.1_' + os.hostname();
      logger.info('Identifying the Logmet client: ' + clientIdString);
  
      var idDataBuffer = new Buffer(idFrameTypeAndVersion.length + 1 + clientIdString.length);
  
      idDataBuffer.write(idFrameTypeAndVersion, 0 , idFrameTypeAndVersion.length);
  
      idDataBuffer.writeUIntBE(clientIdString.length, idFrameTypeAndVersion.length, 1);
      idDataBuffer.write(clientIdString, idFrameTypeAndVersion.length + 1, clientIdString.length);
  
      // Send the identification frame to Logmet
      tlsSocket.write(idDataBuffer);
  
      // Authentication frame:
      // 2 | S or T | tenant_id_size | tenant_id | token_size | token
      var authFrameTypeAndVersion = isSuperTenant ? '2S' : '2T';
      logger.info('Authenticating with Logmet with frame type: ' + authFrameTypeAndVersion[1]);
  
      var bufferSize = authFrameTypeAndVersion.length + tenantOrSupertenantId.length + logmetToken.length + 2;
      var authDataBuffer = new Buffer(bufferSize);
  
      authDataBuffer.write(authFrameTypeAndVersion, 0, authFrameTypeAndVersion.length);
  
      authDataBuffer.writeUIntBE(tenantOrSupertenantId.length, authFrameTypeAndVersion.length, 1);
      authDataBuffer.write(tenantOrSupertenantId, authFrameTypeAndVersion.length + 1, tenantOrSupertenantId.length);
  
      authDataBuffer.writeUIntBE(logmetToken.length, authFrameTypeAndVersion.length + 1 + tenantOrSupertenantId.length, 1);
      authDataBuffer.write(logmetToken, authFrameTypeAndVersion.length + 1 + tenantOrSupertenantId.length + 1, logmetToken.length);
  
      // Send the authentication frame to Logmet
      tlsSocket.write(authDataBuffer);
  }
docs: /*
  Performs the Logmet authentication handshake