bool AssignDataToRequest() { try { //first check the validity of the values byte specialSettings; specialSettings = System.Convert.ToByte(txtSpecialSettings.Text); if (specialSettings < 0 || specialSettings > 255) { lCOMStatus.Text = "Invalid Parameter for \"Special Settings\": Please give a value between 0 to 255!"; lCOMStatus.BackColor = System.Drawing.Color.Red; txtSpecialSettings.Select(); return(false); } mVCSpecial = specialSettings; mRequestWriteVariantCoding.SetParameter("Codingstring.CountryType", mVCCountryType); mRequestWriteVariantCoding.SetParameter("Codingstring.VehicleType", mVCVehicleType); mRequestWriteVariantCoding.SetParameter("Codingstring.SpecialAdjustment", mVCSpecial); return(true); } catch { lCOMStatus.Text = "Invalid Parameters!"; lCOMStatus.BackColor = System.Drawing.Color.Red; return(false); } }
void SendSendKeyRequest(long aKey) { mRequestSendKey = GetRequest(mSendKeyRequestString, mECUName, mBusName); if (mRequestSendKey != null) { mRequestSendKey.OnResponse += new Diagnostic._IDiagnosticRequestEvents_OnResponseEventHandler(RequestSendKey_OnResponse); mRequestSendKey.OnTimeout += new Diagnostic._IDiagnosticRequestEvents_OnTimeoutEventHandler(RequestSendKey_OnTimeout); mRequestSendKey.SetParameter("SecurityKey", aKey); mRequestSendKey.Send(true); } }