

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# Manage AWS IoT FleetWise 訊號目錄
<a name="signal-catalogs"></a>

**注意**  
您可以下載[示範指令碼](https://raw.githubusercontent.com/aws/aws-iot-fleetwise-edge/main/tools/cloud/ros2-to-nodes.py)，將 ROS 2 訊息轉換為與訊號目錄相容的 VSS .json 檔案。如需詳細資訊，請參閱 [https://github.com/aws/aws-iot-fleetwise-edge/blob/main/docs/dev-guide/vision-system-data/vision-system-data-demo.ipynb](https://github.com/aws/aws-iot-fleetwise-edge/blob/main/docs/dev-guide/vision-system-data/vision-system-data-demo.ipynb)。

訊號目錄是標準化訊號的集合，可以重複使用這些訊號來建立車輛模型。 AWS IoT FleetWise 支援 [車輛訊號規格 (VSS)](https://covesa.github.io/vehicle_signal_specification/introduction/overview/)，您可以遵循這些訊號來定義訊號。訊號可以是下列任何類型。

**屬性**  <a name="attribute-definition"></a>
屬性代表通常不會變更的靜態資訊，例如製造商和製造日期。

**分支**  <a name="branch-definition"></a>
分支代表巢狀結構中的訊號。分支示範訊號階層。例如，`Vehicle`分支具有子分支 `Powertrain`。`Powertrain` 分支具有子分支 `combustionEngine`。若要尋找`combustionEngine`分支，請使用 `Vehicle.Powertrain.combustionEngine`運算式。

**感測器**  <a name="sensor-definition"></a>
感應器資料會報告車輛目前的狀態，並隨著車輛的狀態變更，例如油位、溫度、振動或電壓。

**傳動器**  <a name="actuator-definition"></a>
傳動器資料會報告車輛裝置的狀態，例如馬達、加熱器和門鎖。變更車輛裝置的狀態可以更新傳動器資料。例如，您可以定義一個作動器來代表加熱器。當您開啟或關閉加熱器時，傳動器會收到新資料。

**自訂結構**  <a name="custom-structure-definition"></a>
自訂結構 （也稱為結構） 代表複雜或更高順序的資料結構。它有助於邏輯繫結或分組源自相同來源的資料。以原子操作讀取或寫入資料時，會使用結構，例如 代表複雜的資料類型或更高順序的形狀。  
結構類型的訊號是使用結構資料類型的參考而非基本資料類型在訊號目錄中定義。結構可用於所有類型的訊號，包括感應器、屬性、傳動器和視覺系統資料類型。如果傳送或接收結構類型的訊號， AWS IoT FleetWise 預期所有包含的項目都具有有效值，因此所有項目都是強制性的。例如，如果結構包含項目 Vehicle.Camera.Image.height、 Vehicle.Camera.Image.width 和 Vehicle.Camera.Image.data – 預期傳送的訊號包含所有這些項目的值。  
視覺系統資料處於預覽版本中，可能會有所變更。

**自訂屬性**  <a name="custom-property-definition"></a>
自訂屬性代表複雜資料結構的成員。屬性的資料類型可以是基本或另一個結構。  
使用結構和自訂屬性來表示高階形狀時，預期的高階形狀一律會定義為樹狀結構，並視為視覺效果。自訂屬性用於定義所有分葉節點，而結構用於定義所有非分葉節點。

**注意**  
<a name="console-auto-create-signal-catalog"></a>如果您使用 AWS IoT FleetWise 主控台建立第一個車輛模型，則不需要手動建立訊號目錄。當您建立第一個 車輛模型時， AWS IoT FleetWise 會自動為您建立訊號目錄。如需詳細資訊，請參閱[建立 AWS IoT FleetWise 車輛模型](create-vehicle-model.md)。
<a name="console-auto-update-signal-catalog"></a>如果您使用 AWS IoT FleetWise 主控台建立車輛模型，則可以上傳 .dbc 檔案以匯入訊號。.dbc 是控制器區域網路 (CAN 匯流排） 資料庫支援的檔案格式。建立車輛模型後，新的訊號會自動新增至訊號目錄。如需詳細資訊，請參閱[建立 AWS IoT FleetWise 車輛模型](create-vehicle-model.md)。
<a name="signal-catalog-quota"></a>AWS IoT FleetWise 目前支援 AWS 帳戶 每個區域的訊號目錄。

AWS IoT FleetWise 提供下列 API 操作，您可以用來建立和管理訊號目錄。
+ [CreateSignalCatalog](https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_CreateSignalCatalog.html) – 建立新的訊號目錄。
+ [ImportSignalCatalog](https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_ImportSignalCatalog.html) – 透過上傳 .json 檔案匯入訊號以建立訊號目錄。訊號必須依照 VSS 定義，並以 JSON 格式儲存。
+ [UpdateSignalCatalog](https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_UpdateSignalCatalog.html) – 透過更新、移除或新增訊號來更新現有的訊號目錄。
+ [DeleteSignalCatalog](https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_DeleteSignalCatalog.html) – 刪除現有的訊號目錄。
+ [ListSignalCatalogs](https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_ListSignalCatalogs.html) – 擷取所有訊號目錄的分頁摘要清單。
+ [ListSignalCatalogNodes](https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_ListSignalCatalogNodes.html) – 擷取指定訊號目錄中所有訊號 （節點） 的分頁清單。
+ [GetSignalCatalog](https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_GetSignalCatalog.html) – 擷取訊號目錄的相關資訊。

**Topics**
+ [Configure AWS IoT FleetWise 訊號](define-signal.md)
+ [建立 AWS IoT FleetWise 訊號目錄](create-signal-catalog.md)
+ [匯入 AWS IoT FleetWise 訊號目錄](import-signal.md)
+ [更新 an AWS IoT FleetWise 訊號目錄](update-signal-catalog.md)
+ [刪除 AWS IoT FleetWise 訊號目錄](delete-signal-catalog.md)
+ [Get AWS IoT FleetWise 訊號目錄資訊](get-signal-catalog-information.md)

# Configure AWS IoT FleetWise 訊號
<a name="define-signal"></a>

本節說明如何設定分支、屬性、感應器和致動器。

**Topics**
+ [設定分支](#configure-branch)
+ [設定屬性](#configure-attributes)
+ [設定感應器或傳動器](#configure-sensors-or-acuators)
+ [設定複雜的資料類型](#configure-complex-data-types)

## 設定分支
<a name="configure-branch"></a>

若要設定分支，請指定下列資訊。
+ `fullyQualifiedName` – 分支的完整名稱是分支的路徑加上分支的名稱。使用 dot(.) 來參考子分支。例如， `Vehicle.Chassis.SteeringWheel`是`SteeringWheel`分支的完整名稱。 `Vehicle.Chassis.`是此分支的路徑。

  完整名稱最多可有 150 個字元。有效字元：a–z、A–Z、0–9、冒號 (：) 和底線 (\$1)。
+ （選用） `Description` – 分支的說明。

  描述最多可有 2048 個字元。有效字元：a–z、A–Z、0–9、： （冒號）、\$1 （底線） 和 - （連字號）。
+ （選用） `deprecationMessage` – 要移動或刪除之節點或分支的棄用訊息。

  deprecationMessage 最多可有 2048 個字元。有效字元：a–z、A–Z、0–9、： （冒號）、\$1 （底線） 和 - （連字號）。
+ （選用） `comment` – 說明以外的註解。註解可用來提供有關分支的其他資訊，例如分支的原理或相關分支的參考。

  註解最多可有 2048 個字元。有效字元：a–z、A–Z、0–9、： （冒號）、\$1 （底線） 和 - （連字號）。

## 設定屬性
<a name="configure-attributes"></a>

若要設定 屬性，請指定下列資訊。
+ `dataType` – 屬性的資料類型必須是下列其中一項：INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64、BOOLEAN、FLOAT、DOUBLE、STRRING、 UNIX\$1TIMESTAMP、INT8\$1ARRAY、UINT8\$1ARRAY、INT16\$1ARRAY、UINT16\$1ARRAY、INT32\$1ARRAY、UINT32\$1ARRAY、INT64\$1ARRAY、UINT64\$1ARRAY、BOOLEAN\$1ARRAY、FLOAT\$1ARRAY、DUBLE\$1ARRAY、STRING\$1ARRAY、UNX\$1TIMESTAMP\$1ARRAY、UNKNOWN、fullyQualifiedName的分支中定義的資料類型。
+ `fullyQualifiedName` – 屬性的完整名稱是屬性加上屬性名稱的路徑。使用 dot(.) 來參考子訊號。例如， `Diameter` `Vehicle.Chassis.SteeringWheel.Diameter`是 屬性的完整名稱。 `Vehicle.Chassis.SteeringWheel.`是此屬性的路徑。

  完整名稱最多可有 150 個字元。有效字元：a–z、A–Z、0–9、： （冒號） 和 \$1 （底線）。
+ （選用） `Description` – 屬性的描述。

  描述最多可有 2048 個字元。有效字元：a–z、A–Z、0–9、： （冒號）、\$1 （底線） 和 - （連字號）。
+ （選用） `unit` – 屬性的科學單位，例如 km 或 Celsius。
+ （選用） `min` – 屬性的最小值。
+ （選用） `max` – 屬性的最大值。
+ （選用） `defaultValue` – 屬性的預設值。
+ （選用） `assignedValue` – 指派給屬性的值。
+ （選用） `allowedValues` – 屬性接受的值清單。
+ （選用） `deprecationMessage` – 正在移動或刪除的節點或分支的棄用訊息。

  deprecationMessage 最多可有 2048 個字元。有效字元：a–z、A–Z、0–9、： （冒號）、\$1 （底線） 和 - （連字號）。
+ （選用） `comment` – 說明以外的註解。註解可用來提供有關屬性的其他資訊，例如屬性的原理或相關屬性的參考。

  註解最多可有 2048 個字元。有效字元：a–z、A–Z、0–9、： （冒號）、\$1 （底線） 和 - （連字號）。

## 設定感應器或傳動器
<a name="configure-sensors-or-acuators"></a>

若要設定感應器或致動器，請指定下列資訊。
+ `dataType` – 訊號的資料類型必須是下列其中一項：INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64、BOOLEAN、FLOAT、DOUBLE、STRRING、UNIX\$1TIMESTAMP、INT8\$1ARRAY、UTINT8\$1ARRAY、INT16\$1ARRAY、UTINT16\$1ARRAY、INT32\$1ARRAY、UINT32\$1ARRAY、INT64\$1ARRAY、UTINT64\$1ARRAY、BOOLEAN\$1ARRAY、FLOAT\$1ARRAY、DUBLE\$1ARRAY、STRING\$1ARRAY、UNX\$1TIMESTAMP\$1ARRAY、UNKNOWN、fullyQualifiedName或自訂類型的分支中定義的資料類型。
+ `fullyQualifiedName` – 訊號的完整名稱是訊號的路徑加上訊號的名稱。使用 dot(.) 來參考子訊號。例如， `Vehicle.Chassis.SteeringWheel.HandsOff.HandsOffSteeringState`是`HandsOffSteeringState`傳動器的完整名稱。 `Vehicle.Chassis.SteeringWheel.HandsOff.`是此傳動器的路徑。

  完整名稱最多可有 150 個字元。有效字元：a–z、A–Z、0–9、： （冒號） 和 \$1 （底線）。
+ （選用） `Description` – 訊號的描述。

  描述最多可有 2048 個字元。有效字元：a–z、A–Z、0–9、： （冒號）、\$1 （底線） 和 - （連字號）。
+ （選用） `unit` – 訊號的科學單位，例如 km 或 Celsius。
+ （選用） `min` – 訊號的最小值。
+ （選用） `max` – 訊號的最大值。
+ （選用） `assignedValue` – 指派給訊號的值。
+ （選用） `allowedValues` – 訊號接受的值清單。
+ （選用） `deprecationMessage` – 正在移動或刪除的節點或分支的棄用訊息。

  deprecationMessage 最多可有 2048 個字元。有效字元：a–z、A–Z、0–9、： （冒號）、\$1 （底線） 和 - （連字號）。
+ （選用） `comment` – 說明以外的註解。註解可用來提供有關感應器或傳動器的其他資訊，例如其原理或相關感應器或傳動器的參考。

  註解最多可有 2048 個字元。有效字元：a–z、A–Z、0–9、： （冒號）、\$1 （底線） 和 - （連字號）。

## 設定複雜的資料類型
<a name="configure-complex-data-types"></a>

建立視覺系統的模型時，會使用複雜的資料類型。除了分支之外，這些資料類型是由結構 （也稱為結構） 和屬性所組成。結構是由多個值描述的訊號，例如影像。屬性代表結構的成員，例如基本資料類型 （例如 UINT8) 或其他結構 （例如時間戳記）。例如，Carve.Cameras.Front 代表分支、Carve.Cameras.Front.Image 代表結構，而 Vehicle.Cameras.Timestamp 代表屬性。

下列複雜資料類型範例示範如何將訊號和資料類型匯出至單一 .json 檔案。

**Example 複雜資料類型**  

```
{
  "Vehicle": {
    "type": "branch"
    // Signal tree
  },
  "ComplexDataTypes": {
    "VehicleDataTypes": {
      // complex data type tree
      "children": {
        "branch": {
          "children": {
            "Struct": {
              "children": {
                "Property": {
                  "type": "property",
                  "datatype": "Data type",
                  "description": "Description",
                  //                  ...
                }
              },
              "description": "Description",
              "type": "struct"
            }
          }
          "description": "Description",
          "type": "branch"
        }
      }
    }
  }
}
```

**注意**  
您可以下載[示範指令碼](https://raw.githubusercontent.com/aws/aws-iot-fleetwise-edge/main/tools/cloud/ros2-to-nodes.py)，將 ROS 2 訊息轉換為與訊號目錄相容的 VSS .json 檔案。如需詳細資訊，請參閱 [https://github.com/aws/aws-iot-fleetwise-edge/blob/main/docs/dev-guide/vision-system-data/vision-system-data-demo.ipynb](https://github.com/aws/aws-iot-fleetwise-edge/blob/main/docs/dev-guide/vision-system-data/vision-system-data-demo.ipynb)。  
視覺系統資料處於預覽版本中，可能會有所變更。

### 設定結構
<a name="configure-custom-structure"></a>

若要設定自訂結構 （或結構），請指定下列資訊。
+ `fullyQualifiedName` – 自訂結構的完整名稱。例如，自訂結構的完整名稱可能是 `ComplexDataTypes.VehicleDataTypes.SVMCamera`。

  完整名稱最多可有 150 個字元。有效字元：a–z、A–Z、0–9、： （冒號） 和 \$1 （底線）。
+ （選用） `Description` – 訊號的描述。

  描述最多可有 2048 個字元。有效字元：a–z、A–Z、0–9、： （冒號）、\$1 （底線） 和 - （連字號）。
+ （選用） `deprecationMessage` – 正在移動或刪除的節點或分支的棄用訊息。

  deprecationMessage 最多可有 2048 個字元。有效字元：a–z、A–Z、0–9、： （冒號）、\$1 （底線） 和 - （連字號）。
+ （選用） `comment` – 說明以外的註解。註解可用來提供有關感應器或傳動器的其他資訊，例如其原理或相關感應器或傳動器的參考。

  註解最多可有 2048 個字元。有效字元：a–z、A–Z、0–9、： （冒號）、\$1 （底線） 和 - （連字號）。

### 設定 屬性
<a name="configure-custom-property"></a>

若要設定自訂屬性，請指定下列資訊。
+ `dataType` – 訊號的資料類型必須是下列其中一項：INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64、BOOLEAN、FLOAT、DOUBLE、STRRING、UNIX\$1TIMESTAMP、INT8\$1ARRAY、UINT8\$1ARRAY、INT16\$1ARRAY、UINT16\$1ARRAY、INT32\$1ARRAY、UINT32\$1ARRAY、INT64\$1ARRAY、UINT64\$1ARRAY、BOOLEAN\$1ARRAY、FLOAT\$1ARRAY、DUBLE\$1ARRAY、STRING\$1ARRAY、UNX\$1TIMESTAMP\$1RAY、STRUCT、STRUCT\$1ARNOWN。
+ `fullyQualifiedName` – 自訂屬性的完整名稱。例如，自訂屬性的完整名稱可能是 `ComplexDataTypes.VehicleDataTypes.SVMCamera.FPS`。

  完整名稱最多可有 150 個字元。有效字元：a–z、A–Z、0–9、： （冒號） 和 \$1 （底線）
+ （選用） `Description` – 訊號的描述。

  描述最多可有 2048 個字元。有效字元：a–z、A–Z、0–9、： （冒號）、\$1 （底線） 和 - （連字號）。
+ （選用） `deprecationMessage` – 正在移動或刪除的節點或分支的棄用訊息。

  deprecationMessage 最多可有 2048 個字元。有效字元：a–z、A–Z、0–9、： （冒號）、\$1 （底線） 和 - （連字號）。
+ （選用） `comment` – 說明以外的註解。註解可用來提供有關感應器或傳動器的其他資訊，例如其原理或相關感應器或傳動器的參考。

  註解最多可有 2048 個字元。有效字元：a–z、A–Z、0–9、： （冒號）、\$1 （底線） 和 - （連字號）。
+ （選用） `dataEncoding` – 指出 屬性是否為二進位資料。自訂屬性的資料編碼必須是下列其中一項：BINARY 或 TYPED。
+ （選用） `structFullyQualifiedName ` – 如果自訂屬性的資料類型為 Struct 或 StructArray，則為自訂屬性的結構 (struct) 節點的完整名稱。

  完整名稱最多可有 150 個字元。有效字元：a–z、A–Z、0–9、： （冒號） 和 \$1 （底線）。

# 建立 AWS IoT FleetWise 訊號目錄
<a name="create-signal-catalog"></a>

您可以使用 [CreateSignalCatalog](https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_CreateSignalCatalog.html) API 操作來建立訊號目錄。下列範例使用 AWS CLI。

若要建立訊號目錄，請執行下列命令。

將 *signal-catalog-configuration* 取代為包含組態的 .json 檔案名稱。

```
aws iotfleetwise create-signal-catalog --cli-input-json file://signal-catalog-configuration.json
```

## 訊號目錄組態
<a name="signal-catalog-configuration"></a>
+ 將 *signal-catalog-name* 取代為您建立的訊號目錄名稱。
+ （選用） 將*描述*取代為描述，以協助您識別訊號目錄。

如需如何設定分支、屬性、感應器和致動器的詳細資訊，請參閱 [Configure AWS IoT FleetWise 訊號](define-signal.md)。

```
{
    "name": "signal-catalog-name",
    "description": "description",
    "nodes": [
  {
    "branch": {
      "fullyQualifiedName": "Types"
    }
  },
  {
    "struct": {
      "fullyQualifiedName": "Types.sensor_msgs_msg_CompressedImage"
    }
  },
  {
    "struct": {
      "fullyQualifiedName": "Types.std_msgs_Header"
    }
  },
  {
    "struct": {
      "fullyQualifiedName": "Types.builtin_interfaces_Time"
    }
  },
  {
    "property": {
      "fullyQualifiedName": "Types.builtin_interfaces_Time.sec",
      "dataType": "INT32",
      "dataEncoding": "TYPED"
    }
  },
  {
    "property": {
      "fullyQualifiedName": "Types.builtin_interfaces_Time.nanosec",
      "dataType": "UINT32",
      "dataEncoding": "TYPED"
    }
  },
  {
    "property": {
      "fullyQualifiedName": "Types.std_msgs_Header.stamp",
      "dataType": "STRUCT",
      "structFullyQualifiedName": "Types.builtin_interfaces_Time"
    }
  },
  {
    "property": {
      "fullyQualifiedName": "Types.std_msgs_Header.frame_id",
      "dataType": "STRING",
      "dataEncoding": "TYPED"
    }
  },
  {
    "property": {
      "fullyQualifiedName": "Types.sensor_msgs_msg_CompressedImage.header",
      "dataType": "STRUCT",
      "structFullyQualifiedName": "Types.std_msgs_Header"
    }
  },
  {
    "property": {
      "fullyQualifiedName": "Types.sensor_msgs_msg_CompressedImage.format",
      "dataType": "STRING",
      "dataEncoding": "TYPED"
    }
  },
  {
    "property": {
      "fullyQualifiedName": "Types.sensor_msgs_msg_CompressedImage.data",
      "dataType": "UINT8_ARRAY",
      "dataEncoding": "BINARY"
    }
  },
  {
    "branch": {
      "fullyQualifiedName": "Vehicle",
      "description": "Vehicle"
    }
  },
  {
    "branch": {
      "fullyQualifiedName": "Vehicle.Cameras"
    }
  },
  {
    "branch": {
      "fullyQualifiedName": "Vehicle.Cameras.Front"
    }
  },
  {
    "sensor": {
      "fullyQualifiedName": "Vehicle.Cameras.Front.Image",
      "dataType": "STRUCT",
      "structFullyQualifiedName": "Types.sensor_msgs_msg_CompressedImage"
    }
  },
  {
    "struct": {
      "fullyQualifiedName": "Types.std_msgs_msg_Float64"
    }
  },
  {
    "property": {
      "fullyQualifiedName": "Types.std_msgs_msg_Float64.data",
      "dataType": "DOUBLE",
      "dataEncoding": "TYPED"
    }
  },
  {
    "sensor": {
      "fullyQualifiedName": "Vehicle.Velocity",
      "dataType": "STRUCT",
      "structFullyQualifiedName": "Types.std_msgs_msg_Float64"
    }
  },
  {
    "struct": {
      "fullyQualifiedName": "Types.sensor_msgs_msg_RegionOfInterest"
    }
  },
  {
    "property": {
      "fullyQualifiedName": "Types.sensor_msgs_msg_RegionOfInterest.x_offset",
      "dataType": "UINT32",
      "dataEncoding": "TYPED"
    }
  },
  {
    "property": {
      "fullyQualifiedName": "Types.sensor_msgs_msg_RegionOfInterest.y_offset",
      "dataType": "UINT32",
      "dataEncoding": "TYPED"
    }
  },
  {
    "property": {
      "fullyQualifiedName": "Types.sensor_msgs_msg_RegionOfInterest.height",
      "dataType": "UINT32",
      "dataEncoding": "TYPED"
    }
  },
  {
    "property": {
      "fullyQualifiedName": "Types.sensor_msgs_msg_RegionOfInterest.width",
      "dataType": "UINT32",
      "dataEncoding": "TYPED"
    }
  },
  {
    "property": {
      "fullyQualifiedName": "Types.sensor_msgs_msg_RegionOfInterest.do_rectify",
      "dataType": "BOOLEAN",
      "dataEncoding": "TYPED"
    }
  },
  {
    "branch": {
      "fullyQualifiedName": "Vehicle.Perception"
    }
  },
  {
    "sensor": {
      "fullyQualifiedName": "Vehicle.Perception.Obstacle",
      "dataType": "STRUCT",
      "structFullyQualifiedName": "Types.sensor_msgs_msg_RegionOfInterest"
    }
  }
]
}
```

**注意**  
您可以下載[示範指令碼](https://raw.githubusercontent.com/aws/aws-iot-fleetwise-edge/main/tools/cloud/ros2-to-nodes.py)，將 ROS 2 訊息轉換為與訊號目錄相容的 VSS .json 檔案。如需詳細資訊，請參閱 [https://github.com/aws/aws-iot-fleetwise-edge/blob/main/docs/dev-guide/vision-system-data/vision-system-data-demo.ipynb](https://github.com/aws/aws-iot-fleetwise-edge/blob/main/docs/dev-guide/vision-system-data/vision-system-data-demo.ipynb)。  
視覺系統資料處於預覽版本，可能會有所變更。

如果您使用客戶受管 AWS KMS 金鑰[啟用加密](key-management.md)，請包含下列政策陳述式，讓您的角色可以叫用 `CreateSignalCatalog` API 操作。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "kms:GenerateDataKey*",
                "kms:Decrypt"
            ],
            "Resource": [
                "arn:aws:kms:us-east-1:111122223333:key/KMS_KEY_ID"
            ]
        }
    ]
}
```

------

# 匯入 AWS IoT FleetWise 訊號目錄
<a name="import-signal"></a>

您可以使用 AWS IoT FleetWise 主控台或 API 來匯入訊號目錄。

**Topics**
+ [匯入訊號目錄 （主控台）](#import-signal-catalog-console)
+ [匯入訊號目錄 (AWS CLI)](#import-signal-catalog)

## 匯入訊號目錄 （主控台）
<a name="import-signal-catalog-console"></a>

您可以使用 AWS IoT FleetWise 主控台匯入訊號目錄。

**重要**  
您最多可以有一個訊號目錄。如果您已經有訊號目錄，則不會在主控台中看到匯入訊號目錄的選項。

**匯入訊號目錄**

1. 開啟 [AWS IoT FleetWise 主控台](https://console.aws.amazon.com/iotfleetwise/)。

1. 在導覽窗格中，選擇**訊號目錄**。

1. 在訊號目錄摘要頁面上，選擇**匯入訊號目錄**。

1. 匯入包含訊號的檔案。
   + 若要從 S3 儲存貯體上傳檔案：

     1. 選擇 **Import from S3** (從 S3 匯入)。

     1. 選擇 **Browse S3** (瀏覽 S3)。

     1. 對於**儲存貯體**，輸入儲存貯體名稱或物件，從清單中選擇它，然後從清單中選擇檔案。選擇**選擇檔案**按鈕。

     或者，針對 **S3 URI**，輸入 Amazon Simple Storage Service URI。如需詳細資訊，請參閱《*Amazon S3 使用者指南*》中的[存取儲存貯體的方法](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-bucket-intro.html)。
   + 若要從您的電腦上傳檔案：

     1. 選擇**從檔案匯入**。

     1. 上傳 [車輛訊號規格 (VSS)](https://www.w3.org/auto/wg/wiki/Vehicle_Signal_Specification_(VSS)/Vehicle_Data_Spec) 格式的 .json 檔案。

1. 驗證訊號目錄，然後選擇**匯入檔案**。

## 匯入訊號目錄 (AWS CLI)
<a name="import-signal-catalog"></a>

您可以使用 [ImportSignalCatalog](https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_ImportSignalCatalog.html) API 操作上傳 JSON 檔案，以協助建立訊號目錄。您必須遵循 [車輛訊號規格 (VSS)](https://www.w3.org/auto/wg/wiki/Vehicle_Signal_Specification_(VSS)/Vehicle_Data_Spec) 將訊號儲存在 JSON 檔案中。下列範例使用 AWS CLI。

若要匯入訊號目錄，請執行下列命令。
+ 將 *signal-catalog-name* 取代為您建立的訊號目錄名稱。
+  （選用） 將描述取代為*描述*，以協助您識別訊號目錄。
+ 以包含 VSS 中定義訊號的 JSON 字串檔案名稱取代 *signal-catalog-configuration-vss*。

如需如何設定分支、屬性、感應器和致動器的詳細資訊，請參閱 [Configure AWS IoT FleetWise 訊號](define-signal.md)。

```
aws iotfleetwise import-signal-catalog \
                 --name signal-catalog-name \
                 --description  description \
                 --vss file://signal-catalog-configuration-vss.json
```

### 訊號目錄組態 (VSS)
<a name="signal-catalog-configuration-VSS"></a>

JSON 必須經過字串化並透過 `vssJson` 欄位傳遞。以下是 VSS 中定義的訊號範例。

```
{
	"Vehicle": {
		"type": "branch",
		"children": {
			"Chassis": {
				"type": "branch",
				"description": "All data concerning steering, suspension, wheels, and brakes.",
				"children": {
					"SteeringWheel": {
						"type": "branch",
						"description": "Steering wheel signals",
						"children": {
							"Diameter": {
								"type": "attribute",
								"description": "The diameter of the steering wheel",
								"datatype": "float",
								"unit": "cm",
								"min": 1,
								"max": 50
							},
							"HandsOff": {
								"type": "branch",
								"children": {
									"HandsOffSteeringState": {
										"type": "actuator",
										"description": "HndsOffStrWhlDtSt. Hands Off Steering State",
										"datatype": "boolean"
									},
									"HandsOffSteeringMode": {
										"type": "actuator",
										"description": "HndsOffStrWhlDtMd. Hands Off Steering Mode",
										"datatype": "int8",
										"min": 0,
										"max": 2
									}
								}
							}
						}
					},
					"Accelerator": {
						"type": "branch",
						"description": "",
						"children": {
							"AcceleratorPedalPosition": {
								"type": "sensor",
								"description": "Throttle__Position. Accelerator pedal position as percent. 0 = Not depressed. 100 = Fully depressed.",
								"datatype": "uint8",
								"unit": "%",
								"min": 0,
								"max": 100.000035
							}
						}
					}
				}
			},
			"Powertrain": {
				"type": "branch",
				"description": "Powertrain data for battery management, etc.",
				"children": {
					"Transmission": {
						"type": "branch",
						"description": "Transmission-specific data, stopping at the drive shafts.",
						"children": {
							"VehicleOdometer": {
								"type": "sensor",
								"description": "Vehicle_Odometer",
								"datatype": "float",
								"unit": "km",
								"min": 0,
								"max": 67108863.984375
							}
						}
					},
					"CombustionEngine": {
						"type": "branch",
						"description": "Engine-specific data, stopping at the bell housing.",
						"children": {
							"Engine": {
								"type": "branch",
								"description": "Engine description",
								"children": {
									"timing": {
										"type": "branch",
										"description": "timing description",
										"children": {
											"run_time": {
												"type": "sensor",
												"description": "Engine run time",
												"datatype": "int16",
												"unit": "ms",
												"min": 0,
												"max": 10000
											},
											"idle_time": {
												"type": "sensor",
												"description": "Engine idle time",
												"datatype": "int16",
												"min": 0,
												"unit": "ms",
												"max": 10000
											}
										}
									}
								}
							}
						}
					}
				}
			},
			"Axle": {
				"type": "branch",
				"description": "Axle signals",
				"children": {
					"TireRRPrs": {
						"type": "sensor",
						"description": "TireRRPrs. Right rear Tire pressure in kilo-Pascal",
						"datatype": "float",
						"unit": "kPaG",
						"min": 0,
						"max": 1020
					}
				}
			}
		}
	},
	"Cameras": {
		"type": "branch",
		"description": "Branch to aggregate all cameras in the vehicle",
		"children": {
			"FrontViewCamera": {
				"type": "sensor",
				"datatype": "VehicleDataTypes.SVMCamera",
				"description": "Front view camera"
			},
			"RearViewCamera": {
				"type": "sensor",
				"datatype": "VehicleDataTypes.SVMCamera",
				"description": "Rear view camera"
			},
			"LeftSideViewCamera": {
				"type": "sensor",
				"datatype": "VehicleDataTypes.SVMCamera",
				"description": "Left side view camera"
			},
			"RightSideViewCamera": {
				"type": "sensor",
				"datatype": "VehicleDataTypes.SVMCamera",
				"description": "Right side view camera"
			}
		}
	},
	"ComplexDataTypes": {
		"VehicleDataTypes": {
			"type": "branch",
			"description": "Branch to aggregate all camera related higher order data types",
			"children": {
				"SVMCamera": {
					"type": "struct",
					"description": "This data type represents Surround View Monitor (SVM) camera system in a vehicle",
					"comment": "Test comment",
					"deprecation": "Test deprecation message",
					"children": {
						"Make": {
							"type": "property",
							"description": "Make of the SVM camera",
							"datatype": "string",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						},
						"Description": {
							"type": "property",
							"description": "Description of the SVM camera",
							"datatype": "string",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						},
						"FPS": {
							"type": "property",
							"description": "FPS of the SVM camera",
							"datatype": "double",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						},
						"Orientation": {
							"type": "property",
							"description": "Orientation of the SVM camera",
							"datatype": "VehicleDataTypes.Orientation",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						},
						"Range": {
							"type": "property",
							"description": "Range of the SVM camera",
							"datatype": "VehicleDataTypes.Range",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						},
						"RawData": {
							"type": "property",
							"description": "Represents binary data of the SVM camera",
							"datatype": "uint8[]",
							"dataencoding": "binary",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						},
						"CapturedFrames": {
							"type": "property",
							"description": "Represents selected frames captured by the SVM camera",
							"datatype": "VehicleDataTypes.Frame[]",
							"dataencoding": "typed",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						}
					}
				},
				"Range": {
					"type": "struct",
					"description": "Range of a camera in centimeters",
					"comment": "Test comment",
					"deprecation": "Test deprecation message",
					"children": {
						"Min": {
							"type": "property",
							"description": "Minimum range of a camera in centimeters",
							"datatype": "uint32",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						},
						"Max": {
							"type": "property",
							"description": "Maximum range of a camera in centimeters",
							"datatype": "uint32",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						}
					}
				},
				"Orientation": {
					"type": "struct",
					"description": "Orientation of a camera",
					"comment": "Test comment",
					"deprecation": "Test deprecation message",
					"children": {
						"Front": {
							"type": "property",
							"description": "Indicates whether the camera is oriented to the front of the vehicle",
							"datatype": "boolean",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						},
						"Rear": {
							"type": "property",
							"description": "Indicates whether the camera is oriented to the rear of the vehicle",
							"datatype": "boolean",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						},
						"Side": {
							"type": "property",
							"description": "Indicates whether the camera is oriented to the side of the vehicle",
							"datatype": "boolean",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						}
					}
				},
				"Frame": {
					"type": "struct",
					"description": "Represents a camera frame",
					"comment": "Test comment",
					"deprecation": "Test deprecation message",
					"children": {
						"Data": {
							"type": "property",
							"datatype": "string",
							"dataencoding": "binary",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						}
					}
				}
			}
		}
	}
 
}
```

下列範例顯示在 JSON 字串中 VSS 中定義的相同訊號。

```
{
   "vssJson": "{\"Vehicle\":{\"type\":\"branch\",\"children\":{\"Chassis\":{\"type\":\"branch\",\"description\":\"All data concerning steering, suspension, wheels, and brakes.\",\"children\":{\"SteeringWheel\":{\"type\":\"branch\",\"description\":\"Steering wheel signals\",\"children\":{\"Diameter\":{\"type\":\"attribute\",\"description\":\"The diameter of the steering wheel\",\"datatype\":\"float\",\"unit\":\"cm\",\"min\":1,\"max\":50},\"HandsOff\":{\"type\":\"branch\",\"children\":{\"HandsOffSteeringState\":{\"type\":\"actuator\",\"description\":\"HndsOffStrWhlDtSt. Hands Off Steering State\",\"datatype\":\"boolean\"},\"HandsOffSteeringMode\":{\"type\":\"actuator\",\"description\":\"HndsOffStrWhlDtMd. Hands Off Steering Mode\",\"datatype\":\"int8\",\"min\":0,\"max\":2}}}}},\"Accelerator\":{\"type\":\"branch\",\"description\":\"\",\"children\":{\"AcceleratorPedalPosition\":{\"type\":\"sensor\",\"description\":\"Throttle__Position. Accelerator pedal position as percent. 0 = Not depressed. 100 = Fully depressed.\",\"datatype\":\"uint8\",\"unit\":\"%\",\"min\":0,\"max\":100.000035}}}}},\"Powertrain\":{\"type\":\"branch\",\"description\":\"Powertrain data for battery management, etc.\",\"children\":{\"Transmission\":{\"type\":\"branch\",\"description\":\"Transmission-specific data, stopping at the drive shafts.\",\"children\":{\"VehicleOdometer\":{\"type\":\"sensor\",\"description\":\"Vehicle_Odometer\",\"datatype\":\"float\",\"unit\":\"km\",\"min\":0,\"max\":67108863.984375}}},\"CombustionEngine\":{\"type\":\"branch\",\"description\":\"Engine-specific data, stopping at the bell housing.\",\"children\":{\"Engine\":{\"type\":\"branch\",\"description\":\"Engine description\",\"children\":{\"timing\":{\"type\":\"branch\",\"description\":\"timing description\",\"children\":{\"run_time\":{\"type\":\"sensor\",\"description\":\"Engine run time\",\"datatype\":\"int16\",\"unit\":\"ms\",\"min\":0,\"max\":10000},\"idle_time\":{\"type\":\"sensor\",\"description\":\"Engine idle time\",\"datatype\":\"int16\",\"min\":0,\"unit\":\"ms\",\"max\":10000}}}}}}}}},\"Axle\":{\"type\":\"branch\",\"description\":\"Axle signals\",\"children\":{\"TireRRPrs\":{\"type\":\"sensor\",\"description\":\"TireRRPrs. Right rear Tire pressure in kilo-Pascal\",\"datatype\":\"float\",\"unit\":\"kPaG\",\"min\":0,\"max\":1020}}}}}}"
}
```

**注意**  
您可以下載[示範指令碼](https://raw.githubusercontent.com/aws/aws-iot-fleetwise-edge/main/tools/cloud/ros2-to-nodes.py)，將 ROS 2 訊息轉換為與訊號目錄相容的 VSS JSON 檔案。如需詳細資訊，請參閱 [https://github.com/aws/aws-iot-fleetwise-edge/blob/main/docs/dev-guide/vision-system-data/vision-system-data-demo.ipynb](https://github.com/aws/aws-iot-fleetwise-edge/blob/main/docs/dev-guide/vision-system-data/vision-system-data-demo.ipynb)。  
視覺系統資料處於預覽版本，可能會有所變更。

如果您使用客戶受管 AWS KMS 金鑰[啟用加密](key-management.md)，請包含下列政策陳述式，讓您的角色可以叫用 `ImportSignalCatalog` API 操作。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "kms:GenerateDataKey*",
                "kms:Decrypt"
            ],
            "Resource": [
                "arn:aws:kms:us-east-1:111122223333:key/KMS_KEY_ID"
            ]
        }
    ]
}
```

------

# 更新 an AWS IoT FleetWise 訊號目錄
<a name="update-signal-catalog"></a>

您可以使用 [UpdateSignalCatalog](https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_UpdateSignalCatalog.html) API 操作來更新現有的訊號目錄。下列範例使用 AWS CLI。

若要更新現有的訊號目錄，請執行下列命令。

將 *signal-catalog-configuration* 取代為包含組態的 .json 檔案名稱。

```
aws iotfleetwise update-signal-catalog --cli-input-json file://signal-catalog-configuration.json
```

## 訊號目錄組態
<a name="update-signal-catalog-configuration"></a>

將 *signal-catalog-name* 取代為您更新之訊號目錄的名稱。

如需如何設定分支、屬性、感應器和致動器的詳細資訊，請參閱 [Configure AWS IoT FleetWise 訊號](define-signal.md)。

**重要**  
自訂結構是不可變的。如果您需要將屬性重新排序或插入現有自訂結構 （結構），請刪除結構，並使用所需的屬性順序建立新的結構。  
若要刪除自訂結構，請在 中新增結構的完整名稱`nodesToRemove`。如果任何訊號參考結構，則無法刪除該結構。任何參考結構的訊號 （其資料類型定義為目標結構） 都必須在請求更新訊號目錄之前更新或刪除。

```
{
    	"name": "signal-catalog-name",
    	"nodesToAdd": [{
    			"branch": {
    				"description": "Front left of vehicle specific data.",
    				"fullyQualifiedName": "Vehicle.Front.Left"
    			}
    		},
    		{
    			"branch": {
    				"description": "Door-specific data for the front left of vehicle.",
    				"fullyQualifiedName": "Vehicle.Front.Left.Door"
    			}
    		},
    		{
    			"actuator": {
    				"fullyQualifiedName": "Vehicle.Front.Left.Door.Lock",
    				"description": "Whether the front left door is locked.",
    				"dataType": "BOOLEAN"
    			}
    		},
    		{
    			"branch": {
    				"fullyQualifiedName": "Vehicle.Camera"
    			}
    		},
    		{
    			"struct": {
    				"fullyQualifiedName": "Vehicle.Camera.SVMCamera"
    			}
    		},
    		{
    			"property": {
    				"fullyQualifiedName": "Vehicle.Camera.SVMCamera.ISO",
    				"dataType": "STRING"
    			}
    		}
    	],
    	"nodesToRemove": ["Vehicle.Chassis.SteeringWheel.HandsOffSteeringState"],
    	"nodesToUpdate": [{
    		"attribute": {
    			"dataType": "FLOAT",
    			"fullyQualifiedName": "Vehicle.Chassis.SteeringWheel.Diameter",
    			"max": 55
    		}
    	}]
    }
```

如果您使用客戶受管 AWS KMS 金鑰[啟用加密](key-management.md)，請包含下列政策陳述式，讓您的角色可以叫用 `UpdateSignalCatalog` API 操作。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "kms:GenerateDataKey*",
                "kms:Decrypt"
            ],
            "Resource": [
                "arn:aws:kms:us-east-1:111122223333:key/KMS_KEY_ID"
            ]
        }
    ]
}
```

------

## 驗證訊號目錄更新
<a name="verify-catalog-update"></a>

您可以使用 [ListSignalCatalogNodes](https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_ListSignalCatalogNodes.html) API 操作來驗證訊號目錄是否已更新。下列範例使用 AWS CLI。

若要擷取指定訊號目錄中所有訊號 （節點） 的分頁清單，請執行下列命令。

將 *signal-catalog-name* 取代為您檢查的訊號目錄名稱。

```
aws iotfleetwise list-signal-catalog-nodes --name signal-catalog-name
```

如果您使用客戶受管 AWS KMS 金鑰[啟用加密](key-management.md)，請包含下列政策陳述式，讓您的角色可以叫用 `ListSignalCatalogNodes` API 操作。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "kms:Decrypt"
            ],
            "Resource": [
                "arn:aws:kms:us-east-1:111122223333:key/KMS_KEY_ID"
            ]
        }
    ]
}
```

