private async Task <List <ObdPid> > getReportedPids(ObdPid rangePid) { if (!rangePid.ToString().Contains("PidSupport")) { throw new ArgumentOutOfRangeException("Not a valid Pid Support OBDPid"); } var reported = (await Run(rangePid)).Value as Dictionary <ObdPid, bool>; if (reported == null) { return(new List <ObdPid>()); } else { return(reported.Keys.Where(k => reported[k]).ToList()); } }
private async Task<List<ObdPid>> getReportedPids(ObdPid rangePid) { if (!rangePid.ToString().Contains("PidSupport")) throw new ArgumentOutOfRangeException("Not a valid Pid Support OBDPid"); var reported = (await Run(rangePid)).Value as Dictionary<ObdPid, bool>; if (reported == null) return new List<ObdPid>(); else return reported.Keys.Where(k => reported[k]).ToList(); }
public static string GetName(this ObdPid pid) { return(string.Format("PID {0}", pid.ToString().Replace("Pid", ""))); }