Métadonnées du pack de services

Cette page explique comment utiliser les champs de métadonnées obligatoires et facultatifs des bundles de services.

Métadonnées obligatoires

Le modèle d'exécution du bundle de services nécessite que chaque bundle de services définisse les métadonnées suivantes :

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"
  ...
}

Métadonnées facultatives

Les métadonnées facultatives sont compatibles avec des fonctionnalités SDV spécifiques.

Métadonnées d'orchestration

La configuration de l'orchestration SDV fournit un mécanisme permettant de contrôler le comportement de démarrage et d'arrêt des bundles de services. La configuration d'orchestration SDV définit un ensemble de règles qui déterminent quand et comment les actions sont effectuées sur les instances de packs de services. Ces règles sont basées sur les modes véhicule, alimentation et personnalisé.

Pour associer une configuration d'orchestration au bundle de services, indiquez le chemin d'accès au module prebuilt_etc dans le champ facultatif 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"
}

Chemin d'accès à la règle d'autorisation

La règle d'autorisation SDV fournit un mécanisme permettant de déclarer des autorisations pour le bundle de services. La règle d'autorisation définit les actions que le bundle de services peut effectuer (par exemple, publier, s'abonner, diffuser ou appeler).

Pour associer une règle d'autorisation au bundle de services, indiquez le chemin d'accès au module prebuilt_etc dans le champ facultatif 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"
}

Métadonnées du fournisseur VSIDL

Les métadonnées du fournisseur VSIDL font partie d'un mécanisme permettant d'intégrer des bundles de services aux agents de plate-forme Diagnostics et SOME/IP.

Pour associer les métadonnées d'un fournisseur VSIDL à un groupe de services, indiquez le chemin d'accès aux fichiers prebuilt_etc contenant les fichiers de métadonnées générés dans le champ facultatif vsidl_schemas_path / diagnostics_config_path / (configuration SOME/IP APEX uniquement) 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"
}

Pour en savoir plus, consultez Présentation du fournisseur VSIDL.

Métadonnées des tags de journal

L'attribut de tag de journal spécifie l'identifiant unique des journaux générés par le bundle de services. Si cet attribut n'est pas défini, un tag par défaut est généré automatiquement à l'aide du nom du package, du nom du bundle de services et du nom de l'instance. Pour une clarté optimale, définissez un tag de journal concis et unique.

Métadonnées personnalisées

Les métadonnées personnalisées permettent aux OEM et aux fournisseurs de définir des métadonnées de bundle de services spécifiques.

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"
  }
}

Exemple complet

# 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"
  }
}

Références