1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef DEVICEINFO_CSDK_H 17 #define DEVICEINFO_CSDK_H 18 19 #ifdef __cplusplus 20 #if __cplusplus 21 extern "C" { 22 #endif 23 #endif 24 25 /** 26 * Obtains the device type represented by a string, 27 * which can be {@code phone} (or {@code default} for phones), {@code wearable}, {@code liteWearable}, 28 * {@code tablet}, {@code tv}, {@code car}, or {@code smartVision}. 29 * @syscap SystemCapability.Startup.SystemInfo 30 * @return NULL - Not found device type, or failed to invoke the internal interface. 31 * @since 10 32 */ 33 const char *OH_GetDeviceType(void); 34 35 /** 36 * Obtains the device manufacturer represented by a string. 37 * @syscap SystemCapability.Startup.SystemInfo 38 * @return NULL - Not found device manufacturer, or failed to invoke the internal interface. 39 * @since 10 40 */ 41 const char *OH_GetManufacture(void); 42 43 /** 44 * Obtains the device brand represented by a string. 45 * @syscap SystemCapability.Startup.SystemInfo 46 * @return NULL - Not found device brand, or failed to invoke the internal interface. 47 * @since 10 48 */ 49 const char *OH_GetBrand(void); 50 51 /** 52 * Obtains the product name speaded in the market 53 * @syscap SystemCapability.Startup.SystemInfo 54 * @return NULL - Not found market name, or failed to invoke the internal interface. 55 * @since 10 56 */ 57 const char *OH_GetMarketName(void); 58 59 /** 60 * Obtains the product series represented by a string. 61 * @syscap SystemCapability.Startup.SystemInfo 62 * @return NULL - Not found product series, or failed to invoke the internal interface. 63 * @since 10 64 */ 65 const char *OH_GetProductSeries(void); 66 67 /** 68 * Obtains the product model represented by a string. 69 * @syscap SystemCapability.Startup.SystemInfo 70 * @return NULL - Not found product model, or failed to invoke the internal interface. 71 * @since 10 72 */ 73 const char *OH_GetProductModel(void); 74 75 /** 76 * Obtains the software model represented by a string. 77 * @syscap SystemCapability.Startup.SystemInfo 78 * @return NULL - Not found software model, or failed to invoke the internal interface. 79 * @since 10 80 */ 81 const char *OH_GetSoftwareModel(void); 82 83 /** 84 * Obtains the hardware model represented by a string. 85 * @syscap SystemCapability.Startup.SystemInfo 86 * @return NULL - Not found hardware model, or failed to invoke the internal interface. 87 * @since 10 88 */ 89 const char *OH_GetHardwareModel(void); 90 91 /** 92 * Obtains the bootloader version number represented by a string. 93 * @syscap SystemCapability.Startup.SystemInfo 94 * @return NULL - Not found bootloader version number, or failed to invoke the internal interface. 95 * @since 10 96 */ 97 const char *OH_GetBootloaderVersion(void); 98 99 /** 100 * Obtains the application binary interface (Abi) list represented by a string. 101 * @syscap SystemCapability.Startup.SystemInfo 102 * @return NULL - Not found Abi list, or failed to invoke the internal interface. 103 * @since 10 104 */ 105 const char *OH_GetAbiList(void); 106 107 /** 108 * Obtains the security patch tag represented by a string. 109 * @syscap SystemCapability.Startup.SystemInfo 110 * @return NULL - Not found security patch tag, or failed to invoke the internal interface. 111 * @since 10 112 */ 113 const char *OH_GetSecurityPatchTag(void); 114 115 /** 116 * Obtains the product version displayed for customer represented by a string. 117 * @syscap SystemCapability.Startup.SystemInfo 118 * @return NULL - Not found the product version displayed, or failed to invoke the internal interface. 119 * @since 10 120 */ 121 const char *OH_GetDisplayVersion(void); 122 123 /** 124 * Obtains the incremental version represented by a string. 125 * @syscap SystemCapability.Startup.SystemInfo 126 * @return NULL - Not found the incremental version, or failed to invoke the internal interface. 127 * @since 10 128 */ 129 const char *OH_GetIncrementalVersion(void); 130 131 /** 132 * Obtains the OS release type represented by a string. 133 * 134 * <p>The OS release category can be {@code Release}, {@code Beta}, or {@code Canary}. 135 * The specific release type may be {@code Release}, {@code Beta1}, or others alike. 136 * @syscap SystemCapability.Startup.SystemInfo 137 * @return NULL - Not found the OS release type, or failed to invoke the internal interface. 138 * @since 10 139 */ 140 const char *OH_GetOsReleaseType(void); 141 142 /** 143 * Obtains the OS full version name represented by a string. 144 * @syscap SystemCapability.Startup.SystemInfo 145 * @return NULL - Not found the OS full version name, or failed to invoke the internal interface. 146 * @since 10 147 */ 148 const char *OH_GetOSFullName(void); 149 150 /** 151 * Obtains the SDK API version number. 152 * @syscap SystemCapability.Startup.SystemInfo 153 * @return 0 - Not found the SDK API version number, or failed to invoke the internal interface. 154 * @since 10 155 */ 156 int OH_GetSdkApiVersion(void); 157 158 /** 159 * Obtains the first API version number. 160 * @syscap SystemCapability.Startup.SystemInfo 161 * @return 0 - Not found the first API version number, or failed to invoke the internal interface. 162 * @since 10 163 */ 164 int OH_GetFirstApiVersion(void); 165 166 /** 167 * Obtains the version ID by a string. 168 * @syscap SystemCapability.Startup.SystemInfo 169 * @return NULL - Not found version ID, or failed to invoke the internal interface. 170 * @since 10 171 */ 172 const char *OH_GetVersionId(void); 173 174 /** 175 * Obtains the build type of the current running OS. 176 * @syscap SystemCapability.Startup.SystemInfo 177 * @return NULL - Not found build type, or failed to invoke the internal interface. 178 * @since 10 179 */ 180 const char *OH_GetBuildType(void); 181 182 /** 183 * Obtains the build user of the current running OS. 184 * @syscap SystemCapability.Startup.SystemInfo 185 * @return NULL - Not found build user, or failed to invoke the internal interface. 186 * @since 10 187 */ 188 const char *OH_GetBuildUser(void); 189 190 /** 191 * Obtains the build host of the current running OS. 192 * @syscap SystemCapability.Startup.SystemInfo 193 * @return NULL - Not found build host, or failed to invoke the internal interface. 194 * @since 10 195 */ 196 const char *OH_GetBuildHost(void); 197 198 /** 199 * Obtains the build time of the current running OS. 200 * @syscap SystemCapability.Startup.SystemInfo 201 * @return NULL - Not found build time, or failed to invoke the internal interface. 202 * @since 10 203 */ 204 const char *OH_GetBuildTime(void); 205 206 /** 207 * Obtains the version hash of the current running OS. 208 * @syscap SystemCapability.Startup.SystemInfo 209 * @return NULL - Not found version hash, or failed to invoke the internal interface. 210 * @since 10 211 */ 212 const char *OH_GetBuildRootHash(void); 213 214 /** 215 * Obtains the Distribution OS name represented by a string. 216 * 217 * <p>Independent Software Vendor (ISV) may distribute OHOS with their own OS name. 218 * If ISV not specified, it will return an empty string 219 * @syscap SystemCapability.Startup.SystemInfo 220 * @return NULL - Not found distribution OS name, or failed to invoke the internal interface. 221 * @since 10 222 */ 223 const char *OH_GetDistributionOSName(void); 224 225 /** 226 * Obtains the ISV distribution OS version represented by a string. 227 * If ISV not specified, it will return the same value as OH_GetOSFullName 228 * @syscap SystemCapability.Startup.SystemInfo 229 * @return NULL - Not found distribution OS version, or failed to invoke the internal interface. 230 * @since 10 231 */ 232 const char *OH_GetDistributionOSVersion(void); 233 234 /** 235 * Obtains the ISV distribution OS api version represented by a integer. 236 * If ISV not specified, it will return the same value as OH_GetSdkApiVersion 237 * @syscap SystemCapability.Startup.SystemInfo 238 * @return NULL - Not found distribution OS api version, or failed to invoke the internal interface. 239 * @since 10 240 */ 241 int OH_GetDistributionOSApiVersion(void); 242 243 /** 244 * Obtains the ISV distribution OS release type represented by a string. 245 * If ISV not specified, it will return the same value as OH_GetOsReleaseType 246 * @syscap SystemCapability.Startup.SystemInfo 247 * @return NULL - Not found distribution OS release type, or failed to invoke the internal interface. 248 * @since 10 249 */ 250 const char *OH_GetDistributionOSReleaseType(void); 251 252 #ifdef __cplusplus 253 #if __cplusplus 254 } 255 #endif 256 #endif 257 #endif 258