دالة CompareKey [SWS_DM_00765] Upstream: RS_AP_00138, RS_Diag_04005, RS_Diag_04170, RS_AP_00119
virtual ara::core::Future< KeyCompareResultType > CompareKey (ara::core::Span< const std::uint8_t > key, const MetaInfo &metaInfo, CancellationHandler cancellationHandler) noexcept=0;
This method is called, when a diagnostic request has been finished, to notify about the outcome.
الاستخدام
يتم تنفيذ الدالة الافتراضية الصرفة CompareKey من الفئة ara::diag::SecurityAccess [SWS_DM_00765] من جانب التطبيق للتحقق من صحة المفتاح المُرسل من العميل في خدمة UDS ذات المعرف 0x27 (SecurityAccess) SWS Diagnostics §7.3.2.8.9 «Service 0x27 – SecurityAccess». وتشكل بالاشتراك مع GetSeed الأساس لآلية Seed-Key الثابتة وفقاً للمواصفة ISO 14229-1 [SWS_DM_00863].
تشمل معاملات الدالة ما يلي:
key:ara::core::Span<const std::uint8_t>يشير إلى بيانات المفتاح المراد التحقق منها. ويظل المخزن المؤقت صالحاً حتى يتم استيفاء الـ Promise المقترن أو إلغاء المعالجة عبرcancellationHandler[SWS_DM_00765].metaInfo: معلومات وصفية لطلب التشخيص الوارد [SWS_DM_00765].cancellationHandler: يتيح الاستعلام عن الإلغاء عبرcancellationHandler.IsCanceledوكذلك تسجيل دالة إشعار عبرcancellationHandler.SetNotifierعند إلغاء المحادثة [SWS_DM_00765].
تتوفر نتيجة التحقق بشكل غير متزامن عبر ara::core::Future<KeyCompareResultType> [SWS_DM_00765].
معالجة الأخطاء والتفاعل
في حال فشل مطابقة المفتاح أو حدوث خطأ أثناء المعالجة، يجب تمرير Negative Response Code (NRC) مناسب وفقاً للمواصفة ISO 14229-1 عبر الـ Future باستخدام DiagUdsNrcErrc [SWS_DM_00765]. وإذا لم تكن الوظيفة الفرعية المطلوبة مُهيأة لـ CompareKey، فسيتم الرد على الطلب باستخدام NRC 0x12 (kSubFunctionNotSupported) [SWS_DM_00363]. ويقوم خادم التشخيص بعدّ المحاولات الفاشلة [SWS_DM_00270] ومقارنتها بقيم العتبة [SWS_DM_00271].
إذا تم منح وصول الأمان بنجاح، يقوم الخادم بتحديث مستوى الأمان داخلياً [SWS_DM_00846]، وإعادة تعيين عداد المحاولات الفاشلة [SWS_DM_00270]، وإبلاغ حدث الأمان SEV_UDS_SECURITY_ACCESS_SUCCESSFUL إلى IdsM [SWS_DM_02019].
التزامن والقيود
تم التصريح عن الواجهة كـ noexcept وهي آمنة من الاستثناءات (exception safe) [SWS_DM_00765]. وأمان الخيوط مشروط (conditional): حيث يتم تحديد ما إذا كان يجب أن يكون التنفيذ آمناً بالنسبة للخيوط عبر ConcurrencyType المُمرَّر في منشئ SecurityAccess [SWS_DM_00765].
تم إنشاء ملاحظة الاستخدام هذه بواسطة ذكاء اصطناعي بناءً على مواصفة AUTOSAR.
دليل المنفِّذ قيد الإعداد (التعقيد I2)
| Header-Datei | #include "ara/diag/security_access.h" |
|---|---|
| Scope | class ara::diag::SecurityAccess |
| Exception-Sicherheit | exception safe |
| Thread-Sicherheit | conditional whether the function has to be implemented thread safe or non-thread safe is determined by the ConcurrencyType given in the constructor |
Parameter (in)
| Parameter | Beschreibung |
|---|---|
| key | The key to be validated. Lifetime: Valid until Promise is fulfilled or the processing is cancelled by the cancellationHandler. |
| metaInfo | MetaInfo of the request. |
| cancellationHandler | This parameter is used to • Query the current cancellation status by calling cancellationHandler.IsCanceled. Returns TRUE in case, the current conversation has been cancelled and FALSE otherwise. • Register a notifier function by calling cancellationHandler.SetNotifier. The registered notifier is called if the current conversation is cancelled. |
Rückgabewert
| Typ | Beschreibung |
|---|---|
| ara::core::Future< KeyCompareResultType > | Result of the key validation. |
Fehler
| Fehlercode | Beschreibung |
|---|---|
| Please use an applicable NRC, as defined in ISO 14229-1, using DiagUdsNrcErrc. | |
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/SWS_DM_00765- Status
- valid/unmigrated
- Version
AUTOSAR/AP/record/SWS_DM_00765@rel:R25-11#99113824- Content hash
99113824- Source
- https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00765
Status: valid/unmigrated
Version: rel:R25-11#fcff65aa
Versionshistorie & Revisions (1 transition, 8 revision)
- Current State
valid/unmigrated- Reason
- mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
- Campaign
2026-08-13-status-backfill- Active Version
AUTOSAR/AP/record/SWS_DM_00765@rel:R25-11#fcff65aa
Recorded Revisions (8):
- R25-11
rel:R25-11#d4d3823f2026-09-30 - R19-11
rel:R19-11#4bf18d9e2026-10-14 - R20-11
rel:R20-11#52ff58612026-10-14 - R21-11
rel:R21-11#42d7f4462026-10-14 - R22-11
rel:R22-11#94736e912026-10-14 - R23-11
rel:R23-11#cbc123ea2026-10-14 - R24-11
rel:R24-11#e09a76d52026-10-14 - R25-11
rel:R25-11#fcff65aa2026-10-14 active
Requirement Text as-of this release:
Curation Decisions:
Reachable Artifacts & Dependents:
| Date | Actor | Transition | Reason / Rationale | Campaign |
|---|---|---|---|---|
| 2026-08-13 | tool | none → valid/unmigrated | mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record | 2026-08-13-status-backfill |
gemini-3.8-flash-low· 2026-10-13 · الأصل الألماني