

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

# AWS IoT Wireless 使用 的範例 AWS CLI
<a name="cli_iot-wireless_code_examples"></a>

下列程式碼範例示範如何使用 AWS Command Line Interface 搭配 來執行動作和實作常見案例 AWS IoT Wireless。

*Actions* 是大型程式的程式碼摘錄，必須在內容中執行。雖然動作會告訴您如何呼叫個別服務函數，但您可以在其相關情境中查看內容中的動作。

每個範例均包含完整原始碼的連結，您可在連結中找到如何設定和執行內容中程式碼的相關指示。

**Topics**
+ [動作](#actions)

## 動作
<a name="actions"></a>

### `associate-aws-account-with-partner-account`
<a name="iot-wireless_AssociateAwsAccountWithPartnerAccount_cli_topic"></a>

以下程式碼範例顯示如何使用 `associate-aws-account-with-partner-account`。

**AWS CLI**  
**將合作夥伴帳戶與 AWS 您的帳戶建立關聯**  
下列`associate-aws-account-with-partner-account`範例會將下列 Sidewalk 帳戶登入資料與 AWS 您的帳戶建立關聯。  

```
aws iotwireless associate-aws-account-with-partner-account \
    --sidewalk AmazonId="12345678901234",AppServerPrivateKey="a123b45c6d78e9f012a34cd5e6a7890b12c3d45e6f78a1b234c56d7e890a1234"
```
輸出：  

```
{
    "Sidewalk": {
        "AmazonId": "12345678901234",
        "AppServerPrivateKey": "a123b45c6d78e9f012a34cd5e6a7890b12c3d45e6f78a1b234c56d7e890a1234"
    }
}
```
如需詳細資訊，請參閱 *AWS IoT 開發人員指南*中的 [Amazon Sidewalk Integration for AWS IoT Core](https://docs.aws.amazon.com/iot/latest/developerguide/iot-sidewalk.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [AssociateAwsAccountWithPartnerAccount](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/associate-aws-account-with-partner-account.html)。

### `associate-wireless-device-with-thing`
<a name="iot-wireless_AssociateWirelessDeviceWithThing_cli_topic"></a>

以下程式碼範例顯示如何使用 `associate-wireless-device-with-thing`。

**AWS CLI**  
**將物件與無線裝置相關聯**  
下列 `associate-wireless-device-with-thing` 範例會建立物件與具有指定 ID 的無線裝置的關聯。  

```
aws iotwireless associate-wireless-device-with-thing \
    --id "12345678-a1b2-3c45-67d8-e90fa1b2c34d" \
    --thing-arn "arn:aws:iot:us-east-1:123456789012:thing/MyIoTWirelessThing"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將閘道和無線裝置新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-onboard-devices.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [AssociateWirelessDeviceWithThing](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/associate-wireless-device-with-thing.html)。

### `associate-wireless-gateway-with-certificate`
<a name="iot-wireless_AssociateWirelessGatewayWithCertificate_cli_topic"></a>

以下程式碼範例顯示如何使用 `associate-wireless-gateway-with-certificate`。

**AWS CLI**  
**將憑證與無線閘道相關聯**  
下列 `associate-wireless-gateway-with-certificate` 會將無線閘道與憑證相關聯。  

```
aws iotwireless associate-wireless-gateway-with-certificate \
    --id "12345678-a1b2-3c45-67d8-e90fa1b2c34d" \
    --iot-certificate-id "a123b45c6d78e9f012a34cd5e6a7890b12c3d45e6f78a1b234c56d7e890a1234"
```
輸出：  

```
{
    "IotCertificateId": "a123b45c6d78e9f012a34cd5e6a7890b12c3d45e6f78a1b234c56d7e890a1234"
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將閘道和無線裝置新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-onboard-devices.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [AssociateWirelessGatewayWithCertificate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/associate-wireless-gateway-with-certificate.html)。

### `associate-wireless-gateway-with-thing`
<a name="iot-wireless_AssociateWirelessGatewayWithThing_cli_topic"></a>

以下程式碼範例顯示如何使用 `associate-wireless-gateway-with-thing`。

**AWS CLI**  
**將物件與無線閘道相關聯**  
下列 `associate-wireless-gateway-with-thing` 範例會將物件與無線閘道相關聯。  

```
aws iotwireless associate-wireless-gateway-with-thing \
    --id "12345678-a1b2-3c45-67d8-e90fa1b2c34d" \
    --thing-arn "arn:aws:iot:us-east-1:123456789012:thing/MyIoTWirelessThing"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將閘道和無線裝置新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-onboard-devices.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [AssociateWirelessGatewayWithThing](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/associate-wireless-gateway-with-thing.html)。

### `create-destination`
<a name="iot-wireless_CreateDestination_cli_topic"></a>

以下程式碼範例顯示如何使用 `create-destination`。

**AWS CLI**  
**建立 IoT 無線目的地**  
下列`create-destination`範例會建立將裝置訊息映射至 AWS IoT 規則的目的地。執行此命令之前，您必須已建立 IAM 角色，為 AWS IoT Core for LoRaWAN 提供將資料傳送至 AWS IoT 規則所需的許可。  

```
aws iotwireless create-destination \
    --name IoTWirelessDestination \
    --expression-type RuleName \
    --expression IoTWirelessRule \
    --role-arn arn:aws:iam::123456789012:role/IoTWirelessDestinationRole
```
輸出：  

```
{
    "Arn": "arn:aws:iotwireless:us-east-1:123456789012:Destination/IoTWirelessDestination",
    "Name": "IoTWirelessDestination"
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將目的地新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-create-destinations.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [CreateDestination](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/create-destination.html)。

### `create-device-profile`
<a name="iot-wireless_CreateDeviceProfile_cli_topic"></a>

以下程式碼範例顯示如何使用 `create-device-profile`。

**AWS CLI**  
**建立新的裝置設定檔**  
以下 `create-device-profile` 範例會建立新的 IoT 無線裝置設定檔。  

```
aws iotwireless create-device-profile
```
輸出：  

```
{
    "Arn": "arn:aws:iotwireless:us-east-1:123456789012:DeviceProfile/12345678-a1b2-3c45-67d8-e90fa1b2c34d",
    "Id": "12345678-a1b2-3c45-67d8-e90fa1b2c34d"
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將設定檔新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-define-profiles.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [CreateDeviceProfile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/create-device-profile.html)。

### `create-service-profile`
<a name="iot-wireless_CreateServiceProfile_cli_topic"></a>

以下程式碼範例顯示如何使用 `create-service-profile`。

**AWS CLI**  
**建立新的服務設定檔**  
以下 `create-service-profile` 範例會建立新的 IoT 無線服務設定檔。  

```
aws iotwireless create-service-profile
```
輸出：  

```
{
    "Arn": "arn:aws:iotwireless:us-east-1:123456789012:ServiceProfile/12345678-a1b2-3c45-67d8-e90fa1b2c34d",
    "Id": "12345678-a1b2-3c45-67d8-e90fa1b2c34d"
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將設定檔新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-define-profiles.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [CreateServiceProfile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/create-service-profile.html)。

### `create-wireless-device`
<a name="iot-wireless_CreateWirelessDevice_cli_topic"></a>

以下程式碼範例顯示如何使用 `create-wireless-device`。

**AWS CLI**  
**建立 IoT 無線裝置**  
以下 `create-wireless-device` 範例會建立類型 LoRaWAN 的無線裝置資源。  

```
aws iotwireless create-wireless-device \
    --cli-input-json file://input.json
```
`input.json` 的內容：  

```
{
    "Description": "My LoRaWAN wireless device"
    "DestinationName": "IoTWirelessDestination"
    "LoRaWAN": {
        "DeviceProfileId": "ab0c23d3-b001-45ef-6a01-2bc3de4f5333",
        "ServiceProfileId": "fe98dc76-cd12-001e-2d34-5550432da100",
        "OtaaV1_1": {
            "AppKey": "3f4ca100e2fc675ea123f4eb12c4a012",
            "JoinEui": "b4c231a359bc2e3d",
            "NwkKey": "01c3f004a2d6efffe32c4eda14bcd2b4"
        },
        "DevEui": "ac12efc654d23fc2"
    },
    "Name": "SampleIoTWirelessThing"
    "Type": LoRaWAN
}
```
輸出：  

```
{
    "Arn": "arn:aws:iotwireless:us-east-1:123456789012:WirelessDevice/1ffd32c8-8130-4194-96df-622f072a315f",
    "Id": "1ffd32c8-8130-4194-96df-622f072a315f"
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [CreateWirelessDevice](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/create-wireless-device.html)。

### `create-wireless-gateway-task-definition`
<a name="iot-wireless_CreateWirelessGatewayTaskDefinition_cli_topic"></a>

以下程式碼範例顯示如何使用 `create-wireless-gateway-task-definition`。

**AWS CLI**  
**建立無線閘道任務定義**  
以下 `create-wireless-gateway-task-definition` 會使用此任務定義為具有指定之目前版本的所有閘道，自動建立任務。  

```
aws iotwireless create-wireless-gateway-task-definition \
    --cli-input-json file://input.json
```
`input.json` 的內容：  

```
{
    "AutoCreateTasks": true,
    "Name": "TestAutoUpdate",
    "Update":{
        "UpdateDataSource" : "s3://cupsalphagafirmwarebin/station",
        "UpdateDataRole" : "arn:aws:iam::001234567890:role/SDK_Test_Role",
        "LoRaWAN" :{
            "CurrentVersion" :{
                "PackageVersion" : "1.0.0",
                "Station" : "2.0.5",
                "Model" : "linux"
            },
            "UpdateVersion" :{
                "PackageVersion" : "1.0.1",
                "Station" : "2.0.5",
                "Model" : "minihub"
            }
        }
    }
}
```
輸出：  

```
{
    "Id": "b7d3baad-25c7-35e7-a4e1-1683a0d61da9"
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《*AWS CLI 命令參考*》中的 [CreateWirelessGatewayTaskDefinition](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/create-wireless-gateway-task-definition.html)。

### `create-wireless-gateway-task`
<a name="iot-wireless_CreateWirelessGatewayTask_cli_topic"></a>

以下程式碼範例顯示如何使用 `create-wireless-gateway-task`。

**AWS CLI**  
**建立無線閘道的任務**  
以下 `create-wireless-gateway-task` 範例會建立無線閘道的裝置。  

```
aws iotwireless create-wireless-gateway-task \
    --id "12345678-a1b2-3c45-67d8-e90fa1b2c34d" \
    --wireless-gateway-task-definition-id "aa000102-0304-b0cd-ef56-a1b23cde456a"
```
輸出：  

```
{
    "WirelessGatewayTaskDefinitionId": "aa204003-0604-30fb-ac82-a4f95aaf450a",
    "Status": "Success"
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [CreateWirelessGatewayTask](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/create-wireless-gateway-task.html)。

### `create-wireless-gateway`
<a name="iot-wireless_CreateWirelessGateway_cli_topic"></a>

以下程式碼範例顯示如何使用 `create-wireless-gateway`。

**AWS CLI**  
**建立無線閘道**  
以下 `create-wireless-gateway` 範例會建立無線 LoRaWAN 裝置閘道。  

```
aws iotwireless create-wireless-gateway \
    --lorawan GatewayEui="a1b2c3d4567890ab",RfRegion="US915" \
    --name "myFirstLoRaWANGateway" \
    --description "Using my first LoRaWAN gateway"
```
輸出：  

```
{
    "Arn": "arn:aws:iotwireless:us-east-1:123456789012:WirelessGateway/12345678-a1b2-3c45-67d8-e90fa1b2c34d",
    "Id": "12345678-a1b2-3c45-67d8-e90fa1b2c34d"
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [CreateWirelessGateway](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/create-wireless-gateway.html)。

### `delete-destination`
<a name="iot-wireless_DeleteDestination_cli_topic"></a>

以下程式碼範例顯示如何使用 `delete-destination`。

**AWS CLI**  
**刪除 IoT 無線目的地**  
下列 `delete-destination` 範例會刪除具有您建立的名稱 `IoTWirelessDestination` 的無線目的地資源。  

```
aws iotwireless delete-destination \
    --name "IoTWirelessDestination"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將目的地新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-create-destinations.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DeleteDestination](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/delete-destination.html)。

### `delete-device-profile`
<a name="iot-wireless_DeleteDeviceProfile_cli_topic"></a>

以下程式碼範例顯示如何使用 `delete-device-profile`。

**AWS CLI**  
**刪除裝置設定檔**  
下列 `delete-device-profile` 範例會刪除具有您建立之指定 ID 的裝置設定檔。  

```
aws iotwireless delete-device-profile \
    --id "12345678-a1b2-3c45-67d8-e90fa1b2c34d"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將設定檔新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-define-profiles.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DeleteDeviceProfile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/delete-device-profile.html)。

### `delete-service-profile`
<a name="iot-wireless_DeleteServiceProfile_cli_topic"></a>

以下程式碼範例顯示如何使用 `delete-service-profile`。

**AWS CLI**  
**刪除服務設定檔**  
下列 `delete-service-profile` 範例會刪除具有您建立之指定 ID 的服務設定檔。  

```
aws iotwireless delete-service-profile \
    --id "12345678-a1b2-3c45-67d8-e90fa1b2c34d"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將設定檔新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-define-profiles.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DeleteServiceProfile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/delete-service-profile.html)。

### `delete-wireless-device`
<a name="iot-wireless_DeleteWirelessDevice_cli_topic"></a>

以下程式碼範例顯示如何使用 `delete-wireless-device`。

**AWS CLI**  
**刪除無線裝置**  
下列 `delete-wireless-device` 範例會刪除具有指定 ID 的無線裝置。  

```
aws iotwireless delete-wireless-device \
    --id "12345678-a1b2-3c45-67d8-e90fa1b2c34d"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DeleteWirelessDevice](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/delete-wireless-device.html)。

### `delete-wireless-gateway-task-definition`
<a name="iot-wireless_DeleteWirelessGatewayTaskDefinition_cli_topic"></a>

以下程式碼範例顯示如何使用 `delete-wireless-gateway-task-definition`。

**AWS CLI**  
**刪除無線閘道任務定義。**  
下列 `delete-wireless-gateway-task-definition` 範例會刪除您使用下列 ID 建立的無線閘道任務定義。  

```
aws iotwireless delete-wireless-gateway-task-definition \
    --id "12345678-a1b2-3c45-67d8-e90fa1b2c34d"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DeleteWirelessGatewayTaskDefinition](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/delete-wireless-gateway-task-definition.html)。

### `delete-wireless-gateway-task`
<a name="iot-wireless_DeleteWirelessGatewayTask_cli_topic"></a>

以下程式碼範例顯示如何使用 `delete-wireless-gateway-task`。

**AWS CLI**  
**刪除無線閘道任務**  
下列 `delete-wireless-gateway-task` 範例會刪除具有指定 ID 的無線閘道任務。  

```
aws iotwireless delete-wireless-gateway-task \
    --id "12345678-a1b2-3c45-67d8-e90fa1b2c34d"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DeleteWirelessGatewayTask](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/delete-wireless-gateway-task.html)。

### `delete-wireless-gateway`
<a name="iot-wireless_DeleteWirelessGateway_cli_topic"></a>

以下程式碼範例顯示如何使用 `delete-wireless-gateway`。

**AWS CLI**  
**刪除無線閘道**  
下列 `delete-wireless-gateway` 範例會刪除具有指定 ID 的無線閘道。  

```
aws iotwireless delete-wireless-gateway \
    --id "12345678-a1b2-3c45-67d8-e90fa1b2c34d"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DeleteWirelessGateway](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/delete-wireless-gateway.html)。

### `disassociate-aws-account-from-partner-account`
<a name="iot-wireless_DisassociateAwsAccountFromPartnerAccount_cli_topic"></a>

以下程式碼範例顯示如何使用 `disassociate-aws-account-from-partner-account`。

**AWS CLI**  
**取消合作夥伴帳戶與 AWS 帳戶的關聯**  
下列`disassociate-aws-account-from-partner-account`範例會取消合作夥伴帳戶與您目前關聯 AWS 帳戶的關聯。  

```
aws iotwireless disassociate-aws-account-from-partner-account \
    --partner-account-id "12345678901234" \
    --partner-type "Sidewalk"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將閘道和無線裝置新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-onboard-devices.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《*AWS CLI 命令參考*》中的 [DisassociateAwsAccountFromPartnerAccount](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/disassociate-aws-account-from-partner-account.html)。

### `disassociate-wireless-device-from-thing`
<a name="iot-wireless_DisassociateWirelessDeviceFromThing_cli_topic"></a>

以下程式碼範例顯示如何使用 `disassociate-wireless-device-from-thing`。

**AWS CLI**  
**取消物件與無線裝置的關聯**  
下列 `disassociate-wireless-device-from-thing` 範例會取消無線裝置與其目前關聯物件的關聯。  

```
aws iotwireless disassociate-wireless-device-from-thing \
    --id "12345678-a1b2-3c45-67d8-e90fa1b2c34d"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將閘道和無線裝置新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-onboard-devices.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《*AWS CLI 命令參考*》中的 [DisassociateWirelessDeviceFromThing](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/disassociate-wireless-device-from-thing.html)。

### `disassociate-wireless-gateway-from-certificate`
<a name="iot-wireless_DisassociateWirelessGatewayFromCertificate_cli_topic"></a>

以下程式碼範例顯示如何使用 `disassociate-wireless-gateway-from-certificate`。

**AWS CLI**  
**取消憑證與無線閘道的關聯**  
以下 `disassociate-wireless-gateway-from-certificate` 會取消無線閘道與其目前關聯的憑證的關聯。  

```
aws iotwireless disassociate-wireless-gateway-from-certificate \
    --id "12345678-a1b2-3c45-67d8-e90fa1b2c34d"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將閘道和無線裝置新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-onboard-devices.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《*AWS CLI 命令參考*》中的 [DisassociateWirelessGatewayFromCertificate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/disassociate-wireless-gateway-from-certificate.html)。

### `disassociate-wireless-gateway-from-thing`
<a name="iot-wireless_DisassociateWirelessGatewayFromThing_cli_topic"></a>

以下程式碼範例顯示如何使用 `disassociate-wireless-gateway-from-thing`。

**AWS CLI**  
**取消物件與無線閘道的關聯**  
下列 `disassociate-wireless-gateway-from-thing` 範例會取消無線閘道與其目前關聯物件的關聯。  

```
aws iotwireless disassociate-wireless-gateway-from-thing \
    --id "12345678-a1b2-3c45-67d8-e90fa1b2c34d"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將閘道和無線裝置新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-onboard-devices.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《*AWS CLI 命令參考*》中的 [DisassociateWirelessGatewayFromThing](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/disassociate-wireless-gateway-from-thing.html)。

### `get-destination`
<a name="iot-wireless_GetDestination_cli_topic"></a>

以下程式碼範例顯示如何使用 `get-destination`。

**AWS CLI**  
**取得 IoT 無線目的地的相關資訊**  
下列 `get-destination` 範例會透過您建立的名稱 `IoTWirelessDestination`，取得目的地資源的相關資訊。  

```
aws iotwireless get-destination \
    --name "IoTWirelessDestination"
```
輸出：  

```
{
    "Arn": "arn:aws:iotwireless:us-east-1:123456789012:Destination/IoTWirelessDestination",
    "Name": "IoTWirelessDestination",
    "Expression": "IoTWirelessRule",
    "ExpressionType": "RuleName",
    "RoleArn": "arn:aws:iam::123456789012:role/IoTWirelessDestinationRole"
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將目的地新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-create-destinations.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [GetDestination](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/get-destination.html)。

### `get-device-profile`
<a name="iot-wireless_GetDeviceProfile_cli_topic"></a>

以下程式碼範例顯示如何使用 `get-device-profile`。

**AWS CLI**  
**取得執行個體設定檔的相關資訊**  
下列 `get-device-profile` 範例會使用您建立的指定 ID，取得裝置設定檔的相關資訊。  

```
aws iotwireless get-device-profile \
    --id "12345678-a1b2-3c45-67d8-e90fa1b2c34d"
```
輸出：  

```
{
    "Arn": "arn:aws:iotwireless:us-east-1:123456789012:DeviceProfile/12345678-a1b2-3c45-67d8-e90fa1b2c34d",
    "Id": "12345678-a1b2-3c45-67d8-e90fa1b2c34d",
    "LoRaWAN": {
    "MacVersion": "1.0.3",
    "MaxDutyCycle": 10,
    "Supports32BitFCnt": false,
    "RegParamsRevision": "RP002-1.0.1",
    "SupportsJoin": true,
    "RfRegion": "US915",
    "MaxEirp": 13,
    "SupportsClassB": false,
    "SupportsClassC": false
    }
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將設定檔新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-define-profiles.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [GetDeviceProfile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/get-device-profile.html)。

### `get-partner-account`
<a name="iot-wireless_GetPartnerAccount_cli_topic"></a>

以下程式碼範例顯示如何使用 `get-partner-account`。

**AWS CLI**  
**取得合作夥伴帳戶資訊**  
下列 `get-partner-account` 範例會取得具有下列 ID 之 Sidewalk 帳戶的相關資訊。  

```
aws iotwireless get-partner-account \
    --partner-account-id "12345678901234" \
    --partner-type "Sidewalk"
```
輸出：  

```
{
    "Sidewalk": {
        "AmazonId": "12345678901234",
        "Fingerprint": "a123b45c6d78e9f012a34cd5e6a7890b12c3d45e6f78a1b234c56d7e890a1234"
    },
    "AccountLinked": false
}
```
如需詳細資訊，請參閱 *AWS IoT 開發人員指南*中的 [Amazon Sidewalk Integration for AWS IoT Core](https://docs.aws.amazon.com/iot/latest/developerguide/iot-sidewalk.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [GetPartnerAccount](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/get-partner-account.html)。

### `get-service-endpoint`
<a name="iot-wireless_GetServiceEndpoint_cli_topic"></a>

以下程式碼範例顯示如何使用 `get-service-endpoint`。

**AWS CLI**  
**設定服務端點**  
下列 `get-service-endpoint` 範例會取得適用於 CUPS 通訊協定的帳戶特定端點。  

```
aws iotwireless get-service-endpoint
```
輸出：  

```
{
    "ServiceType": "CUPS",
    "ServiceEndpoint": "https://A1RMKZ37ACAGOT.cups.lorawan.us-east-1.amazonaws.com:443",
    "ServerTrust": "-----BEGIN CERTIFICATE-----\n
    MIIESTCCAzGgAwIBAgITBn+UV4WH6Kx33rJTMlu8mYtWDTANBgkqhkiG9w0BAQsF\n
    ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n
    b24gUm9vdCBDQSAxMB4XDTE1MTAyMjAwMDAwMFoXDTI1MTAxOTAwMDAwMFowRjEL\n
    MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEVMBMGA1UECxMMU2VydmVyIENB\n
    IDFCMQ8wDQYDVQQDEwZBbWF6b24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK\n
    AoIBAQDCThZn3c68asg3Wuw6MLAd5tES6BIoSMzoKcG5blPVo+sDORrMd4f2AbnZ\n
    cMzPa43j4wNxhplty6aUKk4T1qe9BOwKFjwK6zmxxLVYo7bHViXsPlJ6qOMpFge5\n
    blDP+18x+B26A0piiQOuPkfyDyeR4xQghfj66Yo19V+emU3nazfvpFA+ROz6WoVm\n
    B5x+F2pV8xeKNR7u6azDdU5YVX1TawprmxRC1+WsAYmz6qP+z8ArDITC2FMVy2fw\n
    0IjKOtEXc/VfmtTFch5+AfGYMGMqqvJ6LcXiAhqG5TI+Dr0RtM88k+8XUBCeQ8IG\n
    KuANaL7TiItKZYxK1MMuTJtV9IblAgMBAAGjggE7MIIBNzASBgNVHRMBAf8ECDAG\n
    AQH/AgEAMA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUWaRmBlKge5WSPKOUByeW\n
    dFv5PdAwHwYDVR0jBBgwFoAUhBjMhTTsvAyUlC4IWZzHshBOCggwewYIKwYBBQUH\n
    AQEEbzBtMC8GCCsGAQUFBzABhiNodHRwOi8vb2NzcC5yb290Y2ExLmFtYXpvbnRy\n
    dXN0LmNvbTA6BggrBgEFBQcwAoYuaHR0cDovL2NydC5yb290Y2ExLmFtYXpvbnRy\n
    dXN0LmNvbS9yb290Y2ExLmNlcjA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3Js\n
    LnJvb3RjYTEuYW1hem9udHJ1c3QuY29tL3Jvb3RjYTEuY3JsMBMGA1UdIAQMMAow\n
    CAYGZ4EMAQIBMA0GCSqGSIb3DQEBCwUAA4IBAQCFkr41u3nPo4FCHOTjY3NTOVI1\n
    59Gt/a6ZiqyJEi+752+a1U5y6iAwYfmXss2lJwJFqMp2PphKg5625kXg8kP2CN5t\n
    6G7bMQcT8C8xDZNtYTd7WPD8UZiRKAJPBXa30/AbwuZe0GaFEQ8ugcYQgSn+IGBI\n
    8/LwhBNTZTUVEWuCUUBVV18YtbAiPq3yXqMB48Oz+ctBWuZSkbvkNodPLamkB2g1\n
    upRyzQ7qDn1X8nn8N8V7YJ6y68AtkHcNSRAnpTitxBKjtKPISLMVCx7i4hncxHZS\n
    yLyKQXhw2W2Xs0qLeC1etA+jTGDK4UfLeC0SF7FSi8o5LL21L8IzApar2pR/\n
    -----END CERTIFICATE-----\n"
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [GetServiceEndpoint](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/get-service-endpoint.html)。

### `get-service-profile`
<a name="iot-wireless_GetServiceProfile_cli_topic"></a>

以下程式碼範例顯示如何使用 `get-service-profile`。

**AWS CLI**  
**取得服務設定檔的相關資訊**  
下列 `get-service-profile` 範例會使用您建立的指定 ID，取得服務設定檔的相關資訊。  

```
aws iotwireless get-service-profile \
    --id "12345678-a1b2-3c45-67d8-e90fa1b2c34d"
```
輸出：  

```
{
    "Arn": "arn:aws:iotwireless:us-east-1:651419225604:ServiceProfile/538185bb-d7e7-4b95-96a0-c51aa4a5b9a0",
    "Id": "12345678-a1b2-3c45-67d8-e90fa1b2c34d",
    "LoRaWAN": {
        "HrAllowed": false,
        "NwkGeoLoc": false,
        "DrMax": 15,
        "UlBucketSize": 4096,
        "PrAllowed": false,
        "ReportDevStatusBattery": false,
        "DrMin": 0,
        "DlRate": 60,
        "AddGwMetadata": false,
        "ReportDevStatusMargin": false,
        "MinGwDiversity": 1,
        "RaAllowed": false,
        "DlBucketSize": 4096,
        "DevStatusReqFreq": 24,
        "TargetPer": 5,
        "UlRate": 60
    }
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將設定檔新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-define-profiles.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [GetServiceProfile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/get-service-profile.html)。

### `get-wireless-device-statistics`
<a name="iot-wireless_GetWirelessDeviceStatistics_cli_topic"></a>

以下程式碼範例顯示如何使用 `get-wireless-device-statistics`。

**AWS CLI**  
**取得無線裝置的操作資訊**  
下列 `get-wireless-device-statistics` 範例取得無線裝置的操作資訊。  

```
aws iotwireless get-wireless-device-statistics \
    --wireless-device-id "1ffd32c8-8130-4194-96df-622f072a315f"
```
輸出：  

```
{
    "WirelessDeviceId": "1ffd32c8-8130-4194-96df-622f072a315f"
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [GetWirelessDeviceStatistics](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/get-wireless-device-statistics.html)。

### `get-wireless-device`
<a name="iot-wireless_GetWirelessDevice_cli_topic"></a>

以下程式碼範例顯示如何使用 `get-wireless-device`。

**AWS CLI**  
**取得無線裝置的相關資訊**  
下列`get-wireless-device`範例列出您 AWS 帳戶中可用的小工具。  

```
aws iotwireless get-wireless-device \
    --identifier "1ffd32c8-8130-4194-96df-622f072a315f" \
    --identifier-type WirelessDeviceID
```
輸出：  

```
{
    "Name": "myLoRaWANDevice",
    "ThingArn": "arn:aws:iot:us-east-1:123456789012:thing/44b87eb4-9bce-423d-b5fc-973f5ecc358b",
    "DestinationName": "IoTWirelessDestination",
    "Id": "1ffd32c8-8130-4194-96df-622f072a315f",
    "ThingName": "44b87eb4-9bce-423d-b5fc-973f5ecc358b",
    "Type": "LoRaWAN",
    "LoRaWAN": {
        "DeviceProfileId": "ab0c23d3-b001-45ef-6a01-2bc3de4f5333",
        "ServiceProfileId": "fe98dc76-cd12-001e-2d34-5550432da100",
        "OtaaV1_1": {
            "AppKey": "3f4ca100e2fc675ea123f4eb12c4a012",
            "JoinEui": "b4c231a359bc2e3d",
            "NwkKey": "01c3f004a2d6efffe32c4eda14bcd2b4"
        },
        "DevEui": "ac12efc654d23fc2"
    },
    "Arn": "arn:aws:iotwireless:us-east-1:123456789012:WirelessDevice/1ffd32c8-8130-4194-96df-622f072a315f",
    "Description": "My LoRaWAN wireless device"
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [GetWirelessDevice](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/get-wireless-device.html)。

### `get-wireless-gateway-certificate`
<a name="iot-wireless_GetWirelessGatewayCertificate_cli_topic"></a>

以下程式碼範例顯示如何使用 `get-wireless-gateway-certificate`。

**AWS CLI**  
**取得與無線閘道相關聯的憑證 ID**  
下列 `get-wireless-gateway-certificate` 範例會取得與具有指定 ID 之無線閘道相關聯的憑證 ID。  

```
aws iotwireless get-wireless-gateway-certificate \
    --id "6c44ab31-8b4d-407a-bed3-19b6c7cda551"
```
輸出：  

```
{
    "IotCertificateId": "8ea4aeae3db34c78cce75d9abd830356869ead6972997e0603e5fd032c804b6f"
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [GetWirelessGatewayCertificate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/get-wireless-gateway-certificate.html)。

### `get-wireless-gateway-firmware-information`
<a name="iot-wireless_GetWirelessGatewayFirmwareInformation_cli_topic"></a>

以下程式碼範例顯示如何使用 `get-wireless-gateway-firmware-information`。

**AWS CLI**  
**取得無線閘道的韌體資訊**  
下列 `get-wireless-gateway-firmware-information` 範例會取得韌體版本和無線閘道的其他資訊。  

```
aws iotwireless get-wireless-gateway-firmware-information \
    --id "3039b406-5cc9-4307-925b-9948c63da25b"
```
輸出：  

```
{
    "LoRaWAN" :{
        "CurrentVersion" :{
            "PackageVersion" : "1.0.0",
            "Station" : "2.0.5",
            "Model" : "linux"
        }
    }
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [GetWirelessGatewayFirmwareInformation](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/get-wireless-gateway-firmware-information.html)。

### `get-wireless-gateway-statistics`
<a name="iot-wireless_GetWirelessGatewayStatistics_cli_topic"></a>

以下程式碼範例顯示如何使用 `get-wireless-gateway-statistics`。

**AWS CLI**  
**取得無線閘道的運作資訊**  
下列 `get-wireless-gateway-statistics` 範例取得無線閘道的運作資訊。  

```
aws iotwireless get-wireless-gateway-statistics \
    --wireless-gateway-id "3039b406-5cc9-4307-925b-9948c63da25b"
```
輸出：  

```
{
    "WirelessGatewayId": "3039b406-5cc9-4307-925b-9948c63da25b"
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [GetWirelessGatewayStatistics](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/get-wireless-gateway-statistics.html)。

### `get-wireless-gateway-task-definition`
<a name="iot-wireless_GetWirelessGatewayTaskDefinition_cli_topic"></a>

以下程式碼範例顯示如何使用 `get-wireless-gateway-task-definition`。

**AWS CLI**  
**取得無線閘道任務定義的相關資訊。**  
下列 `get-wireless-gateway-task-definition` 範例會取得具有指定 ID 之無線任務定義的相關資訊。  

```
aws iotwireless get-wireless-gateway-task-definition \
    --id "b7d3baad-25c7-35e7-a4e1-1683a0d61da9"
```
輸出：  

```
{
    "AutoCreateTasks": true,
    "Name": "TestAutoUpdate",
    "Update":{
        "UpdateDataSource" : "s3://cupsalphagafirmwarebin/station",
        "UpdateDataRole" : "arn:aws:iam::001234567890:role/SDK_Test_Role",
        "LoRaWAN" :{
            "CurrentVersion" :{
                "PackageVersion" : "1.0.0",
                "Station" : "2.0.5",
                "Model" : "linux"
            },
            "UpdateVersion" :{
                "PackageVersion" : "1.0.1",
                "Station" : "2.0.5",
                "Model" : "minihub"
            }
        }
    }
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《*AWS CLI 命令參考*》中的 [GetWirelessGatewayTaskDefinition](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/get-wireless-gateway-task-definition.html)。

### `get-wireless-gateway-task`
<a name="iot-wireless_GetWirelessGatewayTask_cli_topic"></a>

以下程式碼範例顯示如何使用 `get-wireless-gateway-task`。

**AWS CLI**  
**取得無線閘道任務的相關資訊**  
下列 `get-wireless-gateway-task` 範例會取得具有指定 ID 之無線閘道任務的相關資訊。  

```
aws iotwireless get-wireless-gateway-task \
    --id "11693a46-6866-47c3-a031-c9a616e7644b"
```
輸出：  

```
{
    "WirelessGatewayId": "6c44ab31-8b4d-407a-bed3-19b6c7cda551",
    "WirelessGatewayTaskDefinitionId": "b7d3baad-25c7-35e7-a4e1-1683a0d61da9",
    "Status": "Success"
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [GetWirelessGatewayTask](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/get-wireless-gateway-task.html)。

### `get-wireless-gateway`
<a name="iot-wireless_GetWirelessGateway_cli_topic"></a>

以下程式碼範例顯示如何使用 `get-wireless-gateway`。

**AWS CLI**  
**取得無線閘道的相關資訊**  
下列 `get-wireless-gateway` 範例會取得無線閘道 `myFirstLoRaWANGateway` 的相關資訊。  

```
aws iotwireless get-wireless-gateway \
    --identifier "12345678-a1b2-3c45-67d8-e90fa1b2c34d" \
    --identifier-type WirelessGatewayId
```
輸出：  

```
{
    "Description": "My first LoRaWAN gateway",
    "ThingArn": "arn:aws:iot:us-east-1:123456789012:thing/a1b2c3d4-5678-90ab-cdef-12ab345c67de",
    "LoRaWAN": {
        "RfRegion": "US915",
        "GatewayEui": "a1b2c3d4567890ab"
    },
    "ThingName": "a1b2c3d4-5678-90ab-cdef-12ab345c67de",
    "Id": "12345678-a1b2-3c45-67d8-e90fa1b2c34d",
    "Arn": "arn:aws:iotwireless:us-east-1:123456789012:WirelessGateway/6c44ab31-8b4d-407a-bed3-19b6c7cda551",
    "Name": "myFirstLoRaWANGateway"
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [GetWirelessGateway](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/get-wireless-gateway.html)。

### `list-destinations`
<a name="iot-wireless_ListDestinations_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-destinations`。

**AWS CLI**  
**列出無線目的地**  
下列`list-destinations`範例列出註冊至您 AWS 帳戶的可用目的地。  

```
aws iotwireless list-destinations
```
輸出：  

```
{
    "DestinationList": [
        {
            "Arn": "arn:aws:iotwireless:us-east-1:123456789012:Destination/IoTWirelessDestination",
            "Name": "IoTWirelessDestination",
            "Expression": "IoTWirelessRule",
            "Description": "Destination for messages processed using IoTWirelessRule",
            "RoleArn": "arn:aws:iam::123456789012:role/IoTWirelessDestinationRole"
        },
        {
            "Arn": "arn:aws:iotwireless:us-east-1:123456789012:Destination/IoTWirelessDestination2",
            "Name": "IoTWirelessDestination2",
            "Expression": "IoTWirelessRule2",
            "RoleArn": "arn:aws:iam::123456789012:role/IoTWirelessDestinationRole"
        }
    ]
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將目的地新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-create-destinations.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListDestinations](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/list-destinations.html)。

### `list-device-profiles`
<a name="iot-wireless_ListDeviceProfiles_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-device-profiles`。

**AWS CLI**  
**列出裝置設定檔**  
下列`list-device-profiles`範例列出註冊至您 AWS 帳戶的可用裝置設定檔。  

```
aws iotwireless list-device-profiles
```
輸出：  

```
{
    "DeviceProfileList": [
        {
            "Id": "12345678-a1b2-3c45-67d8-e90fa1b2c34d",
            "Arn": "arn:aws:iotwireless:us-east-1:123456789012:DeviceProfile/12345678-a1b2-3c45-67d8-e90fa1b2c34d"
        },
        {
            "Id": "a1b2c3d4-5678-90ab-cdef-12ab345c67de",
            "Arn": "arn:aws:iotwireless:us-east-1:123456789012:DeviceProfile/a1b2c3d4-5678-90ab-cdef-12ab345c67de"
        }
    ]
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將設定檔新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-define-profiles.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListDeviceProfiles](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/list-device-profiles.html)。

### `list-partner-accounts`
<a name="iot-wireless_ListPartnerAccounts_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-partner-accounts`。

**AWS CLI**  
**列出合作夥伴帳戶**  
下列`list-partner-accounts`範例列出與您的帳戶相關聯的可用合作夥伴 AWS 帳戶。  

```
aws iotwireless list-partner-accounts
```
輸出：  

```
{
    "Sidewalk": [
        {
            "AmazonId": "78965678771228",
            "Fingerprint": "bd96d8ef66dbfd2160eb60e156849e82ad7018b8b73c1ba0b4fc65c32498ee35"
        },
        {
            "AmazonId": "89656787651228",
            "Fingerprint": "bc5e99e151c07be14be7e6603e4489c53f858b271213a36ebe3370777ba06e9b"
        }
    ]
}
```
如需詳細資訊，請參閱 *AWS IoT 開發人員指南*中的 [Amazon Sidewalk Integration for AWS IoT Core](https://docs.aws.amazon.com/iot/latest/developerguide/iot-sidewalk.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListPartnerAccounts](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/list-partner-accounts.html)。

### `list-service-profiles`
<a name="iot-wireless_ListServiceProfiles_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-service-profiles`。

**AWS CLI**  
**列出服務設定檔**  
下列`list-service-profiles`範例列出註冊至您 AWS 帳戶的可用服務設定檔。  

```
aws iotwireless list-service-profiles
```
輸出：  

```
{
    "ServiceProfileList": [
        {
            "Id": "12345678-a1b2-3c45-67d8-e90fa1b2c34d",
            "Arn": "arn:aws:iotwireless:us-east-1:123456789012:ServiceProfile/538185bb-d7e7-4b95-96a0-c51aa4a5b9a0"
        },
        {
            "Id": "a1b2c3d4-5678-90ab-cdef-12ab345c67de",
            "Arn": "arn:aws:iotwireless:us-east-1:123456789012:ServiceProfile/ea8bc823-5d13-472e-8d26-9550737d8100"
        }
    ]
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將設定檔新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-define-profiles.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListServiceProfiles](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/list-service-profiles.html)。

### `list-tags-for-resource`
<a name="iot-wireless_ListTagsForResource_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-tags-for-resource`。

**AWS CLI**  
**列出指派給資源的標籤**  
下列 `list-tags-for-resource` 範例列出指派給無線目的地資源的標籤。  

```
aws iotwireless list-tags-for-resource \
    --resource-arn "arn:aws:iotwireless:us-east-1:123456789012:Destination/IoTWirelessDestination"
```
輸出：  

```
{
    "Tags": [
        {
            "Value": "MyValue",
            "Key": "MyTag"
        }
    ]
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的描述您的 IoT Core for LoRaWAN 資源](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-describe-resource.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListTagsForResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/list-tags-for-resource.html)。

### `list-wireless-devices`
<a name="iot-wireless_ListWirelessDevices_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-wireless-devices`。

**AWS CLI**  
**列出可用的無線裝置**  
下列`list-wireless-devices`範例列出向 AWS 您的帳戶註冊的可用無線裝置。  

```
aws iotwireless list-wireless-devices
```
輸出：  

```
{
    "WirelessDeviceList": [
        {
            "Name": "myLoRaWANDevice",
            "DestinationName": "IoTWirelessDestination",
            "Id": "1ffd32c8-8130-4194-96df-622f072a315f",
            "Type": "LoRaWAN",
            "LoRaWAN": {
                "DevEui": "ac12efc654d23fc2"
            },
            "Arn": "arn:aws:iotwireless:us-east-1:123456789012:WirelessDevice/1ffd32c8-8130-4194-96df-622f072a315f"
        }
    ]
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListWirelessDevices](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/list-wireless-devices.html)。

### `list-wireless-gateway-task-definitions`
<a name="iot-wireless_ListWirelessGatewayTaskDefinitions_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-wireless-gateway-task-definitions`。

**AWS CLI**  
**列出無線閘道任務定義**  
下列`list-wireless-gateway-task-definitions`範例列出向 AWS 您的帳戶註冊的可用無線閘道任務定義。  

```
aws iotwireless list-wireless-gateway-task-definitions
```
輸出：  

```
{
    "TaskDefinitions": [
        {
            "Id": "b7d3baad-25c7-35e7-a4e1-1683a0d61da9",
            "LoRaWAN" :
                {
                "CurrentVersion" :{
                    "PackageVersion" : "1.0.0",
                    "Station" : "2.0.5",
                    "Model" : "linux"
                },
                "UpdateVersion" :{
                    "PackageVersion" : "1.0.1",
                    "Station" : "2.0.5",
                    "Model" : "minihub"
                }
            }
        }
    ]
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListWirelessGatewayTaskDefinitions](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/list-wireless-gateway-task-definitions.html)。

### `list-wireless-gateways`
<a name="iot-wireless_ListWirelessGateways_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-wireless-gateways`。

**AWS CLI**  
**列出無線閘道**  
下列`list-wireless-gateways`範例列出您 AWS 帳戶中可用的無線閘道。  

```
aws iotwireless list-wireless-gateways
```
輸出：  

```
{
    "WirelessGatewayList": [
        {
            "Description": "My first LoRaWAN gateway",
            "LoRaWAN": {
                "RfRegion": "US915",
                "GatewayEui": "dac632ebc01d23e4"
            },
            "Id": "3039b406-5cc9-4307-925b-9948c63da25b",
            "Arn": "arn:aws:iotwireless:us-east-1:123456789012:WirelessGateway/3039b406-5cc9-4307-925b-9948c63da25b",
            "Name": "myFirstLoRaWANGateway"
        },
        {
            "Description": "My second LoRaWAN gateway",
            "LoRaWAN": {
                "RfRegion": "US915",
                "GatewayEui": "cda123fffe92ecd2"
            },
            "Id": "3285bdc7-5a12-4991-84ed-dadca65e342e",
            "Arn": "arn:aws:iotwireless:us-east-1:123456789012:WirelessGateway/3285bdc7-5a12-4991-84ed-dadca65e342e",
            "Name": "mySecondLoRaWANGateway"
        }
    ]
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListWirelessGateways](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/list-wireless-gateways.html)。

### `send-data-to-wireless-device`
<a name="iot-wireless_SendDataToWirelessDevice_cli_topic"></a>

以下程式碼範例顯示如何使用 `send-data-to-wireless-device`。

**AWS CLI**  
**將資料傳送至無線裝置**  
下列 `send-data-to-wireless-device` 範例會將解密的應用程式資料框傳送至無線裝置。  

```
aws iotwireless send-data-to-wireless-device \
    --id "11aa5eae-2f56-4b8e-a023-b28d98494e49" \
    --transmit-mode "1" \
    --payload-data "SGVsbG8gVG8gRGV2c2lt" \
    --wireless-metadata LoRaWAN={FPort=1}
```
輸出：  

```
{
    MessageId: "6011dd36-0043d6eb-0072-0008"
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《*AWS CLI 命令參考*》中的 [SendDataToWirelessDevice](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/send-data-to-wireless-device.html)。

### `tag-resource`
<a name="iot-wireless_TagResource_cli_topic"></a>

以下程式碼範例顯示如何使用 `tag-resource`。

**AWS CLI**  
**指定資源的標籤鍵和值**  
下列 `tag-resource` 範例使用索引鍵 `MyTag` 和值 `MyValue` 來標記無線目的地 `IoTWirelessDestination`。  

```
aws iotwireless tag-resource \
    --resource-arn "arn:aws:iotwireless:us-east-1:651419225604:Destination/IoTWirelessDestination" \
    --tags Key="MyTag",Value="MyValue"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的描述您的 IoT Core for LoRaWAN 資源](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-describe-resource.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [TagResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/tag-resource.html)。

### `test-wireless-device`
<a name="iot-wireless_TestWirelessDevice_cli_topic"></a>

以下程式碼範例顯示如何使用 `test-wireless-device`。

**AWS CLI**  
**測試無線裝置**  
下列 `test-wireless-device` 範例會將 `Hello` 的上行資料，傳送至具有指定 ID 的裝置。  

```
aws iotwireless test-wireless-device \
    --id "11aa5eae-2f56-4b8e-a023-b28d98494e49"
```
輸出：  

```
{
    Result: "Test succeeded. one message is sent with payload: hello"
}
```
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [TestWirelessDevice](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/test-wireless-device.html)。

### `untag-resource`
<a name="iot-wireless_UntagResource_cli_topic"></a>

以下程式碼範例顯示如何使用 `untag-resource`。

**AWS CLI**  
**移除資源的一或多個標籤**  
下列 `untag-resource` 範例會從無線目的地 `IoTWirelessDestination` 移除標籤 `MyTag` 及其值。  

```
aws iotwireless untag-resource \
    --resource-arn "arn:aws:iotwireless:us-east-1:123456789012:Destination/IoTWirelessDestination" \
    --tag-keys "MyTag"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的描述您的 IoT Core for LoRaWAN 資源](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-describe-resource.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [UntagResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/untag-resource.html)。

### `update-destination`
<a name="iot-wireless_UpdateDestination_cli_topic"></a>

以下程式碼範例顯示如何使用 `update-destination`。

**AWS CLI**  
**更新目的地的屬性**  
下列 `update-destination` 範例會更新無線目的地的描述屬性。  

```
aws iotwireless update-destination \
    --name "IoTWirelessDestination" \
    --description "Destination for messages processed using IoTWirelessRule"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將目的地新增至 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan-create-destinations.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [UpdateDestination](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/update-destination.html)。

### `update-partner-account`
<a name="iot-wireless_UpdatePartnerAccount_cli_topic"></a>

以下程式碼範例顯示如何使用 `update-partner-account`。

**AWS CLI**  
**更新合作夥伴帳戶的屬性**  
以下 `update-partner-account` 會為具有指定 ID 的帳戶更新 `AppServerPrivateKey`。  

```
aws iotwireless update-partner-account \
    --partner-account-id "78965678771228" \
    --partner-type "Sidewalk" \
    --sidewalk AppServerPrivateKey="f798ab4899346a88599180fee9e14fa1ada7b6df989425b7c6d2146dd6c815bb"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱 *AWS IoT 開發人員指南*中的 [Amazon Sidewalk Integration for AWS IoT Core](https://docs.aws.amazon.com/iot/latest/developerguide/iot-sidewalk.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [UpdatePartnerAccount](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/update-partner-account.html)。

### `update-wireless-device`
<a name="iot-wireless_UpdateWirelessDevice_cli_topic"></a>

以下程式碼範例顯示如何使用 `update-wireless-device`。

**AWS CLI**  
**更新無線裝置的屬性**  
下列`update-wireless-device`範例會更新向 AWS 您的帳戶註冊之無線裝置的屬性。  

```
aws iotwireless update-wireless-device \
    --id "1ffd32c8-8130-4194-96df-622f072a315f" \
    --destination-name IoTWirelessDestination2 \
    --description "Using my first LoRaWAN device"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [UpdateWirelessDevice](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/update-wireless-device.html)。

### `update-wireless-gateway`
<a name="iot-wireless_UpdateWirelessGateway_cli_topic"></a>

以下程式碼範例顯示如何使用 `update-wireless-gateway`。

**AWS CLI**  
**更新無線閘道**  
下列 `update-wireless-gateway` 範例會更新無線閘道的描述。  

```
aws iotwireless update-wireless-gateway \
    --id "3285bdc7-5a12-4991-84ed-dadca65e342e" \
    --description "Using my LoRaWAN gateway"
```
此命令不會產生輸出。  
如需詳細資訊，請參閱 [AWS IoT 開發人員指南中的將裝置和閘道連接到 IoT Core for LoRaWAN](https://docs.aws.amazon.com/iot/latest/developerguide/connect-iot-lorawan.html)。 *AWS IoT *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [UpdateWirelessGateway](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotwireless/update-wireless-gateway.html)。