Browse files

fix for custom sensors

  • Loading branch information...
1 parent e158afe commit a1e40f83ea013e971e1f8937f6164e3fc2ecd012 @cail committed Nov 17, 2011
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/elm/OBD2Sensor.cs
View
8 src/elm/OBD2Sensor.cs
@@ -75,17 +75,19 @@ public virtual bool SetValue(byte[] dataraw)
data_offset++;
}
if (data_offset >= dataraw.Length-1)
- return false;
+ {
+ data_offset = 0;
+ }
this.dataraw = dataraw;
try{
this.Value = obdValue(this);
- }catch(Exception e){
+ }catch(Exception){
string r = "";
for (int i = 0; i < dataraw.Length; i++)
r += dataraw[i].ToString("X2") + " ";
- Logger.error("OBD2Sensor", "Fail parsing sensor value: " + this.ID + " " + r, e);
+ Logger.error("OBD2Sensor", "Fail parsing sensor value: " + this.ID + " " + r);
return false;
}
this.TimeStamp = DateTimeMs.Now;

0 comments on commit a1e40f8

Please sign in to comment.