示例#1
0
        /// <summary>
        /// Поиск PMBus устройств
        /// </summary>
        /// <returns>Коллекция найденных устройств, null - если устройства не найдены</returns>
        public static List <ParamerusPMBusDevice> PMBusInit()
        {
            var opts = new PMBusDevice.DiscoverOptions();

            opts.Scan_Mode = PMBusDevice.ScanMode.DeviceCode;
            if (PMBusDevice.Discover(opts) == 0)
            {
                opts.Scan_Mode = PMBusDevice.ScanMode.DeviceID;
                if (PMBusDevice.Discover(opts) == 0)
                {
                    opts.Scan_Mode = PMBusDevice.ScanMode.TPS53951;
                    if (PMBusDevice.Discover(opts) == 0)
                    {
                        return(null);
                    }
                }
            }
            List <ParamerusPMBusDevice> listDevices = new List <ParamerusPMBusDevice>();

            foreach (var dev in PMBusDevice.Devices)
            {
                listDevices.Add(new ParamerusPMBusDevice(dev));
            }

            return(listDevices);
        }
示例#2
0
 public PMBusReadCommand(PMBusDevice _dev, Action <object> _propertyChangeDelegate, Func <bool> _checkNullPropertyDelegate)
 {
     dev = _dev;
     propertyChangeDelegate    = _propertyChangeDelegate;
     checkNullPropertyDelegate = _checkNullPropertyDelegate;
 }
示例#3
0
 public ReadTemp2Command(PMBusDevice _dev, Action <object> act, Func <bool> check) : base(_dev, act, check)
 {
     command_code = PMBusCode.READ_TEMP_2;
 }
示例#4
0
 public ReadIinCommand(PMBusDevice _dev, Action <object> act, Func <bool> check) : base(_dev, act, check)
 {
     command_code = PMBusCode.READ_IIN;
 }