同步操作将从 OpenHarmony/docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Provides functions for obtaining system parameters.
This module can obtain device information such as device type and manufacturer.
Since:
1.0
Version:
1.0
GetParameter (const char *key, const char *def, char *value, unsigned int len) |
|
SetParameter (const char *key, const char *value) |
|
GetProductType (void) |
|
GetManufacture (void) |
|
GetBrand (void) |
|
GetMarketName (void) |
|
GetProductSeries (void) |
|
GetProductModel (void) |
|
GetSoftwareModel (void) |
|
GetHardwareModel (void) |
|
GetHardwareProfile (void) |
|
GetSerial (void) |
|
GetOsName (void) |
|
GetDisplayVersion (void) |
|
GetBootloaderVersion (void) |
|
GetSecurityPatchTag (void) |
|
GetAbiList (void) |
Obtains the list of application binary interfaces (ABIs) supported on this device. |
GetSdkApiLevel (void) |
Obtains the SDK API level that matches the current system software. |
GetFirstApiLevel (void) |
|
GetIncrementalVersion (void) |
|
GetVersionId (void) |
|
GetBuildType (void) |
|
GetBuildUser (void) |
|
GetBuildHost (void) |
|
GetBuildTime (void) |
|
GetBuildRootHash (void) |
char* GetAbiList (void )
Description:
Obtains the list of application binary interfaces (ABIs) supported on this device.
The interfaces in the ABI list are separated by commas (,). This function is available only for an OS with an ecosystem accommodating native applications.
Returns:
Returns the ABI list if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetBootloaderVersion (void )
Description:
Obtains the bootloader version of this device.
The bootloader version can have a maximum length of 64 characters.
Returns:
Returns the bootloader version if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetBrand (void )
Description:
Obtains the device brand.
The device brand can have a maximum length of 32 characters.
Returns:
Returns the device brand if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetBuildHost (void )
Description:
Obtains the build host name.
The build host name can have a maximum length of 32 characters.
Returns:
Returns the build host name if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetBuildRootHash (void )
Description:
Obtains the buildroot hash value of this version.
The buildroot hash value is represented by the root hash value in the software version hash tree.
Returns:
Returns the buildroot hash value if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetBuildTime (void )
Description:
Obtains the version build time.
The version build time is represented by the number of milliseconds elapsed since 1970-01-01 00:00:00 GMT.
Returns:
Returns the version build time if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetBuildType (void )
Description:
Obtains the build type.
Different build types with the same baseline codes will be returned, for example, debug/release and log/nolog. Multiple build types can be separated by semicolons (;).
Returns:
Returns the build type if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetBuildUser (void )
Description:
Obtains the build account user name.
The build account user name can have a maximum length of 32 characters.
Returns:
Returns the build account user name if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetDisplayVersion (void )
Description:
Obtains the software version visible to users.
The software version visible to users can have a maximum length of 64 characters.
Returns:
Returns the software version visible to users if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetFirstApiLevel (void )
Description:
Obtains the first SDK API level of the system software.
In general, the first SDK API level is an integer. This function is only available for an OS with an ecosystem.
Returns:
Returns the first SDK API level if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetHardwareModel (void )
Description:
Obtains the device hardware model.
The device hardware model can have a maximum length of 32 characters.
Returns:
Returns the device hardware model if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetHardwareProfile (void )
Description:
Obtains the device hardware profile.
The device hardware profile is a string in JSON format and has a maximum length of 1000 characters.
Returns:
Returns the device hardware profile if a result is found; returns NULL otherwise. The return result is released by the caller. The JSON field in the device hardware profile is defined as follows:
char* GetIncrementalVersion (void )
Description:
Obtains the incremental version.
The incremental version can be used as the unique software version when the device model is the same.
Returns:
Returns the incremental version if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetManufacture (void )
Description:
Obtains the device manufacturer.
The device manufacturer can have a maximum length of 32 characters.
Returns:
Returns the device manufacturer if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetMarketName (void )
Description:
Obtains the device marketing name.
The device marketing name can have a maximum length of 32 characters.
Returns:
Returns the device marketing name if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetOsName (void )
Description:
Obtains the operating system (OS) name.
The device OS name can have a maximum length of 32 characters.
Returns:
Returns the device OS name if a result is found; returns NULL otherwise. The return result is released by the caller.
int GetParameter (const char * key, const char * def, char * value, unsigned int len )
Description:
Obtains a system parameter matching the specified key.
If no system parameter is found, the def parameter will be returned.
Parameters:
key | Indicates the key for the system parameter to query. The value can contain lowercase letters, digits, underscores (_), and dots (.). Its length cannot exceed 32 bytes (including the end-of-text character in the string). |
def | Indicates the default value to return when no query result is found. This parameter is specified by the caller. |
value | Indicates the data buffer that stores the query result. This parameter is applied for and released by the caller and can be used as an output parameter. |
len | Indicates the length of the data in the buffer. |
Returns:
Returns the number of bytes of the system parameter if the operation is successful; returns -9 if a parameter is incorrect; returns -1 in other scenarios.
char* GetProductModel (void )
Description:
Obtains the device authentication model.
The device authentication model can have a maximum length of 32 characters.
Returns:
Returns the device authentication model if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetProductSeries (void )
Description:
Obtains the device series name.
The device series name can have a maximum length of 32 characters.
Returns:
Returns the device series name if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetProductType (void )
Description:
Obtains the device type.
The device type can have a maximum length of 32 characters.
Returns:
Returns the device type if a result is found, for example, returns wifiiot if the application is running on a Wi-Fi connected IoT device; returns NULL otherwise. The return result is released by the caller.
char* GetSdkApiLevel (void )
Description:
Obtains the SDK API level that matches the current system software.
In general, the SDK API level is an integer. This function is only available for an OS with an ecosystem.
Returns:
Returns the SDK API level if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetSecurityPatchTag (void )
Description:
Obtains the security patch tag.
Returns:
Returns the security patch tag if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetSerial (void )
Description:
Obtains the device serial number (SN).
The device SN can have a maximum length of 64 characters.
Returns:
Returns the device SN if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetSoftwareModel (void )
Description:
Obtains the device software model.
The device software model can have a maximum length of 32 characters.
Returns:
Returns the device software model if a result is found; returns NULL otherwise. The return result is released by the caller.
char* GetVersionId (void )
Description:
Obtains the version ID.
The version ID can have a maximum length of 127 characters. It is the unique identifier of a device.
Returns:
Returns the version ID if a result is found; returns NULL otherwise. The return result is released by the caller.
int SetParameter (const char * key, const char * value )
Description:
Sets or updates a system parameter.
You can use this function to set a system parameter that matches key as value.
Parameters:
key | Indicates the key for the parameter to set or update. The value can contain lowercase letters, digits, underscores (_), and dots (.). Its length cannot exceed 32 bytes (including the end-of-text character in the string). |
value | Indicates the system parameter value. Its length cannot exceed 128 bytes (including the end-of-text character in the string). |
Returns:
Returns 0 if the operation is successful; returns -9 if a parameter is incorrect; returns -1 in other scenarios.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。