מטא-נתונים של חבילות שירותים

בדף הזה מוסבר איך להשתמש בשדות המטא-נתונים של חבילות השירות, שהם חובה או אופציונליים.

מטא-נתונים שחובה לציין

מודל ההפעלה של חבילת השירות מחייב שכל חבילת שירות תגדיר את המטא-נתונים הבאים:

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 מגדירה קבוצה של כללים שקובעים מתי ואיך מתבצעות פעולות על מופעים של חבילות שירותים. הכללים האלה מבוססים על מצבים של הרכב, של צריכת החשמל ועל מצבים מותאמים אישית.

כדי לשייך הגדרת תזמור לחבילת השירות, מציינים את הנתיב למודול prebuilt_etc בשדה האופציונלי 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"
}

נתיב מדיניות ההרשאות

מדיניות ההרשאות של SDV מספקת מנגנון להצהרת הרשאות עבור חבילת השירות. מדיניות ההרשאות מגדירה אילו פעולות חבילת השירות יכולה לבצע (כמו פרסום, הרשמה, הצגה או קריאה).

כדי לשייך מדיניות הרשאות לחבילת השירות, מציינים את הנתיב למודול prebuilt_etc בשדה האופציונלי 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"
}

מטא-נתונים של ספק VSIDL

המטא-נתונים של ספק VSIDL הם חלק ממנגנון לשילוב חבילות שירות עם סוכני פלטפורמות של Diagnostics ו-SOME/IP.

כדי לשייך מטא-נתונים של ספק VSIDL לחבילת שירות, צריך לספק את הנתיב לקובצי prebuilt_etc שמכילים קובצי מטא-נתונים שנוצרו בשדה האופציונלי vsidl_schemas_path / diagnostics_config_path / (SOME/IP config APEX only) 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.

מטא-נתונים של תגי יומן

מאפיין תג היומן מציין את המזהה הייחודי של היומנים שנוצרו על ידי חבילת השירות. אם המאפיין הזה לא מוגדר, נוצר באופן אוטומטי תג ברירת מחדל באמצעות שם החבילה, שם חבילת השירות ושם המופע. כדי להשיג בהירות אופטימלית, צריך להגדיר תג יומן קצר וייחודי.

מטא-נתונים בהתאמה אישית

מטא-נתונים בהתאמה אישית מאפשרים ליצרני ציוד מקורי ולספקים להגדיר מטא-נתונים ספציפיים של חבילות שירותים

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

קובצי עזר