private OBDParameterValue GetJ1939Value(OBDParameter param, OBDResponse response) { OBDParameterValue value2 = new OBDParameterValue(); if (response.Header.Substring(2, 2) == "E8") { // J1939的确认消息,非正确的返回值 value2.ErrorDetected = true; return(value2); } switch (param.Parameter) { case 0xFECE: value2 = GetDM5Value(param, response); break; case 0xD300: value2 = GetDM19Value(param, response); break; case 0xFEEC: // VIN value2.ListStringValue = SetMode09ASCII(17 * 2, response); break; } return(value2); }
private List <string> SetMode09ASCII(int DataOffset, OBDResponse response) { List <string> strings = new List <string>(); int num = response.Data.Length / DataOffset; for (int i = 0; i < num; i++) { strings.Add(Utility.HexStrToASCIIStr(response.Data.Substring(i * DataOffset, DataOffset))); } return(strings); }
private OBDParameterValue GetDM19Value(OBDParameter param, OBDResponse response) { OBDParameterValue value2 = new OBDParameterValue(); if (response.GetDataByteCount() < 20) { value2.ErrorDetected = true; return(value2); } int qty = response.Data.Length / (20 * 2); string strData = ""; int OriginalParam = param.Parameter; int OriginalService = param.Service; param.Service = 9; switch (param.SignalName) { case "CVN": param.Parameter = 0x06; for (int i = 0; i < qty; i++) { strData += response.Data.Substring(i * 20 * 2, 4 * 2); } response.Data = strData; value2 = GetMode010209Value(param, response); for (int i = 0; i < value2.ListStringValue.Count; i++) { string strVal = value2.ListStringValue[i]; value2.ListStringValue[i] = strVal.Substring(6, 2) + strVal.Substring(4, 2) + strVal.Substring(2, 2) + strVal.Substring(0, 2); } break; case "CAL_ID": param.Parameter = 0x04; for (int i = 0; i < qty; i++) { strData += response.Data.Substring(4 * 2 + i * 20 * 2, 16 * 2); } response.Data = strData; value2 = GetMode010209Value(param, response); break; default: value2.ErrorDetected = true; break; } param.Parameter = OriginalParam; param.Service = OriginalService; return(value2); }
private OBDParameterValue GetDM5Value(OBDParameter param, OBDResponse response) { OBDParameterValue value2 = new OBDParameterValue(); if (response.GetDataByteCount() < 8) { value2.ErrorDetected = true; return(value2); } switch (param.SignalName) { case "": case "OBDSUP": // OBD型式 response.Data = response.GetDataByte(2); value2 = GetPIDValue(0x11C, response.Data, param.SignalName); break; case "ACT_DTC_CNT": // 激活的故障代码,未实现解析功能 response.Data = response.GetDataByte(0); break; case "PRE_DTC_CNT": // 先前激活的诊断故障代码,未实现解析功能 response.Data = response.GetDataByte(1); break; case "CON_MON": // 持续监视系统支持/状态,未实现解析功能 response.Data = response.GetDataByte(3); break; case "NON_SUP": // 非持续监视系统支持,未实现解析功能 response.Data = response.GetDataByte(4) + response.GetDataByte(5); break; case "NON_STAT": // 非持续监视系统状态,未实现解析功能 response.Data = response.GetDataByte(6) + response.GetDataByte(7); break; default: value2.ErrorDetected = true; break; } return(value2); }
public OBDParameterValue GetMode010209Value(OBDParameter param, OBDResponse response) { OBDParameterValue value2; if (param.Parameter % 0x20 == 0) { value2 = GetPIDSupport(response); } else { uint ID = (uint)((param.Service == 2 ? param.Service - 1 : param.Service << 8) + param.Parameter); value2 = GetPIDValue(ID, response.Data, param.SignalName); } return(value2); }
public OBDParameterValue GetMode03070AValue(OBDResponse response) { OBDParameterValue value2 = new OBDParameterValue(); List <string> strings = new List <string>(); for (int i = 0; i <= response.Data.Length - 4; i += 4) { string str = GetDTCName(response.Data.Substring(i, 4)); if (str.CompareTo("P0000") != 0) { strings.Add(str); } } value2.ListStringValue = strings; return(value2); }
public OBDParameterValue GetPIDSupport(OBDResponse response) { OBDParameterValue value2 = new OBDParameterValue(); if (response.GetDataByteCount() < 4) { value2.ErrorDetected = true; return(value2); } int dataA = Utility.Hex2Int(response.GetDataByte(0)); int dataB = Utility.Hex2Int(response.GetDataByte(1)); int dataC = Utility.Hex2Int(response.GetDataByte(2)); int dataD = Utility.Hex2Int(response.GetDataByte(3)); value2.SetBitFlagBAT(dataA, dataB, dataC, dataD); return(value2); }
private OBDParameterValue Get19DTCValue(OBDResponse response, int offset, int WholeDTCLenInByte = 4) { if (offset - WholeDTCLenInByte * 2 < 0) { return(null); } OBDParameterValue value2 = new OBDParameterValue(); List <string> strings = new List <string>(); for (int i = 0; i <= response.Data.Length - offset; i += offset) { string str = GetDTCName(response.Data.Substring(i + offset - WholeDTCLenInByte * 2, 6)); if (!str.StartsWith("P0000")) { strings.Add(str); } } value2.ListStringValue = strings; return(value2); }
public override OBDResponseList parse(OBDParameter param, string response) { if (response != null) { if (response.Length < 1) { response = ""; } } else { response = ""; } OBDResponseList obdResponseList = new OBDResponseList(response); response = strip(response); if (errorCheck(response)) { obdResponseList.ErrorDetected = true; return(obdResponseList); } else { ArrayList arrayList1 = split(response); arrayList1.Sort(); ArrayList arrayList2 = new ArrayList(); ArrayList arrayList3 = new ArrayList(); arrayList3.Add(arrayList1[0]); arrayList2.Add((object)arrayList3); string str1 = (string)arrayList1[0]; if (str1.Length < OBDParser_ISO14230_4_KWP.HEADER_LENGTH) { obdResponseList.ErrorDetected = true; return(obdResponseList); } else { string strB = str1.Substring(0, OBDParser_ISO14230_4_KWP.HEADER_LENGTH); int index1 = 1; if (1 < arrayList1.Count) { do { string str2 = (string)arrayList1[index1]; if (str2.Length >= OBDParser_ISO14230_4_KWP.HEADER_LENGTH) { if (str2.Substring(0, OBDParser_ISO14230_4_KWP.HEADER_LENGTH).CompareTo(strB) == 0) { arrayList3.Add((object)str2); } else { arrayList3 = new ArrayList(); arrayList3.Add(arrayList1[index1]); arrayList2.Add((object)arrayList3); strB = str2.Substring(0, OBDParser_ISO14230_4_KWP.HEADER_LENGTH); } ++index1; } else { goto label_14; } }while (index1 < arrayList1.Count); goto label_15; label_14: obdResponseList.ErrorDetected = true; return(obdResponseList); } label_15: int index2 = 0; if (0 < arrayList2.Count) { do { OBDResponse response1 = new OBDResponse(); ArrayList arrayList4 = (ArrayList)arrayList2[index2]; int dataStartIndex = getDataStartIndex(param); string str2 = (string)arrayList4[0]; int num1 = -2 - dataStartIndex; int length1 = str2.Length + num1; response1.Header = str2.Substring(0, OBDParser_ISO14230_4_KWP.HEADER_LENGTH); response1.Data = length1 > 0 ? str2.Substring(dataStartIndex, length1) : ""; int index3 = 1; if (1 < arrayList4.Count) { int num2 = num1; do { string str3 = (string)arrayList4[index3]; int length2 = str3.Length + num2; string str4 = length2 > 0 ? str3.Substring(dataStartIndex, length2) : ""; response1.Data = response1.Data + str4; ++index3; }while (index3 < arrayList4.Count); } obdResponseList.AddOBDResponse(response1); ++index2; }while (index2 < arrayList2.Count); } return(obdResponseList); } } }
public override OBDResponseList parse(OBDParameter param, string response) { if (response != null) { if (response.Length < 1) response = ""; } else response = ""; OBDResponseList obdResponseList = new OBDResponseList(response); response = strip(response); if (errorCheck(response)) { obdResponseList.ErrorDetected = true; return obdResponseList; } else { ArrayList arrayList1 = split(response); arrayList1.Sort(); ArrayList arrayList2 = new ArrayList(); ArrayList arrayList3 = new ArrayList(); arrayList3.Add(arrayList1[0]); arrayList2.Add((object)arrayList3); string str1 = (string)arrayList1[0]; if (str1.Length < OBDParser_ISO14230_4_KWP.HEADER_LENGTH) { obdResponseList.ErrorDetected = true; return obdResponseList; } else { string strB = str1.Substring(0, OBDParser_ISO14230_4_KWP.HEADER_LENGTH); int index1 = 1; if (1 < arrayList1.Count) { do { string str2 = (string)arrayList1[index1]; if (str2.Length >= OBDParser_ISO14230_4_KWP.HEADER_LENGTH) { if (str2.Substring(0, OBDParser_ISO14230_4_KWP.HEADER_LENGTH).CompareTo(strB) == 0) { arrayList3.Add((object)str2); } else { arrayList3 = new ArrayList(); arrayList3.Add(arrayList1[index1]); arrayList2.Add((object)arrayList3); strB = str2.Substring(0, OBDParser_ISO14230_4_KWP.HEADER_LENGTH); } ++index1; } else goto label_14; } while (index1 < arrayList1.Count); goto label_15; label_14: obdResponseList.ErrorDetected = true; return obdResponseList; } label_15: int index2 = 0; if (0 < arrayList2.Count) { do { OBDResponse response1 = new OBDResponse(); ArrayList arrayList4 = (ArrayList)arrayList2[index2]; int dataStartIndex = getDataStartIndex(param); string str2 = (string)arrayList4[0]; int num1 = -2 - dataStartIndex; int length1 = str2.Length + num1; response1.Header = str2.Substring(0, OBDParser_ISO14230_4_KWP.HEADER_LENGTH); response1.Data = length1 > 0 ? str2.Substring(dataStartIndex, length1) : ""; int index3 = 1; if (1 < arrayList4.Count) { int num2 = num1; do { string str3 = (string)arrayList4[index3]; int length2 = str3.Length + num2; string str4 = length2 > 0 ? str3.Substring(dataStartIndex, length2) : ""; response1.Data = response1.Data + str4; ++index3; } while (index3 < arrayList4.Count); } obdResponseList.AddOBDResponse(response1); ++index2; } while (index2 < arrayList2.Count); } return obdResponseList; } } }
public OBDParameterValue GetValue(OBDParameter param, OBDResponse response) { OBDParameterValue value2 = new OBDParameterValue(); if (response == null) { value2.ErrorDetected = true; return(value2); } switch (param.Service) { case 0: // SAE J1939 value2 = GetJ1939Value(param, response); break; case 1: case 2: value2 = GetMode010209Value(param, response); break; case 3: case 7: case 0x0A: value2 = GetMode03070AValue(response); break; case 9: value2 = GetMode010209Value(param, response); break; case 0x19: // ISO 27145 ReadDTCInformation string reportType = param.OBDRequest.Substring(2, 2); if (reportType == "42") { value2 = Get42DTCValue(response); } else if (reportType == "55") { value2 = Get55DTCValue(response); } break; case 0x22: // ISO 27145 ReadDataByIdentifer int HByte = (param.Parameter >> 8) & 0xFF; int LByte = param.Parameter & 0x00FF; int OriginalParam = param.Parameter; int OriginalService = param.Service; param.Parameter = LByte; if (HByte == 0xF4) { param.Service = 1; value2 = GetMode010209Value(param, response); } else if (HByte == 0xF8) { param.Service = 9; value2 = GetMode010209Value(param, response); } param.Parameter = OriginalParam; param.Service = OriginalService; break; default: value2.ErrorDetected = true; break; } value2.ECUResponseID = response.Header; if (value2.ECUResponseID.Length == 6) { // 如果是K线协议的话ECUResponseID取最后2个字节 value2.ECUResponseID = value2.ECUResponseID.Substring(2); } else if (value2.ECUResponseID.Length == 8 && param.Service == 0) { // 如果是J1939协议的话ECUResponseID取最后1个字节 value2.ECUResponseID = value2.ECUResponseID.Substring(6); } return(value2); }
private OBDParameterValue Get55DTCValue(OBDResponse response) { return(Get19DTCValue(response, 8)); }
public void AddOBDResponse(OBDResponse response) { m_listResponses.Add((object)response); }
public OBDResponseList Parse(OBDParameter param, string response, int headLen) { if (string.IsNullOrEmpty(response)) { response = ""; } OBDResponseList responseList = new OBDResponseList(response); response = Strip(response); response = ErrorFilter(response); if (ErrorCheck(response)) { responseList.ErrorDetected = true; return(responseList); } List <string> legalLines = SplitByCR(response); legalLines = GetLegalLines(param, legalLines, headLen); List <string> lines = new List <string>(); foreach (string item in legalLines) { if (item.Length > 0 && item.Length < headLen) { // 过滤数据帧总长小于帧头长度的错误数据 continue; } string strNRC = GetNRC(item, headLen); if (strNRC.Length == 0) { lines.Add(item); } else if (strNRC == "78") { responseList.Pending = true; } } if (lines.Count == 0) { if (responseList.Pending) { responseList.RawResponse = "PENDING"; return(responseList); } else { responseList.ErrorDetected = true; return(responseList); } } lines.Sort(); List <List <string> > groups = new List <List <string> >(); List <string> group = new List <string> { lines[0] }; groups.Add(group); if (lines[0].Length < headLen) { responseList.ErrorDetected = true; return(responseList); } string header = lines[0].Substring(0, headLen); for (int i = 1; i < lines.Count; i++) { if (lines[i].Length >= headLen) { if (lines[i].Substring(0, headLen).CompareTo(header) == 0) { group.Add(lines[i]); } else { group = new List <string> { lines[i] }; groups.Add(group); header = lines[i].Substring(0, headLen); } } else { responseList.ErrorDetected = true; return(responseList); } } for (int i = 0; i < groups.Count; i++) { OBDResponse obd_response = new OBDResponse(); bool bIsMultiline = false; if (groups[i].Count > 1) { bIsMultiline = true; } int dataStartIndex = GetDataStartIndex(headLen, param, bIsMultiline); int length1 = groups[i][0].Length - dataStartIndex - 2; obd_response.Header = groups[i][0].Substring(0, headLen); obd_response.Data = length1 > 0 ? groups[i][0].Substring(dataStartIndex, length1) : ""; for (int j = 1; j < groups[i].Count; j++) { int length2 = groups[i][j].Length - dataStartIndex - 2; obd_response.Data += (length2 > 0 ? groups[i][j].Substring(dataStartIndex, length2) : ""); } responseList.AddOBDResponse(obd_response); } return(responseList); }
public static OBDParameterValue getValue(OBDParameter param, OBDResponse response, bool bEnglishUnits) { StringCollection strings; OBDParameterValue value2 = new OBDParameterValue(); if (response == null) { value2.ErrorDetected = true; return value2; } switch (param.Service) { case 0: case 1: case 2: switch (param.Parameter) { case 0: case 0x20: case 0x40: case 0x60: case 0x80: { if (response.getDataByteCount() < 4) { value2.ErrorDetected = true; return value2; } int num8 = HexByteToInt(response.getDataByte(0)); int num7 = HexByteToInt(response.getDataByte(1)); int num6 = HexByteToInt(response.getDataByte(2)); int num5 = HexByteToInt(response.getDataByte(3)); value2.setBitFlag(0, ((num8 >> 7) & 1) == 1 ? false : true); value2.setBitFlag(1, ((num8 >> 6) & 1) == 1 ? false : true); value2.setBitFlag(2, ((num8 >> 5) & 1) == 1 ? false : true); value2.setBitFlag(3, ((num8 >> 4) & 1) == 1 ? false : true); value2.setBitFlag(4, ((num8 >> 3) & 1) == 1 ? false : true); value2.setBitFlag(5, ((num8 >> 2) & 1) == 1 ? false : true); value2.setBitFlag(6, ((num8 >> 1) & 1) == 1 ? false : true); value2.setBitFlag(7, (num8 & 1) == 1 ? false : true); value2.setBitFlag(8, ((num7 >> 7) & 1) == 1 ? false : true); value2.setBitFlag(9, ((num7 >> 6) & 1) == 1 ? false : true); value2.setBitFlag(10, ((num7 >> 5) & 1) == 1 ? false : true); value2.setBitFlag(11, ((num7 >> 4) & 1) == 1 ? false : true); value2.setBitFlag(12, ((num7 >> 3) & 1) == 1 ? false : true); value2.setBitFlag(13, ((num7 >> 2) & 1) == 1 ? false : true); value2.setBitFlag(14, ((num7 >> 1) & 1) == 1 ? false : true); value2.setBitFlag(15, (num7 & 1) == 1 ? false : true); value2.setBitFlag(16, ((num6 >> 7) & 1) == 1 ? false : true); value2.setBitFlag(17, ((num6 >> 6) & 1) == 1 ? false : true); value2.setBitFlag(18, ((num6 >> 5) & 1) == 1 ? false : true); value2.setBitFlag(19, ((num6 >> 4) & 1) == 1 ? false : true); value2.setBitFlag(20, ((num6 >> 3) & 1) == 1 ? false : true); value2.setBitFlag(21, ((num6 >> 2) & 1) == 1 ? false : true); value2.setBitFlag(22, ((num6 >> 1) & 1) == 1 ? false : true); value2.setBitFlag(23, (num6 & 1) == 1 ? false : true); value2.setBitFlag(24, ((num5 >> 7) & 1) == 1 ? false : true); value2.setBitFlag(25, ((num5 >> 6) & 1) == 1 ? false : true); value2.setBitFlag(26, ((num5 >> 5) & 1) == 1 ? false : true); value2.setBitFlag(27, ((num5 >> 4) & 1) == 1 ? false : true); value2.setBitFlag(28, ((num5 >> 3) & 1) == 1 ? false : true); value2.setBitFlag(29, ((num5 >> 2) & 1) == 1 ? false : true); value2.setBitFlag(30, ((num5 >> 1) & 1) == 1 ? false : true); value2.setBitFlag(31, (num5 & 1) == 1 ? false : true); return value2; } case 1: if (response.getDataByteCount() < 4) { value2.ErrorDetected = true; return value2; } switch (param.SubParameter) { case 0: if ((HexByteToInt(response.getDataByte(0)) & 0x80) == 0) return new OBDParameterValue(false, 0.0, "OFF", "OFF"); return new OBDParameterValue(true, 1.0, "ON", "ON"); case 1: { int num12 = HexByteToInt(response.getDataByte(0)); if ((num12 & 0x80) != 0) { num12 -= 0x80; } value2.DoubleValue = num12; return value2; } case 2: if ((HexByteToInt(response.getDataByte(1)) & 1) == 0) return new OBDParameterValue(false, 0.0, "NO", "NO"); return new OBDParameterValue(true, 1.0, "YES", "YES"); case 3: if ((HexByteToInt(response.getDataByte(1)) & 2) == 0) return new OBDParameterValue(false, 0.0, "NO", "NO"); return new OBDParameterValue(true, 1.0, "YES", "YES"); case 4: if ((HexByteToInt(response.getDataByte(1)) & 4) == 0) return new OBDParameterValue(false, 0.0, "NO", "NO"); return new OBDParameterValue(true, 1.0, "YES", "YES"); case 5: if ((HexByteToInt(response.getDataByte(1)) & 0x10) == 0) return new OBDParameterValue(true, 1.0, "YES", "YES"); return new OBDParameterValue(false, 0.0, "NO", "NO"); case 6: if ((HexByteToInt(response.getDataByte(1)) & 0x20) == 0) return new OBDParameterValue(true, 1.0, "YES", "YES"); return new OBDParameterValue(false, 0.0, "NO", "NO"); case 7: if ((HexByteToInt(response.getDataByte(1)) & 0x40) == 0) return new OBDParameterValue(true, 1.0, "YES", "YES"); return new OBDParameterValue(false, 0.0, "NO", "NO"); case 8: if ((HexByteToInt(response.getDataByte(2)) & 1) == 0) return new OBDParameterValue(false, 0.0, "NO", "NO"); return new OBDParameterValue(true, 1.0, "YES", "YES"); case 9: if ((HexByteToInt(response.getDataByte(2)) & 2) == 0) return new OBDParameterValue(false, 0.0, "NO", "NO"); return new OBDParameterValue(true, 1.0, "YES", "YES"); case 10: if ((HexByteToInt(response.getDataByte(2)) & 4) == 0) return new OBDParameterValue(false, 0.0, "NO", "NO"); return new OBDParameterValue(true, 1.0, "YES", "YES"); case 11: if ((HexByteToInt(response.getDataByte(2)) & 8) == 0) return new OBDParameterValue(false, 0.0, "NO", "NO"); return new OBDParameterValue(true, 1.0, "YES", "YES"); case 12: if ((HexByteToInt(response.getDataByte(2)) & 0x10) == 0) return new OBDParameterValue(false, 0.0, "NO", "NO"); return new OBDParameterValue(true, 1.0, "YES", "YES"); case 13: if ((HexByteToInt(response.getDataByte(2)) & 0x20) == 0) return new OBDParameterValue(false, 0.0, "NO", "NO"); return new OBDParameterValue(true, 1.0, "YES", "YES"); case 14: if ((HexByteToInt(response.getDataByte(2)) & 0x40) == 0) return new OBDParameterValue(false, 0.0, "NO", "NO"); return new OBDParameterValue(true, 1.0, "YES", "YES"); case 15: if ((HexByteToInt(response.getDataByte(2)) & 0x80) == 0) return new OBDParameterValue(false, 0.0, "NO", "NO"); return new OBDParameterValue(true, 1.0, "YES", "YES"); case 0x10: if ((HexByteToInt(response.getDataByte(3)) & 1) == 0) return new OBDParameterValue(true, 1.0, "YES", "YES"); return new OBDParameterValue(false, 0.0, "NO", "NO"); case 0x11: if ((HexByteToInt(response.getDataByte(3)) & 2) == 0) return new OBDParameterValue(true, 1.0, "YES", "YES"); return new OBDParameterValue(false, 0.0, "NO", "NO"); case 0x12: if ((HexByteToInt(response.getDataByte(3)) & 4) == 0) return new OBDParameterValue(true, 1.0, "YES", "YES"); return new OBDParameterValue(false, 0.0, "NO", "NO"); case 0x13: if ((HexByteToInt(response.getDataByte(3)) & 8) == 0) return new OBDParameterValue(true, 1.0, "YES", "YES"); return new OBDParameterValue(false, 0.0, "NO", "NO"); case 20: if ((HexByteToInt(response.getDataByte(3)) & 0x10) == 0) return new OBDParameterValue(true, 1.0, "YES", "YES"); return new OBDParameterValue(false, 0.0, "NO", "NO"); case 0x15: if ((HexByteToInt(response.getDataByte(3)) & 0x20) == 0) return new OBDParameterValue(true, 1.0, "YES", "YES"); return new OBDParameterValue(false, 0.0, "NO", "NO"); case 0x16: if ((HexByteToInt(response.getDataByte(3)) & 0x40) == 0) return new OBDParameterValue(true, 1.0, "YES", "YES"); return new OBDParameterValue(false, 0.0, "NO", "NO"); case 0x17: if ((HexByteToInt(response.getDataByte(3)) & 0x80) == 0) return new OBDParameterValue(true, 1.0, "YES", "YES"); return new OBDParameterValue(false, 0.0, "NO", "NO"); } goto Label_10DD; case 2: goto Label_10DD; case 3: int num9; if (response.getDataByteCount() < 2) { value2.ErrorDetected = true; return value2; } if (param.SubParameter == 0) { num9 = HexByteToInt(response.getDataByte(0)); } else { num9 = HexByteToInt(response.getDataByte(1)); } if ((num9 & 1) != 0) { value2.StringValue = "Open Loop: Has not yet satisfied conditions to go closed loop."; value2.ShortStringValue = "OL"; return value2; } if ((num9 & 2) != 0) { value2.StringValue = "Closed Loop: Using oxygen sensor(s) as feedback for fuel control."; value2.ShortStringValue = "CL"; return value2; } if ((num9 & 4) != 0) { value2.StringValue = "OL-Drive: Open loop due to driving conditions. (e.g., power enrichment, deceleration enleanment)"; value2.ShortStringValue = "OL-Drive"; return value2; } if ((num9 & 8) != 0) { value2.StringValue = "OL-Fault: Open loop due to detected system fault."; value2.ShortStringValue = "OL-Fault"; return value2; } if ((num9 & 0x10) != 0) { value2.StringValue = "CL-Fault: Closed loop, but fault with at least one oxygen sensor. May be using single oxygen sensor for fuel control."; value2.ShortStringValue = "CL-Fault"; return value2; } value2.StringValue = "Not Supported"; value2.ShortStringValue = value2.StringValue; return value2; case 4: if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } value2.DoubleValue = HexByteToInt(response.getDataByte(0)) * 0.39215686274509803; return value2; case 5: if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } value2.DoubleValue = HexByteToInt(response.getDataByte(0)) - 40.0; if (bEnglishUnits) { value2.DoubleValue = (value2.DoubleValue * 1.8) + 32.0; } return value2; case 6: case 7: case 8: case 9: int num16; if (response.getDataByteCount() < 2) { value2.ErrorDetected = true; return value2; } if (param.SubParameter == 0) { num16 = HexByteToInt(response.getDataByte(0)); } else { num16 = HexByteToInt(response.getDataByte(1)); } value2.DoubleValue = (num16 * 0.78125) - 100.0; return value2; case 10: if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } value2.DoubleValue = HexByteToInt(response.getDataByte(0)) * 3.0; if (bEnglishUnits) { value2.DoubleValue *= 0.145037738; } return value2; case 11: if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } value2.DoubleValue = HexByteToInt(response.getDataByte(0)); if (bEnglishUnits) { value2.DoubleValue *= 0.145037738; } return value2; case 12: { if (response.getDataByteCount() < 2) { value2.ErrorDetected = true; return value2; } int num66 = HexByteToInt(response.getDataByte(0)); int num65 = HexByteToInt(response.getDataByte(1)); value2.DoubleValue = ((num66 * 0x100) + num65) * 0.25; return value2; } case 13: { if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } int num64 = HexByteToInt(response.getDataByte(0)); value2.DoubleValue = num64; if (bEnglishUnits) { value2.DoubleValue *= 0.621371192; } return value2; } case 14: { if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } double num63 = HexByteToInt(response.getDataByte(0)); value2.DoubleValue = (num63 * 0.5) - 64.0; return value2; } case 15: if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } value2.DoubleValue = HexByteToInt(response.getDataByte(0)) - 40.0; if (bEnglishUnits) { value2.DoubleValue = (value2.DoubleValue * 1.8) + 32.0; } return value2; case 0x10: { if (response.getDataByteCount() < 2) { value2.ErrorDetected = true; return value2; } double num62 = HexByteToInt(response.getDataByte(0)); double num61 = HexByteToInt(response.getDataByte(1)); value2.DoubleValue = ((num62 * 256.0) + num61) * 0.01; if (bEnglishUnits) { value2.DoubleValue *= 0.13227735731092655; } return value2; } case 0x11: { if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } double num60 = HexByteToInt(response.getDataByte(0)); value2.DoubleValue = num60 * 0.39215686274509803; return value2; } case 0x12: { if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } int num13 = HexByteToInt(response.getDataByte(0)); if ((num13 & 1) != 0) { value2.StringValue = "Upstream of first catalytic converter."; value2.ShortStringValue = "UPS"; return value2; } if ((num13 & 2) != 0) { value2.StringValue = "Downstream of first catalytic converter inlet."; value2.ShortStringValue = "DNS"; return value2; } if ((num13 & 4) != 0) { value2.StringValue = "Atmosphere / Off"; value2.ShortStringValue = "OFF"; } return value2; } case 0x13: { if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } int num4 = HexByteToInt(response.getDataByte(0)); switch (param.SubParameter) { case 0: if ((num4 & 1) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 1: if ((num4 & 2) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 2: if ((num4 & 4) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 3: if ((num4 & 8) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 4: if ((num4 & 0x10) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 5: if ((num4 & 0x20) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 6: if ((num4 & 0x40) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 7: if ((num4 & 0x80) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; } goto Label_1A00; } case 20: case 0x15: case 0x16: case 0x17: case 0x18: case 0x19: case 0x1a: case 0x1b: goto Label_1A00; case 0x1c: if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } switch (HexByteToInt(response.getDataByte(0))) { case 1: value2.StringValue = "OBD II (California ARB)"; value2.ShortStringValue = "OBDII CARB"; return value2; case 2: value2.StringValue = "OBD (Federal EPA)"; value2.ShortStringValue = "OBD (Fed)"; return value2; case 3: value2.StringValue = "OBD and OBD II"; value2.ShortStringValue = "OBD/OBDII"; return value2; case 4: value2.StringValue = "OBD I"; value2.ShortStringValue = "OBDI"; return value2; case 5: value2.StringValue = "Not OBD Compliant"; value2.ShortStringValue = "NO OBD"; return value2; case 6: value2.StringValue = "EOBD"; value2.ShortStringValue = "EOBD"; return value2; case 7: value2.StringValue = "EOBD and OBD II"; value2.ShortStringValue = "EOBD/OBDII"; return value2; case 8: value2.StringValue = "EOBD and OBD"; value2.ShortStringValue = "EOBD/OBD"; return value2; case 9: value2.StringValue = "EOBD, OBD and OBD II"; value2.ShortStringValue = "EOBD/OBD/OBDII"; return value2; case 10: value2.StringValue = "JOBD"; value2.ShortStringValue = "JOBD"; return value2; case 11: value2.StringValue = "JOBD and OBD II"; value2.ShortStringValue = "JOBD/OBDII"; return value2; case 12: value2.StringValue = "JOBD and EOBD"; value2.ShortStringValue = "JOBD/EOBD"; return value2; case 13: value2.StringValue = "JOBD, EOBD, and OBD II"; value2.ShortStringValue = "JOBD/EOBD/OBDII"; return value2; } return value2; case 0x1d: { if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } int num3 = HexByteToInt(response.getDataByte(0)); switch (param.SubParameter) { case 0: if ((num3 & 1) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 1: if ((num3 & 2) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 2: if ((num3 & 4) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 3: if ((num3 & 8) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 4: if ((num3 & 0x10) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 5: if ((num3 & 0x20) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 6: if ((num3 & 0x40) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 7: if ((num3 & 0x80) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; } goto Label_20B7; } case 30: goto Label_20B7; case 0x1f: { if (response.getDataByteCount() < 2) { value2.ErrorDetected = true; return value2; } double num58 = HexByteToInt(response.getDataByte(0)); double num57 = HexByteToInt(response.getDataByte(1)); value2.DoubleValue = (num58 * 256.0) + num57; return value2; } case 0x21: { if (response.getDataByteCount() < 2) { value2.ErrorDetected = true; return value2; } double num56 = HexByteToInt(response.getDataByte(0)); double num55 = HexByteToInt(response.getDataByte(1)); value2.DoubleValue = (num56 * 256.0) + num55; if (bEnglishUnits) { value2.DoubleValue *= 0.621371192; } return value2; } case 0x22: { if (response.getDataByteCount() < 2) { value2.ErrorDetected = true; return value2; } double num54 = HexByteToInt(response.getDataByte(0)); double num53 = HexByteToInt(response.getDataByte(1)); value2.DoubleValue = (((num54 * 256.0) + num53) * 10.0) * 0.0078125; if (bEnglishUnits) { value2.DoubleValue *= 0.145037738; } return value2; } case 0x23: { if (response.getDataByteCount() < 2) { value2.ErrorDetected = true; return value2; } double num52 = HexByteToInt(response.getDataByte(0)); double num51 = HexByteToInt(response.getDataByte(1)); value2.DoubleValue = (((num52 * 256.0) + num51) * 10.0) * 0.0078125; if (bEnglishUnits) { value2.DoubleValue *= 0.145037738; } return value2; } case 0x24: case 0x25: case 0x26: case 0x27: case 40: case 0x29: case 0x2a: case 0x2b: { if (response.getDataByteCount() < 4) { value2.ErrorDetected = true; return value2; } if (param.SubParameter == 0) { double num50 = HexByteToInt(response.getDataByte(0)); double num49 = HexByteToInt(response.getDataByte(1)); value2.DoubleValue = ((num50 * 256.0) + num49) * 3.0517578125E-05; return value2; } double num48 = HexByteToInt(response.getDataByte(2)); double num47 = HexByteToInt(response.getDataByte(3)); value2.DoubleValue = ((num48 * 256.0) + num47) * 0.0001220703125; return value2; } case 0x2c: { if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } double num46 = HexByteToInt(response.getDataByte(0)); value2.DoubleValue = (num46 * 100.0) * 0.00392156862745098; return value2; } case 0x2d: { if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } double num45 = HexByteToInt(response.getDataByte(0)); value2.DoubleValue = (num45 - 128.0) * 0.78125; return value2; } case 0x2e: { if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } double num44 = HexByteToInt(response.getDataByte(0)); value2.DoubleValue = (num44 * 100.0) * 0.00392156862745098; return value2; } case 0x2f: { if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } double num43 = HexByteToInt(response.getDataByte(0)); value2.DoubleValue = (num43 * 100.0) * 0.00392156862745098; return value2; } case 0x30: { if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } double num42 = HexByteToInt(response.getDataByte(0)); value2.DoubleValue = num42; return value2; } case 0x31: { if (response.getDataByteCount() < 2) { value2.ErrorDetected = true; return value2; } double num41 = HexByteToInt(response.getDataByte(0)); double num40 = HexByteToInt(response.getDataByte(1)); value2.DoubleValue = (num41 * 256.0) + num40; if (bEnglishUnits) { value2.DoubleValue *= 0.621371192; } return value2; } case 50: { if (response.getDataByteCount() < 2) { value2.ErrorDetected = true; return value2; } double num11 = HexByteToInt(response.getDataByte(0)); double num39 = HexByteToInt(response.getDataByte(1)); if (num11 > 127.0) { num11 = (num11 - 128.0) * -1.0; } value2.DoubleValue = ((num11 * 256.0) + num39) * 0.25; if (bEnglishUnits) { value2.DoubleValue *= 0.000145037738; } return value2; } case 0x33: { if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } double num38 = HexByteToInt(response.getDataByte(0)); value2.DoubleValue = num38; if (bEnglishUnits) { value2.DoubleValue *= 0.145037738; } return value2; } case 0x34: case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: case 0x3a: case 0x3b: { if (response.getDataByteCount() < 4) { value2.ErrorDetected = true; return value2; } if (param.SubParameter == 0) { double num37 = HexByteToInt(response.getDataByte(0)); double num36 = HexByteToInt(response.getDataByte(1)); value2.DoubleValue = ((num37 * 256.0) + num36) * 3.0517578125E-05; return value2; } double num35 = HexByteToInt(response.getDataByte(2)); double num34 = HexByteToInt(response.getDataByte(3)); value2.DoubleValue = (((num35 * 256.0) + num34) * 0.00390625) - 128.0; return value2; } case 60: case 0x3d: case 0x3e: case 0x3f: { if (response.getDataByteCount() < 2) { value2.ErrorDetected = true; return value2; } double num33 = HexByteToInt(response.getDataByte(0)); double num32 = HexByteToInt(response.getDataByte(1)); value2.DoubleValue = (((num33 * 256.0) + num32) * 0.1) - 40.0; if (bEnglishUnits) { value2.DoubleValue = (value2.DoubleValue * 1.8) + 32.0; } return value2; } case 0x41: if (response.getDataByteCount() < 4) { value2.ErrorDetected = true; return value2; } switch (param.SubParameter) { case 0: if ((HexByteToInt(response.getDataByte(1)) & 1) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 1: if ((HexByteToInt(response.getDataByte(1)) & 2) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 2: if ((HexByteToInt(response.getDataByte(1)) & 4) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 3: if ((HexByteToInt(response.getDataByte(1)) & 0x10) == 0) { value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; } value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; case 4: if ((HexByteToInt(response.getDataByte(1)) & 0x20) == 0) { value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; } value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; case 5: if ((HexByteToInt(response.getDataByte(1)) & 0x40) == 0) { value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; } value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; case 6: if ((HexByteToInt(response.getDataByte(2)) & 1) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 7: if ((HexByteToInt(response.getDataByte(2)) & 2) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 8: if ((HexByteToInt(response.getDataByte(2)) & 4) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 9: if ((HexByteToInt(response.getDataByte(2)) & 8) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 10: if ((HexByteToInt(response.getDataByte(2)) & 0x10) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 11: if ((HexByteToInt(response.getDataByte(2)) & 0x20) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 12: if ((HexByteToInt(response.getDataByte(2)) & 0x40) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 13: if ((HexByteToInt(response.getDataByte(2)) & 0x80) == 0) { value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; case 14: if ((HexByteToInt(response.getDataByte(3)) & 1) == 0) { value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; } value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; case 15: if ((HexByteToInt(response.getDataByte(3)) & 2) == 0) { value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; } value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; case 0x10: if ((HexByteToInt(response.getDataByte(3)) & 4) == 0) { value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; } value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; case 0x11: if ((HexByteToInt(response.getDataByte(3)) & 8) == 0) { value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; } value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; case 0x12: if ((HexByteToInt(response.getDataByte(3)) & 0x10) == 0) { value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; } value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; case 0x13: if ((HexByteToInt(response.getDataByte(3)) & 0x20) == 0) { value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; } value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; case 20: if ((HexByteToInt(response.getDataByte(3)) & 0x40) == 0) { value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; } value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; case 0x15: if ((HexByteToInt(response.getDataByte(3)) & 0x80) == 0) { value2.BoolValue = true; value2.DoubleValue = 1.0; value2.StringValue = "YES"; value2.ShortStringValue = "YES"; return value2; } value2.BoolValue = false; value2.DoubleValue = 0.0; value2.StringValue = "NO"; value2.ShortStringValue = "NO"; return value2; } goto Label_32A8; case 0x42: goto Label_32A8; case 0x43: { if (response.getDataByteCount() < 2) { value2.ErrorDetected = true; return value2; } double num29 = HexByteToInt(response.getDataByte(0)); double num28 = HexByteToInt(response.getDataByte(1)); value2.DoubleValue = ((num29 * 256.0) + num28) * 0.39215686274509803; return value2; } case 0x44: { if (response.getDataByteCount() < 2) { value2.ErrorDetected = true; return value2; } double num27 = HexByteToInt(response.getDataByte(0)); double num26 = HexByteToInt(response.getDataByte(1)); value2.DoubleValue = ((num27 * 256.0) + num26) * 3.0517578125E-05; return value2; } case 0x45: { if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } double num25 = HexByteToInt(response.getDataByte(0)); value2.DoubleValue = (num25 * 100.0) * 0.00392156862745098; return value2; } case 70: { if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } double num24 = HexByteToInt(response.getDataByte(0)); value2.DoubleValue = num24 - 40.0; if (bEnglishUnits) { value2.DoubleValue = (value2.DoubleValue * 1.8) + 32.0; } return value2; } case 0x47: case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: { if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } double num23 = HexByteToInt(response.getDataByte(0)); value2.DoubleValue = (num23 * 100.0) * 0.00392156862745098; return value2; } case 0x4d: case 0x4e: { if (response.getDataByteCount() < 2) { value2.ErrorDetected = true; return value2; } double num22 = HexByteToInt(response.getDataByte(0)); double num21 = HexByteToInt(response.getDataByte(1)); value2.DoubleValue = (num22 * 256.0) + num21; return value2; } case 0x51: if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } switch (HexByteToInt(response.getDataByte(0))) { case 1: value2.StringValue = "Gasoline"; break; case 2: value2.StringValue = "Methanol"; break; case 3: value2.StringValue = "Ethanol"; break; case 4: value2.StringValue = "Diesel"; break; case 5: value2.StringValue = "LPG"; break; case 6: value2.StringValue = "CNG"; break; case 7: value2.StringValue = "Propane"; break; case 8: value2.StringValue = "Electric"; break; case 9: value2.StringValue = "Bifuel running Gasoline"; break; case 10: value2.StringValue = "Bifuel running Methanol"; break; case 11: value2.StringValue = "Bifuel running Ethanol"; break; case 12: value2.StringValue = "Bifuel running LPG"; break; case 13: value2.StringValue = "Bifuel running CNG"; break; case 14: value2.StringValue = "Bifuel running Propane"; break; case 15: value2.StringValue = "Bifuel running Electric"; break; case 16: value2.StringValue = "Bifuel mixed Gas/Electric"; break; case 17: value2.StringValue = "Hybrid Gasoline"; break; case 18: value2.StringValue = "Hybrid Ethanol"; break; case 19: value2.StringValue = "Hybrid Diesel"; break; case 20: value2.StringValue = "Hybrid Electric"; break; case 21: value2.StringValue = "Hybrid Mixed Fuel"; break; case 22: value2.StringValue = "Hybrid Regenerative"; break; } value2.ShortStringValue = value2.StringValue; return value2; case 0x52: { if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } double num20 = HexByteToInt(response.getDataByte(0)); value2.DoubleValue = (num20 * 100.0) * 0.00392156862745098; return value2; } } goto Label_379A; case 3: case 7: case 10: goto Label_379A; case 5: { int parameter = param.Parameter; if ((parameter <= 0) || (parameter > 10)) { goto Label_38E3; } if (param.SubParameter != 0) { if (param.SubParameter == 1) { if (response.getDataByteCount() < 2) { value2.ErrorDetected = true; return value2; } int num18 = HexByteToInt(response.getDataByte(1)); value2.DoubleValue = num18 * 0.005; return value2; } if (param.SubParameter == 2) { if (response.getDataByteCount() < 3) { value2.ErrorDetected = true; return value2; } int num17 = HexByteToInt(response.getDataByte(2)); value2.DoubleValue = num17 * 0.005; return value2; } value2.ErrorDetected = true; return value2; } if (response.getDataByteCount() >= 1) { int num19 = HexByteToInt(response.getDataByte(0)); value2.DoubleValue = num19 * 0.005; return value2; } value2.ErrorDetected = true; return value2; } case 9: goto Label_38E3; } goto Label_390C; Label_10DD: if (response.getDataByteCount() < 2) { value2.ErrorDetected = true; return value2; } value2.StringValue = OBD2.getDTCName(response.Data); return value2; Label_1A00: if (response.getDataByteCount() < 2) { value2.ErrorDetected = true; return value2; } if (param.SubParameter == 0) { double num59 = HexByteToInt(response.getDataByte(0)); value2.DoubleValue = num59 * 0.005; return value2; } double num15 = HexByteToInt(response.getDataByte(1)); if (num15 == 255.0) { value2.DoubleValue = 0.0; return value2; } value2.DoubleValue = (num15 - 128.0) * 0.78125; return value2; Label_20B7: if (response.getDataByteCount() < 1) { value2.ErrorDetected = true; return value2; } if ((HexByteToInt(response.getDataByte(0)) & 1) != 0) { value2.DoubleValue = 1.0; value2.BoolValue = true; value2.StringValue = "ON"; value2.ShortStringValue = "ON"; return value2; } value2.DoubleValue = 0.0; value2.BoolValue = false; value2.StringValue = "OFF"; value2.ShortStringValue = "OFF"; return value2; Label_32A8: if (response.getDataByteCount() < 2) { value2.ErrorDetected = true; return value2; } double num31 = HexByteToInt(response.getDataByte(0)); double num30 = HexByteToInt(response.getDataByte(1)); value2.DoubleValue = ((num31 * 256.0) + num30) * 0.001; return value2; Label_379A: strings = new StringCollection(); int startIndex = 0; if (4 <= response.Data.Length) { do { string str = OBD2.getDTCName(response.Data.Substring(startIndex, 4)); if (str.CompareTo("P0000") != 0) { strings.Add(str); } startIndex += 4; } while ((startIndex + 4) <= response.Data.Length); } value2.StringCollectionValue = strings; return value2; Label_38E3: if (param.Parameter == 2) { value2.StringValue = HexStringToASCIIString(response.Data); value2.ShortStringValue = value2.StringValue; return value2; } Label_390C: value2.ErrorDetected = true; return value2; }