En esta página, se explica cómo usar los campos de metadatos obligatorios y opcionales del paquete de servicios.
Metadatos obligatorios
El modelo de ejecución del paquete de servicios requiere que cada paquete de servicios defina los siguientes metadatos:
- Nombre del servicio según la convención de nombres de SDV
- Representación de número entero y cadena de la versión del paquete de servicios
- Ruta de acceso a la biblioteca del paquete de servicios
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"
...
}
Metadatos opcionales
Los metadatos opcionales admiten capacidades específicas de SDV.
Metadatos de orquestación
La configuración de orquestación de SDV proporciona un mecanismo para controlar el comportamiento de inicio y apagado de los paquetes de servicios. La configuración de orquestación de SDV define un conjunto de reglas que determinan cuándo y cómo se realizan las acciones en las instancias del paquete de servicios. Estas reglas se basan en los modos de vehículo, energía y personalizados.
Para asociar una configuración de orquestación al paquete de servicios, proporciona la ruta de acceso al módulo prebuilt_etc en el campo opcional orchestration_config_path:
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"
}
Ruta de acceso de la política de autorización
La política de autorización de SDV proporciona un mecanismo para declarar permisos para el paquete de servicios. La política de autorización define qué acciones puede realizar el paquete de servicios (como publicar, suscribirse, entregar o llamar).
Para asociar una política de autorización al paquete de servicios, proporciona la ruta de acceso al módulo prebuilt_etc en el campo opcional authorization_policy_path:
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"
}
Metadatos del proveedor de VSIDL
Los metadatos del proveedor de VSIDL forman parte de un mecanismo para integrar paquetes de servicios con agentes de plataformas de diagnóstico y SOME/IP.
Para asociar metadatos del proveedor de VSIDL con un paquete de servicios, proporciona la ruta de acceso a los archivos prebuilt_etc que contienen archivos de metadatos generados en el campo opcional vsidl_schemas_path / diagnostics_config_path / (solo configuración de 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"
}
Para obtener más información, consulta Descripción general del proveedor de VSIDL.
Metadatos de etiquetas de registro
El atributo de etiqueta de registro especifica el identificador único de los registros generados por el paquete de servicios. Si no se define este atributo, se genera automáticamente una etiqueta predeterminada con el nombre del paquete, el nombre del paquete de servicios y el nombre de la instancia. Para una claridad óptima, define una etiqueta de registro concisa y única.
Metadatos personalizados
Los metadatos personalizados permiten que los OEM y los proveedores definan algunos metadatos específicos del paquete de servicios.
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"
}
}
Ejemplo completo
# 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"
}
}