Example #1
0
        public async Task DevicesCrossReference(IEnumerable <BaseDevice> devices)
        {
#if DISABLE_IDevicesCrossReference
            await Task.CompletedTask;
#else
#warning Blocks exit. Check if this is fixed with newer versions
            //return;
            try
            {
                if (_mappedIDs.Count == 0)
                {
                    return;
                }
                // TODO will break
                var minerBinPath = GetBinAndCwdPaths().Item1;
                var output       = await DevicesCrossReferenceHelpers.MinerOutput(minerBinPath, "--device-info-json --no-watchdog"); // AMD + NVIDIA

                var mappedDevs = DevicesListParser.ParseNBMinerOutput(output, devices.ToList());

                foreach (var kvp in mappedDevs)
                {
                    var uuid    = kvp.Key;
                    var indexID = kvp.Value;
                    _mappedIDs[uuid] = indexID;
                }
            } catch (Exception ex)
            {
                Logger.Error("NBMiner", $"Error during DevicesCrossReference: {ex.Message}");
            }
#endif
        }
Example #2
0
        public async Task DevicesCrossReference(IEnumerable <BaseDevice> devices)
        {
            if (_mappedIDs.Count == 0)
            {
                return;
            }
            // TODO will break
            var miner = CreateMiner() as IBinAndCwdPathsGettter;

            if (miner == null)
            {
                return;
            }
            var minerBinPath = miner.GetBinAndCwdPaths().Item1;
            var output       = await DevicesCrossReferenceHelpers.MinerOutput(minerBinPath, "--device-info-json -RUN");

            var mappedDevs = DevicesListParser.ParseNBMinerOutput(output, devices.ToList());

            foreach (var kvp in mappedDevs)
            {
                var uuid    = kvp.Key;
                var indexID = kvp.Value;
                _mappedIDs[uuid] = indexID;
            }
        }
Example #3
0
        public async Task DevicesCrossReference(IEnumerable <BaseDevice> devices)
        {
            try
            {
                if (_mappedIDs.Count == 0)
                {
                    return;
                }
                // TODO will break
                var minerBinPath = GetBinAndCwdPaths().Item1;
                var output       = await DevicesCrossReferenceHelpers.MinerOutput(minerBinPath, "--device-info-json --no-watchdog"); // AMD + NVIDIA

                var mappedDevs = DevicesListParser.ParseNBMinerOutput(output, devices.ToList());

                foreach (var kvp in mappedDevs)
                {
                    var uuid    = kvp.Key;
                    var indexID = kvp.Value;
                    _mappedIDs[uuid] = indexID;
                }
            }
            catch (Exception ex)
            {
                Logger.Error("NBMiner", $"Error during DevicesCrossReference: {ex.Message}");
            }
        }
Example #4
0
        public async Task DevicesCrossReference(IEnumerable <BaseDevice> devices)
        {
            try
            {
                if (_mappedIDs.Count == 0)
                {
                    return;
                }
                var(minerBinPath, minerCwdPath) = GetBinAndCwdPaths();
                var output = await DevicesCrossReferenceHelpers.MinerOutput(minerBinPath, "--device-info-json --no-watchdog"); // AMD + NVIDIA

                var dumpFile = $"d{DateTime.UtcNow.Ticks}.txt";
                try
                {
                    File.WriteAllText(Path.Combine(minerCwdPath, dumpFile), output);
                }
                catch (Exception e)
                {
                    Logger.Error("NBMiner", $"DevicesCrossReference error creating dump file ({dumpFile}): {e.Message}");
                }
                var mappedDevs = DevicesListParser.ParseNBMinerOutput(output, devices);

                foreach (var(uuid, indexID) in mappedDevs.Select(kvp => (kvp.Key, kvp.Value)))
                {
                    _mappedIDs[uuid] = indexID;
                }
            }
            catch (Exception ex)
            {
                Logger.Error("NBMiner", $"Error during DevicesCrossReference: {ex.Message}");
            }
        }
        public async Task DevicesCrossReference(IEnumerable <BaseDevice> devices)
        {
#if DISABLE_IDevicesCrossReference
            await Task.CompletedTask;
#else
#warning Blocks exit. Check if this is fixed with newer versions
            return;

            if (_mappedIDs.Count == 0)
            {
                return;
            }
            // TODO will break
            var minerBinPath = GetBinAndCwdPaths().Item1;
            var output       = await DevicesCrossReferenceHelpers.MinerOutput(minerBinPath, "--device-info-json --no-watchdog --platform 1"); // NVIDIA only

            var mappedDevs = DevicesListParser.ParseNBMinerOutput(output, devices.ToList());

            foreach (var kvp in mappedDevs)
            {
                var uuid    = kvp.Key;
                var indexID = kvp.Value;
                _mappedIDs[uuid] = indexID;
            }
#endif
        }
Example #6
0
        public async Task DevicesCrossReference(IEnumerable <BaseDevice> devices)
        {
#warning Blocks exit
            return;

            if (_mappedIDs.Count == 0)
            {
                return;
            }
            // TODO will break
            var minerBinPath = GetBinAndCwdPaths().Item1;
            var output       = await DevicesCrossReferenceHelpers.MinerOutput(minerBinPath, "--device-info-json --no-watchdog");

            var mappedDevs = DevicesListParser.ParseNBMinerOutput(output, devices.ToList());

            foreach (var kvp in mappedDevs)
            {
                var uuid    = kvp.Key;
                var indexID = kvp.Value;
                _mappedIDs[uuid] = indexID;
            }
        }