このページでは、必須および省略可能なサービス バンドル メタデータ フィールドの使用方法について説明します。
必須のメタデータ
サービス バンドル実行モデルでは、各サービス バンドルで次のメタデータを定義する必要があります。
- SDV 命名規則に準拠したサービスの名前
- サービス バンドル バージョンの整数と文字列の表現
- サービス バンドル ライブラリへのパス
sdv_service_bundle_metadata {
# Name of the service bundle.
#
# Must follow SDV service naming convention rules.
# Ref: https:/automotive/sdv/core-areas/naming-conventions
#
# When using VSIDL catalog and middleware generation, this name must be
# equal to the service bundle name defined in the catalog.
name: "TheNameOfTheServiceBundle"
# Service Bundle Version Number.
# Must be non-negative number.
version_number: 1
# Service Bundle Version Name.
# Must be non-empty string.
version_name: "1.0 alpha"
# Path to the native library to be loaded as service bundle.
# Must be the relative path from the APEX root directory
native_library_path: "lib64/libservice_bundle.so"
}
# Service bundle one.
sdv_service_bundle_metadata {
name: "ServiceBundleOne"
...
}
# Service bundle two.
sdv_service_bundle_metadata {
name: "ServiceBundleTwo"
...
}
オプションのメタデータ
オプションのメタデータは、特定の SDV 機能をサポートします。
オーケストレーション メタデータ
SDV オーケストレーション構成は、サービス バンドルの起動とシャットダウンの動作を制御するメカニズムを提供します。SDV オーケストレーション構成は、サービス バンドル インスタンスに対してアクションが実行されるタイミングと方法を決定する一連のルールを定義します。これらのルールは、車両、電源、カスタムモードに基づいています。
オーケストレーション構成をサービス バンドルに関連付けるには、オプションの orchestration_config_path フィールドで prebuilt_etc モジュールのパスを指定します。
sdv_service_bundle_metadata {
...
# Path to the orchestration config file.
# Warning: Shall be relative path to the APEX root directory.
orchestration_config_path: "etc/configuration/orchestration/configuration.textproto"
}
認可ポリシーのパス
SDV 認可ポリシーは、サービス バンドルの権限を宣言するメカニズムを提供します。認可ポリシーは、サービス バンドルが実行できるアクション(公開、登録、提供、呼び出しなど)を定義します。
認可ポリシーをサービス バンドルに関連付けるには、オプションの authorization_policy_path フィールドで prebuilt_etc モジュールのパスを指定します。
sdv_service_bundle_metadata {
...
# Path to the authorization policy file.
# Warning: Shall be relative path to the APEX root directory.
authorization_policy_path: "etc/authz/permissions.textproto"
}
VSIDL プロバイダのメタデータ
VSIDL プロバイダ メタデータは、サービス バンドルを診断および SOME/IP プラットフォーム エージェントと統合するためのメカニズムの一部です。
VSIDL プロバイダ メタデータをサービス バンドルに関連付けるには、生成されたメタデータ ファイルを含む prebuilt_etc ファイルのパスを、オプションの vsidl_schemas_path / diagnostics_config_path /(SOME/IP 構成 APEX のみ)external_service_bundle_metadata_path フィールドで指定します。
sdv_service_bundle_metadata {
...
# Path to the file with protobuf schemas extracted from bundle's VSIDL definition.
# Warning: Must be relative path to the APEX root directory.
vsidl_schemas_path: "etc/vsidl_provider/TheNameOfTheServiceBundle-vsidl-config.binpb"
# Path to the diagnostics config file.
# Warning: Shall be relative path to the APEX root directory.
diagnostics_config_path: "etc/vsidl_provider/TheNameOfTheServiceBundle-diag-config.binpb"
# Path to the SOME/IP config file. To be used in SOME/IP configuration apex only.
# Warning: Must be relative path to the APEX root directory.
external_protocol_mapping_path: "etc/vsidl_provider/someip-config.binpb"
}
詳細については、VSIDL プロバイダの概要をご覧ください。
ログタグのメタデータ
ログタグ属性は、サービス バンドルによって生成されたログの一意の識別子を指定します。この属性が定義されていない場合は、パッケージ名、サービス バンドル名、インスタンス名を使用してデフォルトのタグが自動的に生成されます。わかりやすくするために、簡潔で一意のログタグを定義します。
カスタム メタデータ
カスタム メタデータを使用すると、OEM とベンダーは特定のサービス バンドル メタデータを定義できます。
sdv_service_bundle_metadata {
...
# Custom service bundle metadata map.
# Key is a string, value is a string.
#
# 1st custom metadata value.
custom_metadata {
key: "question"
value: "Answer to the Ultimate Question of Life, the Universe, and Everything"
}
# 2nd custom metadata value.
custom_metadata {
key: "answer" value: "42"
}
}
sdv_service_bundle_metadata {
...
# Custom metadata values are stored in etc/.
custom_metadata {
key: "path_to_custom_metadata"
value: "etc/configuration/file"
}
}
サンプル全体
# proto-file: //system/software_defined_vehicle/core_services/service_bundles_registry/proto/sdv_service_bundles_manifest.proto
# proto-message: SdvServiceBundleManifestEntry
# SDV service bundle.
sdv_service_bundle_metadata {
# Name of the service bundle.
# Must follow SDV service naming convention rules.
name: "TheNameOfTheServiceBundle"
# Service Bundle Version Number.
# Must be non-negative number.
version_number: 42
# Service Bundle Version Name.
# Must be non-empty string.
version_name: "42.0.beta"
# Path to the native library to be loaded as service bundle.
# Must be the relative path from the APEX root directory.
native_library_path: "lib64/libservice_bundle.so"
# The log tag used for Android logging for the service bundle.
# If not specified, a tag derived from service bundle FQIN will be used.
log_tag: "current_service_bundle"
# Path to the orchestration config file.
# Warning: Shall be relative path to the APEX root directory.
orchestration_config_path: "etc/configuration/orchestration/configuration.textproto"
# Path to the file with protobuf schemas extracted from bundle's VSIDL definition.
# Warning: Must be relative path to the APEX root directory.
vsidl_schemas_path: "etc/vsidl_provider/TheNameOfTheServiceBundle-vsidl-config.binpb"
# Path to the diagnostics config file.
# Warning: Must be relative path to the APEX root directory.
diagnostics_config_path: "etc/vsidl_provider/TheNameOfTheServiceBundle-diag-config.binpb"
# Path to the SOME/IP config file. To be used in SOME/IP configuration apex only.
# Warning: Must be relative path to the APEX root directory.
external_protocol_mapping_path: "etc/vsidl_provider/someip-config.binpb"
# Custom service bundle metadata string.
# Key is a string, value is a string.
custom_metadata {
key: "key" value: "value"
}
# Custom metadata values are stored in etc/.
custom_metadata {
key: "path_to_custom_metadata"
value: "etc/configuration/file"
}
}