1e41f4b71Sopenharmony_ci# @ohos.enterprise.deviceInfo (Device Information Management) (System API)
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ciThe deviceInfo module provides APIs for enterprise device information management, including the API for obtaining device serial numbers.
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ci> **NOTE**
6e41f4b71Sopenharmony_ci>
7e41f4b71Sopenharmony_ci> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
8e41f4b71Sopenharmony_ci>
9e41f4b71Sopenharmony_ci> The APIs of this module can be used only in the stage model.
10e41f4b71Sopenharmony_ci>
11e41f4b71Sopenharmony_ci> The APIs of this module can be called only by a [device administrator application](../../mdm/mdm-kit-guide.md#introduction) that is [enabled](js-apis-enterprise-adminManager-sys.md#adminmanagerenableadmin).
12e41f4b71Sopenharmony_ci> 
13e41f4b71Sopenharmony_ci> This topic describes only the system APIs provided by the module. For details about its public APIs, see [@ohos.enterprise.deviceInfo](js-apis-enterprise-deviceInfo.md).
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ci## Modules to Import
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ci```ts
18e41f4b71Sopenharmony_ciimport { deviceInfo } from '@kit.MDMKit';
19e41f4b71Sopenharmony_ci```
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ci## deviceInfo.getDeviceSerial
22e41f4b71Sopenharmony_ci
23e41f4b71Sopenharmony_cigetDeviceSerial(admin: Want, callback: AsyncCallback<string>): void
24e41f4b71Sopenharmony_ci
25e41f4b71Sopenharmony_ciObtains the device serial number through the specified device administrator application. This API uses an asynchronous callback to return the result.
26e41f4b71Sopenharmony_ci
27e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.ENTERPRISE_GET_DEVICE_INFO
28e41f4b71Sopenharmony_ci
29e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager
30e41f4b71Sopenharmony_ci
31e41f4b71Sopenharmony_ci**Parameters**
32e41f4b71Sopenharmony_ci
33e41f4b71Sopenharmony_ci| Name     | Type                                      | Mandatory  | Description                      |
34e41f4b71Sopenharmony_ci| -------- | ---------------------------------------- | ---- | ------------------------------- |
35e41f4b71Sopenharmony_ci| admin    | [Want](../apis-ability-kit/js-apis-app-ability-want.md)     | Yes   | Device administrator application.                 |
36e41f4b71Sopenharmony_ci| callback | AsyncCallback<string>            | Yes   | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the device serial number obtained. If the operation fails, **err** is an error object.      |
37e41f4b71Sopenharmony_ci
38e41f4b71Sopenharmony_ci**Error codes**
39e41f4b71Sopenharmony_ci
40e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md).
41e41f4b71Sopenharmony_ci
42e41f4b71Sopenharmony_ci| ID| Error Message                                                                      |
43e41f4b71Sopenharmony_ci| ------- | ---------------------------------------------------------------------------- |
44e41f4b71Sopenharmony_ci| 9200001 | The application is not an administrator application of the device.            |
45e41f4b71Sopenharmony_ci| 9200002 | The administrator application does not have permission to manage the device. |
46e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. |
47e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. |
48e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
49e41f4b71Sopenharmony_ci
50e41f4b71Sopenharmony_ci**Example**
51e41f4b71Sopenharmony_ci
52e41f4b71Sopenharmony_ci```ts
53e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit';
54e41f4b71Sopenharmony_cilet wantTemp: Want = {
55e41f4b71Sopenharmony_ci  bundleName: 'com.example.myapplication',
56e41f4b71Sopenharmony_ci  abilityName: 'EntryAbility',
57e41f4b71Sopenharmony_ci};
58e41f4b71Sopenharmony_ci
59e41f4b71Sopenharmony_cideviceInfo.getDeviceSerial(wantTemp, (err, result) => {
60e41f4b71Sopenharmony_ci  if (err) {
61e41f4b71Sopenharmony_ci    console.error(`Failed to get device serial. Code: ${err.code}, message: ${err.message}`);
62e41f4b71Sopenharmony_ci    return;
63e41f4b71Sopenharmony_ci  }
64e41f4b71Sopenharmony_ci  console.info(`Succeeded in getting device serial, result : ${result}`);
65e41f4b71Sopenharmony_ci});
66e41f4b71Sopenharmony_ci```
67e41f4b71Sopenharmony_ci
68e41f4b71Sopenharmony_ci## deviceInfo.getDeviceSerial
69e41f4b71Sopenharmony_ci
70e41f4b71Sopenharmony_cigetDeviceSerial(admin: Want): Promise<string>
71e41f4b71Sopenharmony_ci
72e41f4b71Sopenharmony_ciObtains the device serial number through the specified device administrator application. This API uses a promise to return the result.
73e41f4b71Sopenharmony_ci
74e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.ENTERPRISE_GET_DEVICE_INFO
75e41f4b71Sopenharmony_ci
76e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager
77e41f4b71Sopenharmony_ci
78e41f4b71Sopenharmony_ci**Parameters**
79e41f4b71Sopenharmony_ci
80e41f4b71Sopenharmony_ci| Name  | Type                                 | Mandatory  | Description     |
81e41f4b71Sopenharmony_ci| ----- | ----------------------------------- | ---- | ------- |
82e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes   | Device administrator application.|
83e41f4b71Sopenharmony_ci
84e41f4b71Sopenharmony_ci**Return value**
85e41f4b71Sopenharmony_ci
86e41f4b71Sopenharmony_ci| Type                  | Description                     |
87e41f4b71Sopenharmony_ci| --------------------- | ------------------------- |
88e41f4b71Sopenharmony_ci| Promise<string> | Promise used to return the device serial number. |
89e41f4b71Sopenharmony_ci
90e41f4b71Sopenharmony_ci**Error codes**
91e41f4b71Sopenharmony_ci
92e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md).
93e41f4b71Sopenharmony_ci
94e41f4b71Sopenharmony_ci| ID| Error Message                                                                    |
95e41f4b71Sopenharmony_ci| ------- | ---------------------------------------------------------------------------- |
96e41f4b71Sopenharmony_ci| 9200001 | The application is not an administrator application of the device.            |
97e41f4b71Sopenharmony_ci| 9200002 | The administrator application does not have permission to manage the device. |
98e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. |
99e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. |
100e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
101e41f4b71Sopenharmony_ci
102e41f4b71Sopenharmony_ci**Example**
103e41f4b71Sopenharmony_ci
104e41f4b71Sopenharmony_ci```ts
105e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit';
106e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit';
107e41f4b71Sopenharmony_cilet wantTemp: Want = {
108e41f4b71Sopenharmony_ci  bundleName: 'com.example.myapplication',
109e41f4b71Sopenharmony_ci  abilityName: 'EntryAbility',
110e41f4b71Sopenharmony_ci};
111e41f4b71Sopenharmony_ci
112e41f4b71Sopenharmony_cideviceInfo.getDeviceSerial(wantTemp).then((result) => {
113e41f4b71Sopenharmony_ci  console.info(`Succeeded in getting device serial, result : ${result}`);
114e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => {
115e41f4b71Sopenharmony_ci  console.error(`Failed to get device serial. Code: ${err.code}, message: ${err.message}`);
116e41f4b71Sopenharmony_ci});
117e41f4b71Sopenharmony_ci```
118e41f4b71Sopenharmony_ci
119e41f4b71Sopenharmony_ci## deviceInfo.getDisplayVersion
120e41f4b71Sopenharmony_ci
121e41f4b71Sopenharmony_cigetDisplayVersion(admin: Want, callback: AsyncCallback<string>): void
122e41f4b71Sopenharmony_ci
123e41f4b71Sopenharmony_ciObtains the device version through the specified device administrator application. This API uses an asynchronous callback to return the result.
124e41f4b71Sopenharmony_ci
125e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.ENTERPRISE_GET_DEVICE_INFO
126e41f4b71Sopenharmony_ci
127e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager
128e41f4b71Sopenharmony_ci
129e41f4b71Sopenharmony_ci**Parameters**
130e41f4b71Sopenharmony_ci
131e41f4b71Sopenharmony_ci| Name     | Type                                      | Mandatory  | Description                      |
132e41f4b71Sopenharmony_ci| -------- | ---------------------------------------- | ---- | ------------------------------- |
133e41f4b71Sopenharmony_ci| admin    | [Want](../apis-ability-kit/js-apis-app-ability-want.md)      | Yes   | Device administrator application.                 |
134e41f4b71Sopenharmony_ci| callback | AsyncCallback<string>            | Yes   | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the device version obtained. If the operation fails, **err** is an error object.      |
135e41f4b71Sopenharmony_ci
136e41f4b71Sopenharmony_ci**Error codes**
137e41f4b71Sopenharmony_ci
138e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md).
139e41f4b71Sopenharmony_ci
140e41f4b71Sopenharmony_ci| ID| Error Message                                                                      |
141e41f4b71Sopenharmony_ci| ------- | ---------------------------------------------------------------------------- |
142e41f4b71Sopenharmony_ci| 9200001 | The application is not an administrator application of the device.            |
143e41f4b71Sopenharmony_ci| 9200002 | The administrator application does not have permission to manage the device. |
144e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. |
145e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. |
146e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
147e41f4b71Sopenharmony_ci
148e41f4b71Sopenharmony_ci**Example**
149e41f4b71Sopenharmony_ci
150e41f4b71Sopenharmony_ci```ts
151e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit';
152e41f4b71Sopenharmony_cilet wantTemp: Want = {
153e41f4b71Sopenharmony_ci  bundleName: 'com.example.myapplication',
154e41f4b71Sopenharmony_ci  abilityName: 'EntryAbility',
155e41f4b71Sopenharmony_ci};
156e41f4b71Sopenharmony_ci
157e41f4b71Sopenharmony_cideviceInfo.getDisplayVersion(wantTemp, (err, result) => {
158e41f4b71Sopenharmony_ci  if (err) {
159e41f4b71Sopenharmony_ci    console.error(`Failed to get display version. Code: ${err.code}, message: ${err.message}`);
160e41f4b71Sopenharmony_ci    return;
161e41f4b71Sopenharmony_ci  }
162e41f4b71Sopenharmony_ci  console.info(`Succeeded in getting display version, result : ${result}`);
163e41f4b71Sopenharmony_ci});
164e41f4b71Sopenharmony_ci```
165e41f4b71Sopenharmony_ci
166e41f4b71Sopenharmony_ci## deviceInfo.getDisplayVersion
167e41f4b71Sopenharmony_ci
168e41f4b71Sopenharmony_cigetDisplayVersion(admin: Want): Promise<string>
169e41f4b71Sopenharmony_ci
170e41f4b71Sopenharmony_ciObtains the device version through the specified device administrator application. This API uses a promise to return the result.
171e41f4b71Sopenharmony_ci
172e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.ENTERPRISE_GET_DEVICE_INFO
173e41f4b71Sopenharmony_ci
174e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager
175e41f4b71Sopenharmony_ci
176e41f4b71Sopenharmony_ci**Parameters**
177e41f4b71Sopenharmony_ci
178e41f4b71Sopenharmony_ci| Name  | Type                                 | Mandatory  | Description     |
179e41f4b71Sopenharmony_ci| ----- | ----------------------------------- | ---- | ------- |
180e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes   | Device administrator application.|
181e41f4b71Sopenharmony_ci
182e41f4b71Sopenharmony_ci**Return value**
183e41f4b71Sopenharmony_ci
184e41f4b71Sopenharmony_ci| Type                  | Description                     |
185e41f4b71Sopenharmony_ci| --------------------- | ------------------------- |
186e41f4b71Sopenharmony_ci| Promise<string> | Promise used to return the device version obtained.|
187e41f4b71Sopenharmony_ci
188e41f4b71Sopenharmony_ci**Error codes**
189e41f4b71Sopenharmony_ci
190e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md).
191e41f4b71Sopenharmony_ci
192e41f4b71Sopenharmony_ci| ID| Error Message                                                                    |
193e41f4b71Sopenharmony_ci| ------- | ---------------------------------------------------------------------------- |
194e41f4b71Sopenharmony_ci| 9200001 | The application is not an administrator application of the device.            |
195e41f4b71Sopenharmony_ci| 9200002 | The administrator application does not have permission to manage the device. |
196e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. |
197e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. |
198e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
199e41f4b71Sopenharmony_ci
200e41f4b71Sopenharmony_ci**Example**
201e41f4b71Sopenharmony_ci
202e41f4b71Sopenharmony_ci```ts
203e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit';
204e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit';
205e41f4b71Sopenharmony_cilet wantTemp: Want = {
206e41f4b71Sopenharmony_ci  bundleName: 'com.example.myapplication',
207e41f4b71Sopenharmony_ci  abilityName: 'EntryAbility',
208e41f4b71Sopenharmony_ci};
209e41f4b71Sopenharmony_ci
210e41f4b71Sopenharmony_cideviceInfo.getDisplayVersion(wantTemp).then((result) => {
211e41f4b71Sopenharmony_ci  console.info(`Succeeded in getting display version, result : ${result}`);
212e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => {
213e41f4b71Sopenharmony_ci  console.error(`Failed to get display version. Code: ${err.code}, message: ${err.message}`);
214e41f4b71Sopenharmony_ci});
215e41f4b71Sopenharmony_ci```
216e41f4b71Sopenharmony_ci
217e41f4b71Sopenharmony_ci## deviceInfo.getDeviceName
218e41f4b71Sopenharmony_ci
219e41f4b71Sopenharmony_cigetDeviceName(admin: Want, callback: AsyncCallback<string>): void
220e41f4b71Sopenharmony_ci
221e41f4b71Sopenharmony_ciObtains the device name through the specified device administrator application. This API uses an asynchronous callback to return the result.
222e41f4b71Sopenharmony_ci
223e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.ENTERPRISE_GET_DEVICE_INFO
224e41f4b71Sopenharmony_ci
225e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager
226e41f4b71Sopenharmony_ci
227e41f4b71Sopenharmony_ci**Parameters**
228e41f4b71Sopenharmony_ci
229e41f4b71Sopenharmony_ci| Name     | Type                                      | Mandatory  | Description                      |
230e41f4b71Sopenharmony_ci| -------- | ---------------------------------------- | ---- | ------------------------------- |
231e41f4b71Sopenharmony_ci| admin    | [Want](../apis-ability-kit/js-apis-app-ability-want.md)      | Yes   | Device administrator application.                 |
232e41f4b71Sopenharmony_ci| callback | AsyncCallback<string>              | Yes   | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the device name obtained. If the operation fails, **err** is an error object.      |
233e41f4b71Sopenharmony_ci
234e41f4b71Sopenharmony_ci**Error codes**
235e41f4b71Sopenharmony_ci
236e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md).
237e41f4b71Sopenharmony_ci
238e41f4b71Sopenharmony_ci| ID| Error Message                                                                      |
239e41f4b71Sopenharmony_ci| ------- | ---------------------------------------------------------------------------- |
240e41f4b71Sopenharmony_ci| 9200001 | The application is not an administrator application of the device.            |
241e41f4b71Sopenharmony_ci| 9200002 | The administrator application does not have permission to manage the device. |
242e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. |
243e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. |
244e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
245e41f4b71Sopenharmony_ci
246e41f4b71Sopenharmony_ci**Example**
247e41f4b71Sopenharmony_ci
248e41f4b71Sopenharmony_ci```ts
249e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit';
250e41f4b71Sopenharmony_cilet wantTemp: Want = {
251e41f4b71Sopenharmony_ci  bundleName: 'com.example.myapplication',
252e41f4b71Sopenharmony_ci  abilityName: 'EntryAbility',
253e41f4b71Sopenharmony_ci};
254e41f4b71Sopenharmony_ci
255e41f4b71Sopenharmony_cideviceInfo.getDeviceName(wantTemp, (err, result) => {
256e41f4b71Sopenharmony_ci  if (err) {
257e41f4b71Sopenharmony_ci    console.error(`Failed to get device name. Code: ${err.code}, message: ${err.message}`);
258e41f4b71Sopenharmony_ci    return;
259e41f4b71Sopenharmony_ci  }
260e41f4b71Sopenharmony_ci  console.info(`Succeeded in getting device name, result : ${result}`);
261e41f4b71Sopenharmony_ci});
262e41f4b71Sopenharmony_ci```
263e41f4b71Sopenharmony_ci
264e41f4b71Sopenharmony_ci## deviceInfo.getDeviceName
265e41f4b71Sopenharmony_ci
266e41f4b71Sopenharmony_cigetDeviceName(admin: Want): Promise<string>
267e41f4b71Sopenharmony_ci
268e41f4b71Sopenharmony_ciObtains the device name through the specified device administrator application. This API uses a promise to return the result.
269e41f4b71Sopenharmony_ci
270e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.ENTERPRISE_GET_DEVICE_INFO
271e41f4b71Sopenharmony_ci
272e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager
273e41f4b71Sopenharmony_ci
274e41f4b71Sopenharmony_ci**Parameters**
275e41f4b71Sopenharmony_ci
276e41f4b71Sopenharmony_ci| Name  | Type                                 | Mandatory  | Description     |
277e41f4b71Sopenharmony_ci| ----- | ----------------------------------- | ---- | ------- |
278e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes   | Device administrator application.|
279e41f4b71Sopenharmony_ci
280e41f4b71Sopenharmony_ci**Return value**
281e41f4b71Sopenharmony_ci
282e41f4b71Sopenharmony_ci| Type                  | Description                     |
283e41f4b71Sopenharmony_ci| --------------------- | ------------------------- |
284e41f4b71Sopenharmony_ci| Promise<string> | Promise used to return the device name.|
285e41f4b71Sopenharmony_ci
286e41f4b71Sopenharmony_ci**Error codes**
287e41f4b71Sopenharmony_ci
288e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md).
289e41f4b71Sopenharmony_ci
290e41f4b71Sopenharmony_ci| ID| Error Message                                                                    |
291e41f4b71Sopenharmony_ci| ------- | ---------------------------------------------------------------------------- |
292e41f4b71Sopenharmony_ci| 9200001 | The application is not an administrator application of the device.            |
293e41f4b71Sopenharmony_ci| 9200002 | The administrator application does not have permission to manage the device. |
294e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. |
295e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. |
296e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
297e41f4b71Sopenharmony_ci
298e41f4b71Sopenharmony_ci**Example**
299e41f4b71Sopenharmony_ci
300e41f4b71Sopenharmony_ci```ts
301e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit';
302e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit';
303e41f4b71Sopenharmony_cilet wantTemp: Want = {
304e41f4b71Sopenharmony_ci  bundleName: 'com.example.myapplication',
305e41f4b71Sopenharmony_ci  abilityName: 'EntryAbility',
306e41f4b71Sopenharmony_ci};
307e41f4b71Sopenharmony_ci
308e41f4b71Sopenharmony_cideviceInfo.getDeviceName(wantTemp).then((result) => {
309e41f4b71Sopenharmony_ci  console.info(`Succeeded in getting device name, result : ${result}`);
310e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => {
311e41f4b71Sopenharmony_ci  console.error(`Failed to get device name. Code: ${err.code}, message: ${err.message}`);
312e41f4b71Sopenharmony_ci});
313e41f4b71Sopenharmony_ci```
314