Exemple #1
0
        private void RequestSeedRequest_OnResponse(Object response)
        {
            Diagnostic.DiagnosticResponse res = (Diagnostic.DiagnosticResponse)response;

            MethodInvoker LabelUpdate = delegate
            {
                lCOMStatus.Text      = "Request Seed Request: Response Received!";
                lCOMStatus.BackColor = System.Drawing.SystemColors.Control;

                if (res.Positive == true)
                {
                    long seed, key;

                    seed = System.Convert.ToInt32(res.GetParameter("SecuritySeed", Diagnostic.eValueType.cNumericValue));

                    key = CalculateKey(seed);
                    key = key & 65535;

                    lWriteStatus.Text = "Seed " + String.Format("{0:X2}", (uint)System.Convert.ToUInt32(seed.ToString())) + " key " + String.Format("{0:X2}", (uint)System.Convert.ToUInt32(key.ToString()));
                    SendSendKeyRequest(key);
                }
                else
                {
                    lWriteStatus.Text      = "Seed Request failed!";
                    lWriteStatus.BackColor = System.Drawing.Color.Red;
                }
            };

            Invoke(LabelUpdate);
        }
Exemple #2
0
        private void RequestWriteVariantCoding_OnResponse(Object response)
        {
            Diagnostic.DiagnosticResponse res = (Diagnostic.DiagnosticResponse)response;

            MethodInvoker LabelUpdate = delegate
            {
                lCOMStatus.Text      = "Request Write Variant Coding Data: Response Received!";
                lCOMStatus.BackColor = System.Drawing.SystemColors.Control;

                if (res.Positive == true)
                {
                    lWriteStatus.Text      = "Writing succeeded!";
                    lWriteStatus.BackColor = System.Drawing.Color.Lime;
                }
                else
                {
                    lWriteStatus.Text      = "Writing failed!";
                    lWriteStatus.BackColor = System.Drawing.Color.Red;
                }
            };

            SendDefaultSessionRequest();

            Invoke(LabelUpdate);
        }
Exemple #3
0
        private void RequestReadVariantCoding_OnResponse(Object response)
        {
            Diagnostic.DiagnosticResponse res = (Diagnostic.DiagnosticResponse)response;

            MethodInvoker LabelUpdate = delegate
            {
                lCOMStatus.Text      = "Request Read Variant Coding Data: Response Received!";
                lCOMStatus.BackColor = System.Drawing.SystemColors.Control;

                if (res.Positive == true)
                {
                    // set country variant bits depending on what country name was received
                    mVCCountryType = System.Convert.ToByte(res.GetParameter("Codingstring.CountryType", Diagnostic.eValueType.cNumericValue));
                    // set vehicle type bits depending on what vehicle type was received
                    mVCVehicleType = System.Convert.ToByte(res.GetParameter("Codingstring.VehicleType", Diagnostic.eValueType.cNumericValue));
                    // set special settings bits
                    mVCSpecial = System.Convert.ToByte(res.GetParameter("Codingstring.SpecialAdjustment", Diagnostic.eValueType.cNumericValue));

                    //assign recieved data to the correspondending GUI Elements
                    AssignDataToGui();
                    lWriteStatus.Text      = "Reading succeeded!";
                    lWriteStatus.BackColor = System.Drawing.Color.Lime;
                }
                else
                {
                    lWriteStatus.Text      = "Request Programming Session failed!";
                    lWriteStatus.BackColor = System.Drawing.Color.Red;
                }
            };

            SendDefaultSessionRequest();

            Invoke(LabelUpdate);
        }
Exemple #4
0
        private void RequestExtendedSession_OnResponse(Object response)
        {
            Diagnostic.DiagnosticResponse res = (Diagnostic.DiagnosticResponse)response;

            MethodInvoker LabelUpdate = delegate
            {
                lCOMStatus.Text      = "Request Extended Session: Response Received!";
                lCOMStatus.BackColor = System.Drawing.SystemColors.Control;

                if (res.Positive == true)
                {
                    SendSeedRequestRequest();
                }
                else if (res.ResponseCode == 0x7E)
                {
                    ext_or_pro = 1;
                    PerformSecurityAccess();
                }
                else
                {
                    lWriteStatus.Text      = "Switching to extended session failed!";
                    lWriteStatus.BackColor = System.Drawing.Color.Red;
                }
            };

            Invoke(LabelUpdate);
        }
Exemple #5
0
        private void RequestDefaultSession_OnResponse(Object response)
        {
            Diagnostic.DiagnosticResponse res = (Diagnostic.DiagnosticResponse)response;

            MethodInvoker LabelUpdate = delegate
            {
                lCOMStatus.BackColor = System.Drawing.SystemColors.Control;

                if (res.Positive == true)
                {
                }
                else
                {
                    lWriteStatus.Text      = "Switching to default session failed!";
                    lWriteStatus.BackColor = System.Drawing.Color.Red;
                }
            };

            Invoke(LabelUpdate);
        }
Exemple #6
0
        private void RequestSendKey_OnResponse(Object response)
        {
            Diagnostic.DiagnosticResponse res = (Diagnostic.DiagnosticResponse)response;

            MethodInvoker LabelUpdate = delegate
            {
                lCOMStatus.Text      = "Request Send Key: Response Received!";
                lCOMStatus.BackColor = System.Drawing.SystemColors.Control;

                if (res.Positive == true)
                {
                    if (ext_or_pro == 0)
                    {
                        ext_or_pro = 1;
                        SendProgrammingSessionRequest();
                    }
                    else
                    {
                        ext_or_pro = 0;

                        if (read_or_write == 0)
                        {
                            SendReadVariantCodingRequest();
                        }
                        else
                        {
                            SendWriteVariantCodingRequest();
                        }
                    }
                }
                else
                {
                    lWriteStatus.Text      = "Send Key failed!";
                    lWriteStatus.BackColor = System.Drawing.Color.Red;
                    SendDefaultSessionRequest();
                }
            };

            Invoke(LabelUpdate);
        }
Exemple #7
0
        private void RequestProgrammingSession_OnResponse(Object response)
        {
            Diagnostic.DiagnosticResponse res = (Diagnostic.DiagnosticResponse)response;

            MethodInvoker LabelUpdate = delegate
            {
                lCOMStatus.Text      = "Request Programming Session: Response Received!";
                lCOMStatus.BackColor = System.Drawing.SystemColors.Control;

                if (res.Positive == true)
                {
                    PerformSecurityAccess();
                }
                else
                {
                    lWriteStatus.Text      = "Request Programming Session failed!";
                    lWriteStatus.BackColor = System.Drawing.Color.Red;
                }
            };

            Invoke(LabelUpdate);
        }