/// <summary>
        /// Gets the available ports by applying the supplied filter.
        /// </summary>
        /// <param name="filter">A predicate to filter out ports that should not be included. If <c>null</c>, all ports in <see cref="AvailablePorts"/> are returned.</param>
        /// <returns>The available ports, excluding those that do not pass the given filter.</returns>
        public static IEnumerable <string> GetAvailablePorts(Predicate <INTV.Core.Model.Device.IConnection> filter)
        {
            var availablePorts = filter == null ? AvailablePorts : AvailablePorts.Where(p => filter(Connection.CreatePseudoConnection(p, ConnectionType.Serial)));

            return(availablePorts);
        }