> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GetDeviceId

> 傳回已連線 LampArray 周邊裝置的系統產生裝置識別碼字串，用於將其與其他已連接的裝置區分開來。

# ILampArray::GetDeviceId

傳回 ILampArray 的系統產生識別碼。

## 語法

```cpp theme={null}
void GetDeviceId(
    APP_LOCAL_DEVICE_ID* deviceId)
```

### 參數

*deviceId*  \_Out\_
類型：APP\_LOCAL\_DEVICE\_ID\*

指向 APP\_LOCAL\_DEVICE\_ID 結構的指標，裝置識別碼將會複製到其中。

### 傳回值

類型：void

## 備註

*應用程式本機裝置識別碼* 是可唯一識別裝置的特殊 32 位元組值，即使在應用程式重新啟動或系統重新開機後也一樣。對於無線裝置，此識別碼在中斷連線和重新連線後也會保持不變；對於有線 USB 裝置，只要將其插回相同的 USB 連接埠，識別碼也會保持不變。

在初始版本中，此函式會填入全為零的值。

## 需求

**標頭：** LampArray.h

**程式庫：** xgameplatform.lib

**支援的平台：** XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

[照明 API 概觀](https://docs.xbox.com/zh-TW/build/core-features/common/lighting/gc-lighting-toc.md)\
[ILampArray](https://docs.xbox.com/zh-TW/reference/lighting/lamparray/interfaces/ilamparray/ilamparray.md)


## Related topics

- [ILampArray (介面內容)](https://docs.xbox.com/zh-TW/reference/lighting/lamparray/interfaces/ilamparray/ilamparray.md)
- [post_decode_audio_sink_stream::get_device_id](https://docs.xbox.com/zh-TW/reference/chat/gamechat2/classes/post_decode_audio_sink_stream/methods/post_decode_audio_sink_stream_get_device_id.md)
- [XInputGetDeviceId](https://docs.xbox.com/zh-TW/reference/input/xinputongameinput/functions/xinputgetdeviceid.md)
- [XSystemGetAppSpecificDeviceId](https://docs.xbox.com/zh-TW/reference/system/xsystem/functions/xsystemgetappspecificdeviceid.md)
- [APP_LOCAL_DEVICE_ID](https://docs.xbox.com/zh-TW/reference/system/xuser/structs/app_local_device_id.md)
