Teşhisler

SDV platformu, OEM tarafından sağlanan Diagnostics Manager ile SDV hizmet paketleri arasında kullanılacak bir dizi API'nin yanı sıra OEM'in teşhis kullanım alanlarını desteklemek için yardımcı programlar ve genel platform özellikleri sunar. Teşhis yığını, tüm otomotiv işletim sistemlerinin temel bir bileşeni olduğundan teşhisler, OEM'lere sunduğumuz SDV çalışmaları, otomotiv hizmetleri ve teknolojileri için çok önemlidir.

OEM'ler, sistemdeki SDV hizmet paketleriyle iletişim kurarak teşhis istemcilerinden gelen istekleri işlemek için Teşhis Yöneticisi örnekleri (genellikle ECU başına bir veya VM başına bir) dağıtır. SDV, bunu yapmak için bir dizi standart teşhis API'si, yardımcı program ve OEM teşhis kullanım alanları için genel platform desteği sağlar. Hedefimiz:

  • OEM'lerin, Teşhis Yöneticisi'ni UDS standardına göre uygulamasına olanak tanır.
  • Teşhis Yöneticisi'nin, test kullanıcılarının isteklerini SDV hizmet paketlerine yönlendirmesine izin verin.
  • SDV hizmet paketlerinin, teşhis verilerini araca özgü olmayan bir şekilde kullanıma sunmasına izin verin.

SDV, bunu sağlamak için SDV hizmet paketleri (üçüncü taraflarca sağlanabilir) ile OEM'nin teşhis yığını uygulaması arasındaki etkileşimleri standartlaştırmak üzere bir dizi API sunar.

Teşhis yığını

Şekil 1. Teşhis yığını.

SDV hizmet paketleri, teşhis verilerini ve öğelerini kullanıma sunabilir, teşhis işlevini uygulayabilir ve arızaları Teşhis Yöneticisi'ne bildirebilir.

SDV genelinde standart bir teşhis API'si sağlayarak SDV hizmet paketlerinin uygulanmasını basitleştiririz. Böylece, farklı OEM'lerin farklı araçlarında çalışacak teşhisleri yeniden uygulamaya gerek kalmaz.

Diagnostics Services API

SDV Diagnostics API, belirli UDS (ISO 14229-1) hizmetlerine karşılık gelen aşağıdaki hizmetleri tanımlar:

  • service AuthenticationService: 0x29 (Kimlik doğrulama). İstemcinin, kısıtlanmış verilere veya hizmetlere erişmek için kimliğini kanıtlamasına olanak tanıyan bir mekanizma sağlar.
  • service DataItemService: 0x22 (ReadDataByIdentifier) ve 0x2E (WriteDataByIdentifier). DID'ler tarafından tanımlanan veri öğelerinin okunmasına ve yazılmasına izin verir.
  • service EcuResetService: 0x11 (ECUReset). Test kullanıcısının ECU'nun sıfırlanmasını istemesine olanak tanır.
  • service FileTransferService: 0x34 (RequestDownload), 0x35 (RequestUpload), 0x36 (TransferData), 0x37 (RequestTransferExit) ve 0x38 (RequestFileTransfer). Dosya indirme ve yükleme işlemlerinin başlatılmasını ve işlenmesini sağlar.
  • service IoControlService: 0x2F (InputOutputControlByIdentifier). Harici test kullanıcılarının, test amacıyla sistemin giriş ve çıkışlarını kontrol etmesine olanak tanır.
  • service RoutineControlService: 0x31 (RoutineControl). Bu araç, test uzmanının SDV hizmetleri tarafından uygulanan belirli rutinleri (işlevler) başlatmasına, durdurmasına ve sonuçlarını istemesine olanak tanır.
  • service SecurityAccessService: 0x27 (SecurityAccess). Belirli güvenlik seviyelerinin kilidini açmak için gereken başlangıç ve anahtar değişimini yönetir.

SDV Diagnostics API, AUTOSAR'ın Diagnostic Event Manager'ına (AUTOSAR_SWS_DiagnosticEventManager) göre service FaultListenerService ve message Event tanımlar. Bu, uygulamaların teşhis etkinliklerini ve arızaları bildirmesini sağlar.

