Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public ObdConnection(IConnection connection)
 {
     Connection = connection;
     Command    = new ObdCommand(connection);
 }