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 product model alias represented by a string. 77 * @syscap SystemCapability.Startup.SystemInfo 78 * @return NULL - Not found product model, or failed to invoke the internal interface. 79 * @since 14 80 */ 81 const char *OH_GetProductModelAlias(void); 82 83 /** 84 * Obtains the software model represented by a string. 85 * @syscap SystemCapability.Startup.SystemInfo 86 * @return NULL - Not found software model, or failed to invoke the internal interface. 87 * @since 10 88 */ 89 const char *OH_GetSoftwareModel(void); 90 91 /** 92 * Obtains the hardware model represented by a string. 93 * @syscap SystemCapability.Startup.SystemInfo 94 * @return NULL - Not found hardware model, or failed to invoke the internal interface. 95 * @since 10 96 */ 97 const char *OH_GetHardwareModel(void); 98 99 /** 100 * Obtains the bootloader version number represented by a string. 101 * @syscap SystemCapability.Startup.SystemInfo 102 * @return NULL - Not found bootloader version number, or failed to invoke the internal interface. 103 * @since 10 104 */ 105 const char *OH_GetBootloaderVersion(void); 106 107 /** 108 * Obtains the application binary interface (Abi) list represented by a string. 109 * @syscap SystemCapability.Startup.SystemInfo 110 * @return NULL - Not found Abi list, or failed to invoke the internal interface. 111 * @since 10 112 */ 113 const char *OH_GetAbiList(void); 114 115 /** 116 * Obtains the security patch tag represented by a string. 117 * @syscap SystemCapability.Startup.SystemInfo 118 * @return NULL - Not found security patch tag, or failed to invoke the internal interface. 119 * @since 10 120 */ 121 const char *OH_GetSecurityPatchTag(void); 122 123 /** 124 * Obtains the product version displayed for customer represented by a string. 125 * @syscap SystemCapability.Startup.SystemInfo 126 * @return NULL - Not found the product version displayed, or failed to invoke the internal interface. 127 * @since 10 128 */ 129 const char *OH_GetDisplayVersion(void); 130 131 /** 132 * Obtains the incremental version represented by a string. 133 * @syscap SystemCapability.Startup.SystemInfo 134 * @return NULL - Not found the incremental version, or failed to invoke the internal interface. 135 * @since 10 136 */ 137 const char *OH_GetIncrementalVersion(void); 138 139 /** 140 * Obtains the OS release type represented by a string. 141 * 142 * <p>The OS release category can be {@code Release}, {@code Beta}, or {@code Canary}. 143 * The specific release type may be {@code Release}, {@code Beta1}, or others alike. 144 * @syscap SystemCapability.Startup.SystemInfo 145 * @return NULL - Not found the OS release type, or failed to invoke the internal interface. 146 * @since 10 147 */ 148 const char *OH_GetOsReleaseType(void); 149 150 /** 151 * Obtains the OS full version name represented by a string. 152 * @syscap SystemCapability.Startup.SystemInfo 153 * @return NULL - Not found the OS full version name, or failed to invoke the internal interface. 154 * @since 10 155 */ 156 const char *OH_GetOSFullName(void); 157 158 /** 159 * Obtains the SDK API major version number. 160 * @syscap SystemCapability.Startup.SystemInfo 161 * @return 0 - Not found the SDK API version number, or failed to invoke the internal interface. 162 * @since 10 163 */ 164 int OH_GetSdkApiVersion(void); 165 166 /** 167 * Obtains the sdk minor api version number. 168 * @syscap SystemCapability.Startup.SystemInfo 169 * @return 0 ~ 999 - the sdk minor api version 170 * -1 - not found the sdk minor api version number, or failed to invoke the internal interface. 171 * @since 19 172 */ 173 int OH_GetSdkMinorApiVersion(void); 174 175 /** 176 * Obtains the sdk patch api version number. 177 * @syscap SystemCapability.Startup.SystemInfo 178 * @return 0 ~ 999 - the sdk patch api version 179 * -1 - not found the sdk patch api version number, or failed to invoke the internal interface. 180 * @since 19 181 */ 182 int OH_GetSdkPatchApiVersion(void); 183 184 /** 185 * Obtains the first API version number. 186 * @syscap SystemCapability.Startup.SystemInfo 187 * @return 0 - Not found the first API version number, or failed to invoke the internal interface. 188 * @since 10 189 */ 190 int OH_GetFirstApiVersion(void); 191 192 /** 193 * Obtains the version ID by a string. 194 * @syscap SystemCapability.Startup.SystemInfo 195 * @return NULL - Not found version ID, or failed to invoke the internal interface. 196 * @since 10 197 */ 198 const char *OH_GetVersionId(void); 199 200 /** 201 * Obtains the build type of the current running OS. 202 * @syscap SystemCapability.Startup.SystemInfo 203 * @return NULL - Not found build type, or failed to invoke the internal interface. 204 * @since 10 205 */ 206 const char *OH_GetBuildType(void); 207 208 /** 209 * Obtains the build user of the current running OS. 210 * @syscap SystemCapability.Startup.SystemInfo 211 * @return NULL - Not found build user, or failed to invoke the internal interface. 212 * @since 10 213 */ 214 const char *OH_GetBuildUser(void); 215 216 /** 217 * Obtains the build host of the current running OS. 218 * @syscap SystemCapability.Startup.SystemInfo 219 * @return NULL - Not found build host, or failed to invoke the internal interface. 220 * @since 10 221 */ 222 const char *OH_GetBuildHost(void); 223 224 /** 225 * Obtains the build time of the current running OS. 226 * @syscap SystemCapability.Startup.SystemInfo 227 * @return NULL - Not found build time, or failed to invoke the internal interface. 228 * @since 10 229 */ 230 const char *OH_GetBuildTime(void); 231 232 /** 233 * Obtains the version hash of the current running OS. 234 * @syscap SystemCapability.Startup.SystemInfo 235 * @return NULL - Not found version hash, or failed to invoke the internal interface. 236 * @since 10 237 */ 238 const char *OH_GetBuildRootHash(void); 239 240 /** 241 * Obtains the Distribution OS name represented by a string. 242 * 243 * <p>Independent Software Vendor (ISV) may distribute OHOS with their own OS name. 244 * If ISV not specified, it will return an empty string 245 * @syscap SystemCapability.Startup.SystemInfo 246 * @return NULL - Not found distribution OS name, or failed to invoke the internal interface. 247 * @since 10 248 */ 249 const char *OH_GetDistributionOSName(void); 250 251 /** 252 * Obtains the ISV distribution OS version represented by a string. 253 * If ISV not specified, it will return the same value as OH_GetOSFullName 254 * @syscap SystemCapability.Startup.SystemInfo 255 * @return NULL - Not found distribution OS version, or failed to invoke the internal interface. 256 * @since 10 257 */ 258 const char *OH_GetDistributionOSVersion(void); 259 260 /** 261 * Obtains the ISV distribution OS api version represented by a integer. 262 * If ISV not specified, it will return the same value as OH_GetSdkApiVersion 263 * @syscap SystemCapability.Startup.SystemInfo 264 * @return NULL - Not found distribution OS api version, or failed to invoke the internal interface. 265 * @since 10 266 */ 267 int OH_GetDistributionOSApiVersion(void); 268 269 /** 270 * Obtains the ISV distribution OS release type represented by a string. 271 * If ISV not specified, it will return the same value as OH_GetOsReleaseType 272 * @syscap SystemCapability.Startup.SystemInfo 273 * @return NULL - Not found distribution OS release type, or failed to invoke the internal interface. 274 * @since 10 275 */ 276 const char *OH_GetDistributionOSReleaseType(void); 277 278 #ifdef __cplusplus 279 #if __cplusplus 280 } 281 #endif 282 #endif 283 #endif 284