------

# 刪除 AWS IoT FleetWise 訊號目錄
<a name="delete-signal-catalog"></a>

您可以使用 [DeleteSignalCatalog](https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_DeleteSignalCatalog.html) API 操作來刪除訊號目錄。下列範例使用 AWS CLI。

**重要**  
在刪除訊號目錄之前，請確定它沒有相關聯的車輛模型、解碼器資訊清單、車輛、機群或行銷活動。如需詳細說明，請參閱下列主題：  
[刪除 an AWS IoT FleetWise 車輛模型](delete-vehicle-model.md)
[刪除 an AWS IoT FleetWise 解碼器資訊清單](delete-decoder-manifest.md)
[刪除 AWS IoT FleetWise 車輛](delete-vehicle.md)
[刪除 AWS IoT FleetWise 機群](delete-fleet-cli.md)
[刪除 an AWS IoT FleetWise 行銷活動](delete-campaign.md)

若要刪除現有的訊號目錄，請執行下列命令。將 *signal-catalog-name* 取代為您要刪除的訊號目錄名稱。

```
aws iotfleetwise delete-signal-catalog --name signal-catalog-name
```

## 驗證訊號目錄刪除
<a name="verify-catalog-update"></a>

您可以使用 [ListSignalCatalogs](https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_ListSignalCatalogs.html) API 操作來驗證是否已刪除訊號目錄。下列範例使用 AWS CLI。

