public static PID Parse(PIDCode pidCode, ObdCommand command, string response, string ecu) { var pid = _listPIDs.FirstOrDefault(p => p.PIDCode == pidCode); if (pid == null) { throw new ArgumentException($"PIDCode {pidCode} not defined in PID.CS (_listPids)"); } var rawValue = GetRawValue(pid, response, ecu); if (rawValue != null) { pid.Value = pid.Decoder(rawValue); } return(pid); }
public ObdConnection(IConnection connection) { Connection = connection; Command = new ObdCommand(connection); }