Ayrıca service DiagnosticsManagerService, diğer hizmetlerin mevcut teşhis bağlantısı parametrelerini (kaynak adresi, hedef adresi) ve oturum türünü sorgulamasına olanak tanıyan bir SDV platform hizmeti tanımlar.

Hizmet Paketi Geliştirici Kılavuzu

Bir hizmet paketi geliştiricisi olarak diagnostics_declaration ve aşağıdaki sunucular, ilgili .vsidl dosyasında tanımlanabilir:

service_bundle {
    name: "<BUNDLE-NAME>"
    ...
    server {
        service: "com.sdv.google.diagnostics.data_item.DataItemService"
    }
    server {
        service: "com.sdv.google.diagnostics.routine_control.RoutineControlService"
    }
    server {
        service: "com.sdv.google.diagnostics.io_control.IoControlService"
    }
    server {
        service: "com.sdv.google.diagnostics.fault.FaultListenerService"
    }
    ...
    diagnostics_declaration {
        data_item {
            ...
        }

        routine {
            ...
        }

        event {
            ...
        }

        io_control {
            ...
        }
    }
    ...
}

DiagnosticsDeclaration iletisi şu şekilde tanımlanır:

package sdv.diagnostics.v1;

message DiagnosticsDeclaration {
  // Diagnostics data item declaration.
  //
  // See com.sdv.google.diagnostics.data_item.DataItemService service.
  message DataItem {
    // Required. Id of the data item.
    string id = 1;

    // Required. Fully qualified name of the message that defines a structure of
    // the data item.
    string message_name = 2;

    // Flag that indicates whether the data item is writable by the Diagnostics
    // Manager.
    //
    // Effectively, this indicates whether the call to DataItemService::Write,
    // is supported for this data item id.
    bool is_writable = 3;
  }

  // Declaration of diagnostics data for input/output control.
  //
  // See com.sdv.google.diagnostics.io_control.IoControl service.
  message InputOutputControlData {
    // Id of the input/output control data.
    string id = 1;

    // Fully qualified name of the message that defines a structure of the data.
    string message_name = 2;
  }

  // Declaration of diagnostics routine.
  //
  // See com.sdv.google.diagnostics.routine_control.RoutineControl.
  message Routine {
    // Information about routine control method.
    message Method {
      // Fully qualified name of the request message.
      string request = 1;

      // Fully qualified name of the response message.
      string response = 2;
    }

    // Id of the routine.
    string id = 1;

    // Information about routine start method.
    //
    // See com.sdv.google.diagnostics.routine_control.RoutineControl::Start.
    Method start = 2;

    // Information about routine stop method.
    //
    // See com.sdv.google.diagnostics.routine_control.RoutineControl::Stop.
    Method stop = 3;

    // Information about routine result method.
    //
    // See
    // com.sdv.google.diagnostics.routine_control.RoutineControl::RequestResult.
    Method result = 4;
  }

  // Declaration of diagnostics event and corresponding fault listener.
  //
  // See com.sdv.google.diagnostics.event.Event.
  // See com.sdv.google.diagnostics.fault.FaultListener.
  message Event {
    // Id of the event.
    string id = 1;

    // Fully qualified message name of the event's extended data message.
    string extended_data_message_name = 2;

    // Fault status changes which service wants to be notified of.
    //
    // See com.sdv.google.diagnostics.fault.FaultListener.StatusMask.
    uint32 fault_listener_mask = 3;

    // User-defined service unit name of a corresponding event publisher.
    string service_unit_name = 4;
  }

  // Diagnostic data items exposed by the service bundle.
  repeated DataItem data_item = 1;

  // Diagnostic data exposed for input/output control by the service bundle.
  repeated InputOutputControlData io_control = 2;

  // Diagnostic routines exposed by the service bundle.
  repeated Routine routine = 3;

  // Diagnostic events sent by the service bundle.
  repeated Event event = 4;
}

Yukarıdaki (service_bundle diagnostics_declaration içeren blok) kataloglarda tanımlanmışsa, vsidl_rc_generator yukarıdaki sunucuları ve diagnostics_declaration'ı bildiren her hizmet paketi için prebuilt_etc hedeflerini oluşturur:

prebuilt_etc {
    name: "<APEX-NAME>.<BUNDLE-NAME>-diag-config.binpb",
    filename: "DiagService-diag-config.binpb",
    sub_dir: "vsidl_provider",
    src: ":generate_vsidl_files_single_bundle_<APEX-NAME>.<BUNDLE-NAME>{diagnostics-config.binpb}",
    installable: false,
}

