コード例 #1
0
        void IStartupOptionsBuilder.configure(StartupOptions options)
        {
            if (string.IsNullOrEmpty(options.PortName))
            {
                var ports = new DeviceDetector().GetPorts();

                if (ports.Any() && ports.Count() == 1)
                {
                    options.PortName = ports.FirstOrDefault();
                }
            }

            options.BaudRate = 9600;
        }