Ejemplo n.º 1
0
        public static int CompareS6xSignatureCateg(S6xSignature s6xSig1, S6xSignature s6xSig2)
        {
            if (s6xSig1 == null && s6xSig2 == null)
            {
                return(0);
            }
            if (s6xSig1 == null)
            {
                return(-1);
            }
            if (s6xSig2 == null)
            {
                return(1);
            }

            if ((s6xSig1.SignatureCategory == null || s6xSig1.SignatureCategory == string.Empty) && (s6xSig2.SignatureCategory == null || s6xSig2.SignatureCategory == string.Empty))
            {
                return(s6xSig1.UniqueKey.CompareTo(s6xSig2.UniqueKey));
            }
            if (s6xSig1.SignatureCategory == null || s6xSig1.SignatureCategory == string.Empty)
            {
                return(1);                                                                                  // Empty Categ appears at the end
            }
            if (s6xSig2.SignatureCategory == null || s6xSig2.SignatureCategory == string.Empty)
            {
                return(-1);                                                                                 // Empty Categ appears at the end
            }
            if (s6xSig1.SignatureCategory != s6xSig2.SignatureCategory)
            {
                return(s6xSig1.SignatureCategory.CompareTo(s6xSig2.SignatureCategory));
            }

            return(s6xSig1.UniqueKey.CompareTo(s6xSig2.UniqueKey));
        }
 public static void updateSignatureRoutineInternalStructureRow(ref SQLite806xDB db806x, ref SADS6x sadS6x, R_SAD806x_SignaturesRoutinesInternalStructures rRow, S6xSignature s6xObject, S6xRoutineInternalStructure s6xSubObject)
 {
     SQLite806xToolsSAD806xV10.updateSignatureRoutineInternalStructureRow(ref db806x, ref sadS6x, rRow, s6xObject, s6xSubObject);
 }
 public static object addSignatureRoutineInternalStructureRow(ref SQLite806xDB db806x, ref SADS6x sadS6x, ref List <R_SAD806x_SignaturesRoutinesInternalStructures> rList, S6xSignature s6xObject, S6xRoutineInternalStructure s6xSubObject)
 {
     return(SQLite806xToolsSAD806xV10.addSignatureRoutineInternalStructureRow(ref db806x, ref sadS6x, ref rList, s6xObject, s6xSubObject));
 }
 public static void updateSignatureRoutineInternalScalarBitFlagRow(ref SQLite806xDB db806x, ref SADS6x sadS6x, R_SAD806x_SignaturesRoutinesInternalScalarsBitFlags rRow, S6xSignature s6xObject, S6xRoutineInternalScalar s6xSubObject, S6xBitFlag s6xBitFlag)
 {
     SQLite806xToolsSAD806xV10.updateSignatureRoutineInternalScalarBitFlagRow(ref db806x, ref sadS6x, rRow, s6xObject, s6xSubObject, s6xBitFlag);
 }
 public static object addSignatureRoutineInputTableRows(ref SQLite806xDB db806x, ref SADS6x sadS6x, ref List <R_SAD806x_SignaturesRoutinesInputTables> rList, S6xSignature s6xObject)
 {
     return(SQLite806xToolsSAD806xV10.addSignatureRoutineInputTableRows(ref db806x, ref sadS6x, ref rList, s6xObject));
 }
