1# deviceinfo.h 2 3## Overview 4 5Declares the APIs for querying device information. 6 7**Library**: libdeviceinfo_ndk.z.so 8 9**System capability**: SystemCapability.Startup.SystemInfo 10 11**Since**: 10 12 13**Related modules**: [DeviceInfo](capi-deviceinfo.md) 14 15## Summary 16 17### Functions 18 19| Name| Description| 20| -- | -- | 21| [const char *OH_GetDeviceType(void)](#oh_getdevicetype) | Obtains the device type.| 22| [const char *OH_GetManufacture(void)](#oh_getmanufacture) | Obtains the device manufacturer.| 23| [const char *OH_GetBrand(void)](#oh_getbrand) | Obtains the device brand.| 24| [const char *OH_GetMarketName(void)](#oh_getmarketname) | Obtains the market name.| 25| [const char *OH_GetProductSeries(void)](#oh_getproductseries) | Obtains the product series.| 26| [const char *OH_GetProductModel(void)](#oh_getproductmodel) | Obtains the product model.| 27| [const char *OH_GetSoftwareModel(void)](#oh_getsoftwaremodel) | Obtains the software model.| 28| [const char *OH_GetHardwareModel(void)](#oh_gethardwaremodel) | Obtains the hardware model.| 29| [const char *OH_GetBootloaderVersion(void)](#oh_getbootloaderversion) | Obtains the Bootloader version.| 30| [const char *OH_GetAbiList(void)](#oh_getabilist) | Obtains the application binary interface (ABI) list.| 31| [const char *OH_GetSecurityPatchTag(void)](#oh_getsecuritypatchtag) | Obtains the security patch tag.| 32| [const char *OH_GetDisplayVersion(void)](#oh_getdisplayversion) | Obtains the display version.| 33| [const char *OH_GetIncrementalVersion(void)](#oh_getincrementalversion) | Obtains the incremental version.| 34| [const char *OH_GetOsReleaseType(void)](#oh_getosreleasetype) | Obtains the OS release type.| 35| [const char *OH_GetOSFullName(void)](#oh_getosfullname) | Obtains the OS full name.| 36| [int OH_GetSdkApiVersion(void)](#oh_getsdkapiversion) | Obtains the SDK API version.| 37| [int OH_GetFirstApiVersion(void)](#oh_getfirstapiversion) | Obtains the first API version.| 38| [const char *OH_GetVersionId(void)](#oh_getversionid) | Obtains the version ID.| 39| [const char *OH_GetBuildType(void)](#oh_getbuildtype) | Obtains the build type.| 40| [const char *OH_GetBuildUser(void)](#oh_getbuilduser) | Obtains the build user.| 41| [const char *OH_GetBuildHost(void)](#oh_getbuildhost) | Obtains the build host.| 42| [const char *OH_GetBuildTime(void)](#oh_getbuildtime) | Obtains the build time.| 43| [const char *OH_GetBuildRootHash(void)](#oh_getbuildroothash) | Obtains the build root hash.| 44| [const char *OH_GetDistributionOSName(void)](#oh_getdistributionosname) | Obtains the ISV distribution OS name. Independent software vendors (ISVs) can use their own OS names.| 45| [const char *OH_GetDistributionOSVersion(void)](#oh_getdistributionosversion) | Obtains the ISV distribution OS version.| 46| [int OH_GetDistributionOSApiVersion(void)](#oh_getdistributionosapiversion) | Obtains the ISV distribution OS API version.| 47| [const char *OH_GetDistributionOSReleaseType(void)](#oh_getdistributionosreleasetype) | Obtains the ISV distribution OS release type.| 48 49## Function Description 50 51### OH_GetDeviceType() 52 53``` 54const char *OH_GetDeviceType(void) 55``` 56 57**Description** 58 59Obtains the device type. 60 61**Since**: 10 62 63**Returns** 64 65| Type| Description| 66| -- | -- | 67| const char | Returns one of the following values:<br>**phone** (or **default**)<br>**wearable**<br>**liteWearable**<br>**tablet**<br>**tv**<br>**car**<br>**smartVision** | 68 69### OH_GetManufacture() 70 71``` 72const char *OH_GetManufacture(void) 73``` 74 75**Description** 76 77Obtains the device manufacturer. 78 79**Since**: 10 80 81**Returns** 82 83| Type| Description| 84| -- | -- | 85| const char* | Returns a device manufacturer. The value is of the string type.| 86 87### OH_GetBrand() 88 89``` 90const char *OH_GetBrand(void) 91``` 92 93**Description** 94 95Obtains the device brand. 96 97**Since**: 10 98 99**Returns** 100 101| Type| Description| 102| -- | -- | 103| const char* | Returns a device brand. The value is of the string type.| 104 105### OH_GetMarketName() 106 107``` 108const char *OH_GetMarketName(void) 109``` 110 111**Description** 112 113Obtains the market name. 114 115**Since**: 10 116 117**Returns** 118 119| Type| Description| 120| -- | -- | 121| const char* | Returns a market name. The value is of the string type.| 122 123### OH_GetProductSeries() 124 125``` 126const char *OH_GetProductSeries(void) 127``` 128 129**Description** 130 131Obtains the product series. 132 133**Since**: 10 134 135**Returns** 136 137| Type| Description| 138| -- | -- | 139| const char* | Returns the product series. The value is of the string type.| 140 141### OH_GetProductModel() 142 143``` 144const char *OH_GetProductModel(void) 145``` 146 147**Description** 148 149Obtains the product model. 150 151**Since**: 10 152 153**Returns** 154 155| Type| Description| 156| -- | -- | 157| const char* | Returns a product model. The value is of the string type.| 158 159### OH_GetSoftwareModel() 160 161``` 162const char *OH_GetSoftwareModel(void) 163``` 164 165**Description** 166 167Obtains the software model. 168 169**Since**: 10 170 171**Returns** 172 173| Type| Description| 174| -- | -- | 175| const char* | Returns a software model. The value is of the string type.| 176 177### OH_GetHardwareModel() 178 179``` 180const char *OH_GetHardwareModel(void) 181``` 182 183**Description** 184 185Obtains the hardware model. 186 187**Since**: 10 188 189**Returns** 190 191| Type| Description| 192| -- | -- | 193| const char* | Returns a hardware model. The value is of the string type.| 194 195### OH_GetBootloaderVersion() 196 197``` 198const char *OH_GetBootloaderVersion(void) 199``` 200 201**Description** 202 203Obtains the Bootloader version. 204 205**Since**: 10 206 207**Returns** 208 209| Type| Description| 210| -- | -- | 211| const char* | Returns a Bootloader version. The value is of the string type.| 212 213### OH_GetAbiList() 214 215``` 216const char *OH_GetAbiList(void) 217``` 218 219**Description** 220 221Obtains the ABI list. 222 223**Since**: 10 224 225**Returns** 226 227| Type| Description| 228| -- | -- | 229| const char* | Returns an ABI list. The value is of the string type.| 230 231### OH_GetSecurityPatchTag() 232 233``` 234const char *OH_GetSecurityPatchTag(void) 235``` 236 237**Description** 238 239Obtains the security patch tag. 240 241**Since**: 10 242 243**Returns** 244 245| Type| Description| 246| -- | -- | 247| const char* | Returns a security patch tag. The value is of the string type.| 248 249### OH_GetDisplayVersion() 250 251``` 252const char *OH_GetDisplayVersion(void) 253``` 254 255**Description** 256 257Obtains the display version. 258 259**Since**: 10 260 261**Returns** 262 263| Type| Description| 264| -- | -- | 265| const char* | Returns a display version. The value is of the string type.| 266 267### OH_GetIncrementalVersion() 268 269``` 270const char *OH_GetIncrementalVersion(void) 271``` 272 273**Description** 274 275Obtains the incremental version. 276 277**Since**: 10 278 279**Returns** 280 281| Type| Description| 282| -- | -- | 283| const char* | Returns an incremental version. The value is of the string type.| 284 285### OH_GetOsReleaseType() 286 287``` 288const char *OH_GetOsReleaseType(void) 289``` 290 291**Description** 292 293Obtains the OS release type. 294 295**Since**: 10 296 297**Returns** 298 299| Type| Description | 300| -- |-----------------------------------------------------------------------------------------| 301| const char* | Returns an OS release type. The options include **release**, **Beta**, and **Canary**.<br> A specific release type may be **release**, **Beta1**, or another similar type.| 302 303### OH_GetOSFullName() 304 305``` 306const char *OH_GetOSFullName(void) 307``` 308 309**Description** 310 311Obtains the OS full name. 312 313**Since**: 10 314 315**Returns** 316 317| Type| Description| 318| -- | -- | 319| const char* | Returns an OS full name. The value is of the string type.| 320 321### OH_GetSdkApiVersion() 322 323``` 324int OH_GetSdkApiVersion(void) 325``` 326 327**Description** 328 329Obtains the SDK API version. 330 331**Since**: 10 332 333**Returns** 334 335| Type| Description| 336| -- | -- | 337| int | Returns an SDK API version.| 338 339### OH_GetFirstApiVersion() 340 341``` 342int OH_GetFirstApiVersion(void) 343``` 344 345**Description** 346 347Obtains the first API version. 348 349**Since**: 10 350 351**Returns** 352 353| Type| Description| 354| -- | -- | 355| int | Returns the first API version.| 356 357### OH_GetVersionId() 358 359``` 360const char *OH_GetVersionId(void) 361``` 362 363**Description** 364 365Obtains the version ID. 366 367**Since**: 10 368 369**Returns** 370 371| Type| Description| 372| -- | -- | 373| const char* | Returns a version ID. The value is of the string type.| 374 375### OH_GetBuildType() 376 377``` 378const char *OH_GetBuildType(void) 379``` 380 381**Description** 382 383Obtains the build type. 384 385**Since**: 10 386 387**Returns** 388 389| Type| Description| 390| -- | -- | 391| const char* | Returns a build type. The value is of the string type.| 392 393### OH_GetBuildUser() 394 395``` 396const char *OH_GetBuildUser(void) 397``` 398 399**Description** 400 401Obtains the build user. 402 403**Since**: 10 404 405**Returns** 406 407| Type| Description| 408| -- | -- | 409| const char* | Returns a build user. The value is of the string type.| 410 411### OH_GetBuildHost() 412 413``` 414const char *OH_GetBuildHost(void) 415``` 416 417**Description** 418 419Obtains the build host. 420 421**Since**: 10 422 423**Returns** 424 425| Type| Description| 426| -- | -- | 427| const char* | Returns a build host. The value is of the string type.| 428 429### OH_GetBuildTime() 430 431``` 432const char *OH_GetBuildTime(void) 433``` 434 435**Description** 436 437Obtains the build time. 438 439**Since**: 10 440 441**Returns** 442 443| Type| Description| 444| -- | -- | 445| const char* | Returns the build time. The value is of the string type.| 446 447### OH_GetBuildRootHash() 448 449``` 450const char *OH_GetBuildRootHash(void) 451``` 452 453**Description** 454 455Obtains the build root hash. 456 457**Since**: 10 458 459**Returns** 460 461| Type| Description| 462| -- | -- | 463| const char* | Returns a build root hash. The value is of the string type.| 464 465### OH_GetDistributionOSName() 466 467``` 468const char *OH_GetDistributionOSName(void) 469``` 470 471**Description** 472 473Obtains the ISV distribution OS name. ISVs can use their own OS names. 474 475**Since**: 10 476 477**Returns** 478 479| Type| Description| 480| -- | -- | 481| const char* | Returns an ISV distribution OS name.<br>If no ISV is specified, an empty string is returned. | 482 483### OH_GetDistributionOSVersion() 484 485``` 486const char *OH_GetDistributionOSVersion(void) 487``` 488 489**Description** 490 491Obtains the ISV distribution OS version. 492 493**Since**: 10 494 495**Returns** 496 497| Type| Description | 498| -- |----------------------------------------------------------------------------| 499| const char* | Returns an ISV distribution OS version.<br>If no ISV is specified, the value of [OH_GetOSFullName](#oh_getosfullname) is returned. | 500 501### OH_GetDistributionOSApiVersion() 502 503``` 504int OH_GetDistributionOSApiVersion(void) 505``` 506 507**Description** 508 509Obtains the ISV distribution OS API version. 510 511**Since**: 10 512 513**Returns** 514 515| Type| Description| 516| -- | -- | 517| int | Returns an ISV distribution OS API version.<br> If no ISV is specified, the value of [OH_GetOSFullName](#oh_getosfullname) is returned.| 518 519### OH_GetDistributionOSReleaseType() 520 521``` 522const char *OH_GetDistributionOSReleaseType(void) 523``` 524 525**Description** 526 527Obtains the ISV distribution OS release type. 528 529**Since**: 10 530 531**Returns** 532 533| Type| Description | 534| -- |---------------------------------------------------------------------------------| 535| const char | Returns an ISV distribution OS release type.<br>If no ISV is specified, the value of [OH_GetOsReleaseType](#oh_getosreleasetype) is returned. | 536