コード例 #1
0
 public void ExecUserDiagJob(byte[] request, DiagService diagService)
 {
     Console.WriteLine($"\r\n{diagService.Qualifier}");
     byte[] response = SendMessage(request);
     foreach (List <DiagPreparation> wtf in diagService.OutputPreparations)
     {
         foreach (DiagPreparation outputPreparation in wtf)
         {
             //outputPreparation.PrintDebug();
             DiagPresentation presentation = outputPreparation.ParentECU.GlobalPresentations[outputPreparation.PresPoolIndex];
             // presentation.PrintDebug();
             Console.WriteLine($"{presentation.InterpretData(response, outputPreparation)}");
         }
     }
     // check if the response was an ECU seed
     if ((ConnectionProtocol?.SupportsUnlocking() ?? false) && (response.Length >= 2) && (response[0] == 0x67))
     {
         SecurityAutoLogin.ReceiveSecurityResponse(response, diagService.ParentECU, this);
     }
 }
コード例 #2
0
 // this is normally not exposed to the user, the button has to be manually enabled in the Designer
 private void genericDebugToolStripMenuItem_Click(object sender, EventArgs e)
 {
     foreach (CaesarContainer container in Containers)
     {
         foreach (ECU ecu in container.CaesarECUs)
         {
             foreach (DiagService ds in ecu.GlobalDiagServices)
             {
                 if (ds.Qualifier != "DT_Istgang")
                 {
                     //continue;
                 }
                 foreach (List <DiagPreparation> dpl in ds.OutputPreparations)
                 {
                     foreach (DiagPreparation prep in dpl)
                     {
                         DiagPresentation pres = ecu.GlobalPresentations[prep.PresPoolIndex];
                         if (pres.EnumMaxValue == 0)
                         {
                             continue;
                         }
                         foreach (Scale scale in pres.Scales)
                         {
                             if (scale.EnumUpBound >= 0)
                             {
                                 string presOut = pres.InterpretData(BitUtility.BytesFromHex("0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B"), prep);
                                 Console.WriteLine($"{ds.Qualifier} : {prep.Qualifier} @ {presOut} = {pres.Unk1b}, {pres.EnumMaxValue}");
                             }
                         }
                         if (pres.Qualifier == "PRES_ZIELGANG")
                         {
                             pres.PrintDebug();
                         }
                     }
                 }
             }
         }
     }
     Console.WriteLine("done");
 }