const deviceInfo = async () => {
  let os = require('os');
  let Utils = require('./smgutils');
  let utils = new Utils();
  let config = await utils.readConfig();
  let Player = require('../playerCan/clsPlayer').clsPlayer;
  let p = new Player({
    config,
    utils
  });
  let DiskUsage = require('./DiskUsage');
  let diskUsage = new DiskUsage();

  let devices = p.getExtendedInfo();


  let obj = {
    osFreeMem: os.freemem(),
    osTotalMem: os.totalmem(),
    playerMemUsage: process.memoryUsage().rss,
    freeDiskSpace: diskUsage.freeSpaceSync(),
    deviceUptime: os.uptime(),
    playerUptime: process.uptime(),
    deviceType: os.platform() + ' ' + os.arch(),
    osRelease: os.release(),
    soundCards: devices
  };
  return obj;

};

module.exports = deviceInfo;

// async function test() {
//   const q = await deviceInfo();
//   console.log(q);
// }
//
// test();