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 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 first API version number.
168  * @syscap SystemCapability.Startup.SystemInfo
169  * @return 0 - Not found the first API version number, or failed to invoke the internal interface.
170  * @since 10
171  */
172 int OH_GetFirstApiVersion(void);
173 
174 /**
175  * Obtains the version ID by a string.
176  * @syscap SystemCapability.Startup.SystemInfo
177  * @return NULL - Not found version ID, or failed to invoke the internal interface.
178  * @since 10
179  */
180 const char *OH_GetVersionId(void);
181 
182 /**
183  * Obtains the build type of the current running OS.
184  * @syscap SystemCapability.Startup.SystemInfo
185  * @return NULL - Not found build type, or failed to invoke the internal interface.
186  * @since 10
187  */
188 const char *OH_GetBuildType(void);
189 
190 /**
191  * Obtains the build user of the current running OS.
192  * @syscap SystemCapability.Startup.SystemInfo
193  * @return NULL - Not found build user, or failed to invoke the internal interface.
194  * @since 10
195  */
196 const char *OH_GetBuildUser(void);
197 
198 /**
199  * Obtains the build host of the current running OS.
200  * @syscap SystemCapability.Startup.SystemInfo
201  * @return NULL - Not found build host, or failed to invoke the internal interface.
202  * @since 10
203  */
204 const char *OH_GetBuildHost(void);
205 
206 /**
207  * Obtains the build time of the current running OS.
208  * @syscap SystemCapability.Startup.SystemInfo
209  * @return NULL - Not found build time, or failed to invoke the internal interface.
210  * @since 10
211  */
212 const char *OH_GetBuildTime(void);
213 
214 /**
215  * Obtains the version hash of the current running OS.
216  * @syscap SystemCapability.Startup.SystemInfo
217  * @return NULL - Not found version hash, or failed to invoke the internal interface.
218  * @since 10
219  */
220 const char *OH_GetBuildRootHash(void);
221 
222 /**
223  * Obtains the Distribution OS name represented by a string.
224  *
225  * <p>Independent Software Vendor (ISV) may distribute OHOS with their own OS name.
226  * If ISV not specified, it will return an empty string
227  * @syscap SystemCapability.Startup.SystemInfo
228  * @return NULL - Not found distribution OS name, or failed to invoke the internal interface.
229  * @since 10
230  */
231 const char *OH_GetDistributionOSName(void);
232 
233 /**
234  * Obtains the ISV distribution OS version represented by a string.
235  * If ISV not specified, it will return the same value as OH_GetOSFullName
236  * @syscap SystemCapability.Startup.SystemInfo
237  * @return NULL - Not found distribution OS version, or failed to invoke the internal interface.
238  * @since 10
239  */
240 const char *OH_GetDistributionOSVersion(void);
241 
242 /**
243  * Obtains the ISV distribution OS api version represented by a integer.
244  * If ISV not specified, it will return the same value as OH_GetSdkApiVersion
245  * @syscap SystemCapability.Startup.SystemInfo
246  * @return NULL - Not found distribution OS api version, or failed to invoke the internal interface.
247  * @since 10
248  */
249 int OH_GetDistributionOSApiVersion(void);
250 
251 /**
252  * Obtains the ISV distribution OS release type represented by a string.
253  * If ISV not specified, it will return the same value as OH_GetOsReleaseType
254  * @syscap SystemCapability.Startup.SystemInfo
255  * @return NULL - Not found distribution OS release type, or failed to invoke the internal interface.
256  * @since 10
257  */
258 const char *OH_GetDistributionOSReleaseType(void);
259 
260 #ifdef __cplusplus
261 #if __cplusplus
262 }
263 #endif
264 #endif
265 #endif
266