Ejemplo n.º 6
0
        // Get Fixed Routines Definitions
        public static S6xSignature GetFixedRoutineSignatureTemplate(Fixed_Routines fixedRoutine)
        {
            S6xSignature oRes      = null;
            S6xStructure s6xStruct = null;

            switch (fixedRoutine)
            {
            case Fixed_Routines.CORE_REG_INIT_8065:
                oRes                    = new S6xSignature();
                oRes.for806x            = Signature806xOptions.for8065Only.ToString();
                oRes.ShortLabel         = "CORE_REG_INIT";
                oRes.Label              = "Core Registers Initialization";
                oRes.Comments           = "CORE_REG_INIT - Core Registers Initialization";
                oRes.InternalStructures = new S6xRoutineInternalStructure[2];

                s6xStruct = SADFixedStructures.GetFixedStructureTemplate(SADFixedStructures.FixedStructures.CORE_REG_INIT_ST1);
                oRes.InternalStructures[0] = new S6xRoutineInternalStructure();
                oRes.InternalStructures[0].VariableAddress = "#02##01#";
                oRes.InternalStructures[0].VariableBankNum = "1";               // To be updated by processing
                oRes.InternalStructures[0].ShortLabel      = s6xStruct.ShortLabel;
                oRes.InternalStructures[0].Label           = s6xStruct.Label;
                oRes.InternalStructures[0].Comments        = s6xStruct.Comments;
                oRes.InternalStructures[0].Number          = s6xStruct.Number;    // To be updated by processing
                oRes.InternalStructures[0].StructDef       = s6xStruct.StructDef; // To be updated by processing

                s6xStruct = SADFixedStructures.GetFixedStructureTemplate(SADFixedStructures.FixedStructures.CORE_REG_INIT_ST2);
                oRes.InternalStructures[1] = new S6xRoutineInternalStructure();
                oRes.InternalStructures[1].VariableAddress = "#04##03#";
                oRes.InternalStructures[1].VariableBankNum = "1";         // To be updated by processing
                oRes.InternalStructures[1].ShortLabel      = s6xStruct.ShortLabel;
                oRes.InternalStructures[1].Label           = s6xStruct.Label;
                oRes.InternalStructures[1].Comments        = s6xStruct.Comments;
                oRes.InternalStructures[1].Number          = s6xStruct.Number;    // To be updated by processing
                oRes.InternalStructures[1].StructDef       = s6xStruct.StructDef; // To be updated by processing

                s6xStruct = null;
                break;

            case Fixed_Routines.OBDII_REG_INIT:
                oRes            = new S6xSignature();
                oRes.ShortLabel = "OBDII_REG_INIT";
                oRes.Label      = "OBDII Registers Initialization";
                oRes.Comments   = "OBDII_REG_INIT - OBDII Registers Initialization";
                break;

            case Fixed_Routines.OBDII_REG_RESET:
                oRes            = new S6xSignature();
                oRes.ShortLabel = "OBDII_REG_RESET";
                oRes.Label      = "OBDII Registers Reset";
                oRes.Comments   = "OBDII_REG_RESET - OBDII Registers Reset";
                break;

            case Fixed_Routines.OBDII_REG_FLAGS:
                oRes            = new S6xSignature();
                oRes.ShortLabel = "OBDII_REG_FLAGS";
                oRes.Label      = "OBDII Registers Flags";
                oRes.Comments   = "OBDII_REG_FLAGS - OBDII Registers Flags";
                break;

            case Fixed_Routines.OBDI_COD_3D:
                oRes            = new S6xSignature();
                oRes.ShortLabel = "OBDI_CODES_3D";
                oRes.Label      = "OBDI Codes 3 Digits";
                oRes.Comments   = "OBDI_CODES_3D - OBDI Codes 3 Digits";
                break;

            case Fixed_Routines.OBDI_CNT_3D:
                oRes            = new S6xSignature();
                oRes.ShortLabel = "OBDI_COUNT_3D";
                oRes.Label      = "OBDI Count 3 Digits";
                oRes.Comments   = "OBDI_COUNT_3D - OBDI Count 3 Digits";
                break;

            case Fixed_Routines.OBDI_COD_2D:
                oRes            = new S6xSignature();
                oRes.ShortLabel = "OBDI_CODES_2D";
                oRes.Label      = "OBDI Codes 2 Digits";
                oRes.Comments   = "OBDI_CODES_2D - OBDI Codes 2 Digits";
                break;

            case Fixed_Routines.OBDI_TIM_2D:
                oRes            = new S6xSignature();
                oRes.ShortLabel = "OBDI_TIMINGS_2D";
                oRes.Label      = "OBDI Timings 2 Digits";
                oRes.Comments   = "OBDI_TIMINGS_3D - OBDI Timings 2 Digits";
                break;

            case Fixed_Routines.OBDI_MALFUNC:
                oRes                              = new S6xSignature();
                oRes.ShortLabel                   = "MALFUNC";
                oRes.Label                        = "Malfunction Routine";
                oRes.Comments                     = "MALFUNC - Malfunction Routine";
                oRes.Comments                    += "\r\n1st Param is OBD Error Code to be pushed.";
                oRes.InputArguments               = new S6xRoutineInputArgument[1];
                oRes.InputArguments[0]            = new S6xRoutineInputArgument();
                oRes.InputArguments[0].Position   = 1;
                oRes.InputArguments[0].UniqueKey  = string.Format("Ra{0:d3}", oRes.InputArguments[0].Position);
                oRes.InputArguments[0].Encryption = (int)CallArgsMode.Standard;
                oRes.InputArguments[0].Word       = true;
                oRes.InputArguments[0].Pointer    = false;
                break;

            case Fixed_Routines.OBDI_MALFUNC_LW:
                oRes                              = new S6xSignature();
                oRes.ShortLabel                   = "MALFUNC_LW";
                oRes.Label                        = "Malfunction Lower Routine";
                oRes.Comments                     = "MALFUNC_LW - Malfunction Lower Routine";
                oRes.Comments                    += "\r\n1st Param should be lower than 2nd value (scalar or register)";
                oRes.Comments                    += "\r\n2nd Param should be higher than 1st value (scalar or register)";
                oRes.Comments                    += "\r\n3rd Param is OBD Error Code to be pushed.";
                oRes.InputArguments               = new S6xRoutineInputArgument[3];
                oRes.InputArguments[0]            = new S6xRoutineInputArgument();
                oRes.InputArguments[0].Position   = 1;
                oRes.InputArguments[0].UniqueKey  = string.Format("Ra{0:d3}", oRes.InputArguments[0].Position);
                oRes.InputArguments[0].Encryption = (int)CallArgsMode.Mode3;
                oRes.InputArguments[0].Word       = true;
                oRes.InputArguments[0].Pointer    = true;
                oRes.InputArguments[1]            = new S6xRoutineInputArgument();
                oRes.InputArguments[1].Position   = 2;
                oRes.InputArguments[1].UniqueKey  = string.Format("Ra{0:d3}", oRes.InputArguments[1].Position);
                oRes.InputArguments[1].Encryption = (int)CallArgsMode.Mode3;
                oRes.InputArguments[1].Word       = true;
                oRes.InputArguments[1].Pointer    = true;
                oRes.InputArguments[2]            = new S6xRoutineInputArgument();
                oRes.InputArguments[2].Position   = 3;
                oRes.InputArguments[2].UniqueKey  = string.Format("Ra{0:d3}", oRes.InputArguments[2].Position);
                oRes.InputArguments[2].Encryption = (int)CallArgsMode.Standard;
                oRes.InputArguments[2].Word       = true;
                oRes.InputArguments[2].Pointer    = false;
                break;

            case Fixed_Routines.OBDI_MALFUNC_BT:
                oRes                              = new S6xSignature();
                oRes.ShortLabel                   = "MALFUNC_BT";
                oRes.Label                        = "Malfunction Between Routine";
                oRes.Comments                     = "MALFUNC_BT - Malfunction Between Routine";
                oRes.Comments                    += "\r\n1st Param should be between 2nd and 3rd values (scalar or register)";
                oRes.Comments                    += "\r\n2nd Param should be the lowest value for comparison (scalar or register)";
                oRes.Comments                    += "\r\n3rd Param should be the highest value for comparison (scalar or register)";
                oRes.Comments                    += "\r\n4th Param is OBD Error Code to be pushed.";
                oRes.InputArguments               = new S6xRoutineInputArgument[4];
                oRes.InputArguments[0]            = new S6xRoutineInputArgument();
                oRes.InputArguments[0].Position   = 1;
                oRes.InputArguments[0].UniqueKey  = string.Format("Ra{0:d3}", oRes.InputArguments[0].Position);
                oRes.InputArguments[0].Encryption = (int)CallArgsMode.Standard;
                oRes.InputArguments[0].Word       = true;
                oRes.InputArguments[0].Pointer    = true;
                oRes.InputArguments[1]            = new S6xRoutineInputArgument();
                oRes.InputArguments[1].Position   = 2;
                oRes.InputArguments[1].UniqueKey  = string.Format("Ra{0:d3}", oRes.InputArguments[1].Position);
                oRes.InputArguments[1].Encryption = (int)CallArgsMode.Mode3;
                oRes.InputArguments[1].Word       = true;
                oRes.InputArguments[1].Pointer    = true;
                oRes.InputArguments[2]            = new S6xRoutineInputArgument();
                oRes.InputArguments[2].Position   = 3;
                oRes.InputArguments[2].UniqueKey  = string.Format("Ra{0:d3}", oRes.InputArguments[2].Position);
                oRes.InputArguments[2].Encryption = (int)CallArgsMode.Mode3;
                oRes.InputArguments[2].Word       = true;
                oRes.InputArguments[2].Pointer    = true;
                oRes.InputArguments[3]            = new S6xRoutineInputArgument();
                oRes.InputArguments[3].Position   = 4;
                oRes.InputArguments[3].UniqueKey  = string.Format("Ra{0:d3}", oRes.InputArguments[3].Position);
                oRes.InputArguments[3].Encryption = (int)CallArgsMode.Standard;
                oRes.InputArguments[3].Word       = true;
                oRes.InputArguments[3].Pointer    = false;
                break;

            case Fixed_Routines.OBDI_MALFUNC_SB:
                oRes            = new S6xSignature();
                oRes.ShortLabel = "MALFUNC_SB";
                oRes.Label      = "Malfunction Sub Routine";
                oRes.Comments   = "MALFUNC_SB - Malfunction Sub Routine";
                oRes.Comments  += "\r\nUsed to push an OBD Error Code into a rolling error register.";
                break;

            case Fixed_Routines.OBDI_MALFUNC_EX:
                oRes                              = new S6xSignature();
                oRes.ShortLabel                   = "MALFUNC_EX";
                oRes.Label                        = "Malfunction Extended Routine";
                oRes.Comments                     = "MALFUNC_EX - Malfunction Extended Routine";
                oRes.Comments                    += "\r\n1st Param should be higher than 2nd and 3rd values (scalar or register)";
                oRes.Comments                    += "\r\n2nd Param should be the first lowest value for comparison (scalar or register)";
                oRes.Comments                    += "\r\n3rd Param should be the second lowest value for comparison (scalar or register)";
                oRes.Comments                    += "\r\n4th & 5th Params are OBD Error Code to be pushed.";
                oRes.InputArguments               = new S6xRoutineInputArgument[5];
                oRes.InputArguments[0]            = new S6xRoutineInputArgument();
                oRes.InputArguments[0].Position   = 1;
                oRes.InputArguments[0].UniqueKey  = string.Format("Ra{0:d3}", oRes.InputArguments[0].Position);
                oRes.InputArguments[0].Encryption = (int)CallArgsMode.Standard;
                oRes.InputArguments[0].Word       = true;
                oRes.InputArguments[0].Pointer    = true;
                oRes.InputArguments[1]            = new S6xRoutineInputArgument();
                oRes.InputArguments[1].Position   = 2;
                oRes.InputArguments[1].UniqueKey  = string.Format("Ra{0:d3}", oRes.InputArguments[1].Position);
                oRes.InputArguments[1].Encryption = (int)CallArgsMode.Mode3;
                oRes.InputArguments[1].Word       = true;
                oRes.InputArguments[1].Pointer    = true;
                oRes.InputArguments[2]            = new S6xRoutineInputArgument();
                oRes.InputArguments[2].Position   = 3;
                oRes.InputArguments[2].UniqueKey  = string.Format("Ra{0:d3}", oRes.InputArguments[2].Position);
                oRes.InputArguments[2].Encryption = (int)CallArgsMode.Mode3;
                oRes.InputArguments[2].Word       = true;
                oRes.InputArguments[2].Pointer    = true;
                oRes.InputArguments[3]            = new S6xRoutineInputArgument();
                oRes.InputArguments[3].Position   = 4;
                oRes.InputArguments[3].UniqueKey  = string.Format("Ra{0:d3}", oRes.InputArguments[3].Position);
                oRes.InputArguments[3].Encryption = (int)CallArgsMode.Standard;
                oRes.InputArguments[3].Word       = true;
                oRes.InputArguments[3].Pointer    = false;
                oRes.InputArguments[4]            = new S6xRoutineInputArgument();
                oRes.InputArguments[4].Position   = 5;
                oRes.InputArguments[4].UniqueKey  = string.Format("Ra{0:d3}", oRes.InputArguments[4].Position);
                oRes.InputArguments[4].Encryption = (int)CallArgsMode.Standard;
                oRes.InputArguments[4].Word       = true;
                oRes.InputArguments[4].Pointer    = false;
                break;

            case Fixed_Routines.OBDII_CLEAR_MALF:
                oRes                              = new S6xSignature();
                oRes.ShortLabel                   = "CLEAR_MALF";
                oRes.Label                        = "Clear Malfunction Routine";
                oRes.Comments                     = "CLEAR_MALF - Clear Malfunction Routine";
                oRes.Comments                    += "\r\n1st Param is OBD Error Code to be deleted.";
                oRes.InputArguments               = new S6xRoutineInputArgument[1];
                oRes.InputArguments[0]            = new S6xRoutineInputArgument();
                oRes.InputArguments[0].Position   = 1;
                oRes.InputArguments[0].UniqueKey  = string.Format("Ra{0:d3}", oRes.InputArguments[0].Position);
                oRes.InputArguments[0].Encryption = (int)CallArgsMode.Standard;
                oRes.InputArguments[0].Word       = true;
                oRes.InputArguments[0].Pointer    = false;
                break;

            case Fixed_Routines.OBDII_MALFUNCTION:
                oRes                              = new S6xSignature();
                oRes.ShortLabel                   = "MALFUNCTION";
                oRes.Label                        = "Malfunction Routine";
                oRes.Comments                     = "MALFUNCTION - Malfunction Routine";
                oRes.Comments                    += "\r\n1st Param is OBD Error Code to be pushed.";
                oRes.InputArguments               = new S6xRoutineInputArgument[1];
                oRes.InputArguments[0]            = new S6xRoutineInputArgument();
                oRes.InputArguments[0].Position   = 1;
                oRes.InputArguments[0].UniqueKey  = string.Format("Ra{0:d3}", oRes.InputArguments[0].Position);
                oRes.InputArguments[0].Encryption = (int)CallArgsMode.Standard;
                oRes.InputArguments[0].Word       = true;
                oRes.InputArguments[0].Pointer    = false;
                break;

            case Fixed_Routines.RPM_MNGT_8061_01:
            case Fixed_Routines.RPM_MNGT_8061_02:
                oRes            = new S6xSignature();
                oRes.ShortLabel = "RPM_MNGT";
                oRes.Label      = "RPM Management";
                oRes.for806x    = Signature806xOptions.for8061Only.ToString();
                oRes.Comments   = "RPM_MNGT - RPM Management";
                break;

            case Fixed_Routines.RPM_MNGT_8065_01:
            case Fixed_Routines.RPM_MNGT_8065_02:
            case Fixed_Routines.RPM_MNGT_8065_03:
                oRes            = new S6xSignature();
                oRes.ShortLabel = "RPM_MNGT";
                oRes.Label      = "RPM Management";
                oRes.for806x    = Signature806xOptions.for8065Only.ToString();
                oRes.Comments   = "RPM_MNGT - RPM Management";
                break;

            case Fixed_Routines.ECT_INIT_8061_01:
                oRes            = new S6xSignature();
                oRes.ShortLabel = "ECT_INIT";
                oRes.Label      = "ECT Initialization";
                oRes.for806x    = Signature806xOptions.for8061Only.ToString();
                oRes.Comments   = "ECT_INIT - ECT Initialization";
                break;

            case Fixed_Routines.ECT_INIT_8061_02:
                oRes            = new S6xSignature();
                oRes.ShortLabel = "BASE_INIT";
                oRes.Label      = "Base Initialization";
                oRes.for806x    = Signature806xOptions.for8061Only.ToString();
                oRes.Comments   = "BASE_INIT - Base Initialization";
                break;

            case Fixed_Routines.ECT_CLIP_8065_01:
            case Fixed_Routines.ECT_CLIP_8065_02:
                oRes            = new S6xSignature();
                oRes.ShortLabel = "ECT_CLIP";
                oRes.Label      = "ECT Clip";
                oRes.for806x    = Signature806xOptions.for8065Only.ToString();
                oRes.Comments   = "ECT_CLIP - ECT Clip";
                break;

            case Fixed_Routines.ECT_CLIPW_8065_02:
                oRes            = new S6xSignature();
                oRes.ShortLabel = "ECT_CLIPW";
                oRes.Label      = "ECT Clip W";
                oRes.for806x    = Signature806xOptions.for8065Only.ToString();
                oRes.Comments   = "ECT_CLIPW - ECT Clip W";
                break;

            case Fixed_Routines.CHT_CLIPW_8065_02:
                oRes            = new S6xSignature();
                oRes.ShortLabel = "CHT_CLIPW";
                oRes.Label      = "CHT Clip W";
                oRes.for806x    = Signature806xOptions.for8065Only.ToString();
                oRes.Comments   = "CHT_CLIPW - CHT Clip W";
                break;

            default:
                break;
            }

            return(oRes);
        }