示例#1
0
        public async Task DevicesCrossReference(IEnumerable <BaseDevice> devices)
        {
            if (_mappedIDs.Count == 0)
            {
                return;
            }
            // TODO will block
            var miner = CreateMiner() as IBinAndCwdPathsGettter;

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

            var mappedDevs = DevicesListParser.ParsePhoenixOutput(output, devices);

            foreach (var kvp in mappedDevs)
            {
                var uuid    = kvp.Key;
                var indexID = kvp.Value;
                _mappedIDs[uuid] = indexID;
            }
        }
示例#2
0
        private async Task MapDeviceCrossRefference(IEnumerable <BaseDevice> devices, string minerBinPath, string parameters)
        {
            var output = await DevicesCrossReferenceHelpers.MinerOutput(minerBinPath, parameters);

            var mappedDevs = DevicesListParser.ParsePhoenixOutput(output, devices);

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