若要擷取所有訊號目錄的分頁清單，請執行下列命令。

```
aws iotfleetwise list-signal-catalogs
```

如果您使用客戶受管 AWS KMS 金鑰[啟用加密](key-management.md)，請包含下列政策陳述式，讓您的角色可以叫用 `ListSignalCatalogs` API 操作。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "kms:Decrypt"
            ],
            "Resource": [
                "arn:aws:kms:us-east-1:111122223333:key/KMS_KEY_ID"
            ]
        }
    ]
}
```

------

# Get AWS IoT FleetWise 訊號目錄資訊
<a name="get-signal-catalog-information"></a>

您可以使用 [GetSignalCatalog](https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_GetSignalCatalog.html) API 操作來擷取訊號目錄資訊。下列範例使用 AWS CLI。

若要擷取訊號目錄的相關資訊，請執行下列命令。

將 *signal-catalog-name* 取代為您要擷取的訊號目錄名稱。

```
aws iotfleetwise get-signal-catalog --name signal-catalog-name
```

如果您使用客戶受管 AWS KMS 金鑰[啟用加密](key-management.md)，請包含下列政策陳述式，讓您的角色可以叫用 `GetSignalCatalog` API 操作。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "kms:Decrypt"
            ],
            "Resource": [
                "arn:aws:kms:us-east-1:111122223333:key/KMS_KEY_ID"
            ]
        }
    ]
}
```

------

**注意**  
此操作為[最終一致](https://web.stanford.edu/class/cs345d-01/rl/eventually-consistent.pdf)。換言之，可能不會立即反映訊號目錄的變更。