MissionPlanner.Comms.SerialPort.GetNiceName C# (CSharp) Method

GetNiceName() public static method

public static GetNiceName ( string port ) : string
port string
return string
        public static string GetNiceName(string port)
        {
            // make sure we are exclusive
            lock (locker)
            {
                log.Info("start GetNiceName " + port);
                portnamenice = "";

                if (comportnamecache.ContainsKey(port))
                {
                    log.Info("done GetNiceName cache " + port);
                    return comportnamecache[port];
                }

                try
                {
                    CallWithTimeout(new Action<string>(GetName), 1000, port);
                }
                catch
                {
                }
                log.Info("done GetNiceName " + port + " = " + portnamenice);

                comportnamecache[port] = portnamenice;

                return (string)portnamenice.Clone();
            }
        }