Bu hedefler, prebuilts bloğunun üzerindeki otomatik olarak oluşturulan ilgili yorum bloğunda belirtildiği gibi, ilgili apex tanım bloğunun prebuilts bölümüne eklenmelidir:prebuilt_etc {}

apex {
    name: "<APEX-NAME>",
    ...
    prebuilts: [
        ...
        "<APEX-NAME>.<BUNDLE-NAME>-diag-config.binpb",
        ...
    ],
    ...
}

Bu hedefleri, ilgili sdv_service_bundles_manifest.textproto dosyasının paketin sdv_service_bundle_metadata girişinin diagnostics_config_path alanına da eklemeniz gerekir. Ayrıca, hizmet paketi ile teşhis yöneticisi hizmeti arasında RPC iletişimini etkinleştirmek için yetkilendirme politikaları belirtmeniz gerekir:

sdv_service_bundle_metadata {
  name: "<BUNDLE-NAME>"
  ...
  diagnostics_config_path: "etc/vsidl_provider/<BUNDLE-NAME>-diag-config.binpb"
  authorization_policy_path: "etc/authz/permissions.textproto"
  ...
}

permissions.textproto dosyasındaki izinler, istemci veya sunucu rollerini tanımlamalıdır. Örneğin, hizmet paketi bir teşhis verileri öğesi uyguluyorsa:

server {
    service: "com.sdv.google.diagnostics.data_item.DataItemService"
    allow_all_channels: true
}

Platform Geliştirici Kılavuzu

Platform geliştirici olarak OEM'ler, rust_binary hedefi için bir Diagnostics Manager Agent uygulamalıdır:

rust_binary {
    name: "<DIAGNOSTICS-AGENT-BINARY-EXECUTABLE-NAME>",
    ...
    product_specific: true,
    ...
}

Ayrıca, derleme dosyalarında aşağıdaki değişken ayarlanmalı/üzerine yazılmalıdır: SDV_DIAGNOSTICS_AGENT_MODULE := <DIAGNOSTICS-AGENT-BINARY-EXECUTABLE-NAME>

Kolaylık sağlamak için libsdv_uds_serde_v1 kitaplığı Proto ↔ UDS çevirisi, VSIDL Provider Library ise yansıtma için kullanılabilir.

.vsidl dosyasında şu içerik olmalıdır:

package: "com.sdv.oem.diagnostics"

service_bundle {
    name: "DiagnosticsAgent"

    server {
        service: "com.sdv.google.diagnostics.DiagnosticsManagerService"
    }

    client {
        service: "com.sdv.google.diagnostics.data_item.DataItemService"
    }

    client {
        service: "com.sdv.google.diagnostics.routine_control.RoutineControlService"
    }

    client {
        service: "com.sdv.google.diagnostics.io_control.IoControlService"
    }

    client {
        service: "com.sdv.google.diagnostics.fault.FaultListenerService"
    }

    client {
        service: "com.sdv.google.diagnostics.ecu_reset.EcuResetService"
    }

    client {
        service: "com.sdv.google.diagnostics.security_access.SecurityAccessService"
    }

    client {
        service: "com.sdv.google.diagnostics.authentication.AuthenticationService"
    }

    client {
        service: "com.sdv.google.diagnostics.file_transfer.FileTransferService"
    }
}

Teşhis Yöneticisi Aracısı ikili bir yürütülebilir dosya olduğundan paketin sdv_service_bundle_metadata, yalnızca yapılandırma bildirimli olarak tanımlanır:

sdv_service_bundle_metadata {
    # This name must match the agent's Bundle Name
    name: "DiagnosticsAgent"
    version_number: 1
    version_name: "1"

    # Reference the manifest itself to mark this as a config-only declaration.
    native_library_path: "etc/sdv_service_bundles_manifest.textproto"

    authorization_policy_path: "etc/authz/permissions.textproto"
}

Teşhis aracısı yetkilendirme politikası, etkileşimde bulunduğu hizmetlerin izinlerini tanımlamalıdır. Örneğin, Dosya Aktarımı hizmetini çağırıyorsa:

client {
    service: "com.sdv.google.diagnostics.file_transfer.FileTransferService"
    allow_all_channels: true
}