1 /*
2  * Copyright (c) 2024 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 #include "device_info_ffi.h"
17 #include "device_info.h"
18 #include "log.h"
19 
20 namespace OHOS {
21 namespace CJSystemapi {
22 namespace DeviceInfo {
23 
24 extern "C" {
FfiOHOSDeviceInfoGetHardwareProfile()25 const char* FfiOHOSDeviceInfoGetHardwareProfile()
26 {
27     LOGI("DeviceInfo::FfiOHOSDeviceInfoGetHardwareProfile");
28     return DeviceInfo::CjGetHardwareProfile();
29 }
30 
FfiOHOSDeviceInfoOsFullName()31 const char* FfiOHOSDeviceInfoOsFullName()
32 {
33     LOGI("DeviceInfo::FfiOHOSDeviceInfoOsFullName");
34     return DeviceInfo::CjGetOsFullName();
35 }
36 
FfiOHOSDeviceInfoProductModel()37 const char* FfiOHOSDeviceInfoProductModel()
38 {
39     LOGI("DeviceInfo::FfiOHOSDeviceInfoProductModel");
40     return DeviceInfo::CjGetProductModel();
41 }
42 
FfiOHOSDeviceInfoBrand()43 const char* FfiOHOSDeviceInfoBrand()
44 {
45     LOGI("DeviceInfo::FfiOHOSDeviceInfoBrand");
46     return DeviceInfo::CjGetBrand();
47 }
48 
FfiOHOSDeviceInfoUdid()49 const char* FfiOHOSDeviceInfoUdid()
50 {
51     LOGI("DeviceInfo::FfiOHOSDeviceInfoUdid");
52     return DeviceInfo::CjGetUdid();
53 }
54 
FfiOHOSDeviceInfoBuildRootHash()55 const char* FfiOHOSDeviceInfoBuildRootHash()
56 {
57     LOGI("DeviceInfo::FfiOHOSDeviceInfoBuildRootHash");
58     return DeviceInfo::CjGetBuildRootHash();
59 }
60 
FfiOHOSDeviceInfoBuildTime()61 const char* FfiOHOSDeviceInfoBuildTime()
62 {
63     LOGI("DeviceInfo::FfiOHOSDeviceInfoBuildTime");
64     return DeviceInfo::CjGetBuildTime();
65 }
66 
FfiOHOSDeviceInfoBuildHost()67 const char* FfiOHOSDeviceInfoBuildHost()
68 {
69     LOGI("DeviceInfo::FfiOHOSDeviceInfoBuildHost");
70     return DeviceInfo::CjGetBuildHost();
71 }
72 
FfiOHOSDeviceInfoBuildUser()73 const char* FfiOHOSDeviceInfoBuildUser()
74 {
75     LOGI("DeviceInfo::FfiOHOSDeviceInfoBuildUser");
76     return DeviceInfo::CjGetBuildUser();
77 }
78 
FfiOHOSDeviceInfoBuildType()79 const char* FfiOHOSDeviceInfoBuildType()
80 {
81     LOGI("DeviceInfo::FfiOHOSDeviceInfoBuildType");
82     return DeviceInfo::CjGetBuildType();
83 }
84 
FfiOHOSDeviceInfoDeviceType()85 const char* FfiOHOSDeviceInfoDeviceType()
86 {
87     LOGI("DeviceInfo::FfiOHOSFILEGetPath");
88     return DeviceInfo::CjGetDeviceType();
89 }
90 
FfiOHOSDeviceInfoVersionId()91 const char* FfiOHOSDeviceInfoVersionId()
92 {
93     LOGI("DeviceInfo::FfiOHOSDeviceInfoVersionId");
94     return DeviceInfo::CjGetVersionId();
95 }
96 
FfiOHOSDeviceInfoFirstApiVersion()97 int64_t FfiOHOSDeviceInfoFirstApiVersion()
98 {
99     LOGI("DeviceInfo::FfiOHOSDeviceInfoFirstApiVersion");
100     return DeviceInfo::CjGetFirstApiVersion();
101 }
102 
FfiOHOSDeviceInfoSdkApiVersion()103 int64_t FfiOHOSDeviceInfoSdkApiVersion()
104 {
105     LOGI("DeviceInfo::FfiOHOSDeviceInfoSdkApiVersion");
106     return DeviceInfo::CjGetSdkApiVersion();
107 }
108 
FfiOHOSDeviceInfoBuildVersion()109 int64_t FfiOHOSDeviceInfoBuildVersion()
110 {
111     LOGI("DeviceInfo::FfiOHOSDeviceInfoBuildVersion");
112     return DeviceInfo::CjGetBuildVersion();
113 }
114 
FfiOHOSDeviceInfoFeatureVersion()115 int64_t FfiOHOSDeviceInfoFeatureVersion()
116 {
117     LOGI("DeviceInfo::FfiOHOSDeviceInfoFeatureVersion");
118     return DeviceInfo::CjGetFeatureVersion();
119 }
120 
FfiOHOSDeviceInfoSeniorVersion()121 int64_t FfiOHOSDeviceInfoSeniorVersion()
122 {
123     LOGI("DeviceInfo::FfiOHOSDeviceInfoSeniorVersion");
124     return DeviceInfo::CjGetSeniorVersion();
125 }
126 
FfiOHOSDeviceInfoMajorVersion()127 int64_t FfiOHOSDeviceInfoMajorVersion()
128 {
129     LOGI("DeviceInfo::FfiOHOSDeviceInfoMajorVersion");
130     return DeviceInfo::CjGetMajorVersion();
131 }
132 
FfiOHOSDeviceInfoDisplayVersion()133 const char* FfiOHOSDeviceInfoDisplayVersion()
134 {
135     LOGI("DeviceInfo::FfiOHOSDeviceInfoDisplayVersion");
136     return DeviceInfo::CjGetDisplayVersion();
137 }
138 
FfiOHOSDeviceInfoSerial()139 const char* FfiOHOSDeviceInfoSerial()
140 {
141     LOGI("DeviceInfo::FfiOHOSDeviceInfoSerial");
142     return DeviceInfo::CjGetSerial();
143 }
144 
FfiOHOSDeviceInfoOsReleaseType()145 const char* FfiOHOSDeviceInfoOsReleaseType()
146 {
147     LOGI("DeviceInfo::FfiOHOSDeviceInfoOsReleaseType");
148     return DeviceInfo::CjGetOsReleaseType();
149 }
150 
FfiOHOSDeviceInfoIncrementalVersion()151 const char* FfiOHOSDeviceInfoIncrementalVersion()
152 {
153     LOGI("DeviceInfo::FfiOHOSDeviceInfoIncrementalVersion");
154     return DeviceInfo::CjGetIncrementalVersion();
155 }
156 
FfiOHOSDeviceInfoSecurityPatchTag()157 const char* FfiOHOSDeviceInfoSecurityPatchTag()
158 {
159     LOGI("DeviceInfo::FfiOHOSDeviceInfoSecurityPatchTag");
160     return DeviceInfo::CjGetSecurityPatchTag();
161 }
162 
FfiOHOSDeviceInfoAbiList()163 const char* FfiOHOSDeviceInfoAbiList()
164 {
165     LOGI("DeviceInfo::FfiOHOSDeviceInfoAbiList");
166     return DeviceInfo::CjGetAbiList();
167 }
168 
FfiOHOSDeviceInfoBootloaderVersion()169 const char* FfiOHOSDeviceInfoBootloaderVersion()
170 {
171     LOGI("DeviceInfo::FfiOHOSDeviceInfoBootloaderVersion");
172     return DeviceInfo::CjGetBootloaderVersion();
173 }
174 
FfiOHOSDeviceInfoHardwareModel()175 const char* FfiOHOSDeviceInfoHardwareModel()
176 {
177     LOGI("DeviceInfo::FfiOHOSDeviceInfoHardwareModel");
178     return DeviceInfo::CjGetHardwareModel();
179 }
180 
FfiOHOSDeviceInfoSoftwareModel()181 const char* FfiOHOSDeviceInfoSoftwareModel()
182 {
183     LOGI("DeviceInfo::FfiOHOSDeviceInfoSoftwareModel");
184     return DeviceInfo::CjGetSoftwareModel();
185 }
186 
FfiOHOSDeviceInfoProductSeries()187 const char* FfiOHOSDeviceInfoProductSeries()
188 {
189     LOGI("DeviceInfo::FfiOHOSDeviceInfoProductSeries");
190     return DeviceInfo::CjGetProductSeries();
191 }
192 
FfiOHOSDeviceInfoMarketName()193 const char* FfiOHOSDeviceInfoMarketName()
194 {
195     LOGI("DeviceInfo::FfiOHOSDeviceInfoMarketName");
196     return DeviceInfo::CjGetMarketName();
197 }
198 
FfiOHOSDeviceInfoManufacture()199 const char* FfiOHOSDeviceInfoManufacture()
200 {
201     LOGI("DeviceInfo::FfiOHOSDeviceInfoManufacture");
202     return DeviceInfo::CjGetManufacture();
203 }
204 
FfiOHOSDeviceInfoDistributionOSName()205 const char* FfiOHOSDeviceInfoDistributionOSName()
206 {
207     LOGI("DeviceInfo::FfiOHOSDeviceInfoDistributionOSName");
208     return DeviceInfo::CjGetDistributionOSName();
209 }
210 
FfiOHOSDeviceInfoDistributionOSVersion()211 const char* FfiOHOSDeviceInfoDistributionOSVersion()
212 {
213     LOGI("DeviceInfo::FfiOHOSDeviceInfoDistributionOSVersion");
214     return DeviceInfo::CjGetDistributionOSVersion();
215 }
216 
FfiOHOSDeviceInfoDistributionOSApiVersion()217 int64_t FfiOHOSDeviceInfoDistributionOSApiVersion()
218 {
219     LOGI("DeviceInfo::FfiOHOSDeviceInfoDistributionOSApiVersion");
220     return DeviceInfo::CjGetDistributionOSApiVersion();
221 }
222 
FfiOHOSDeviceInfoDistributionOSReleaseType()223 const char* FfiOHOSDeviceInfoDistributionOSReleaseType()
224 {
225     LOGI("DeviceInfo::FfiOHOSDeviceInfoDistributionOSReleaseType");
226     return DeviceInfo::CjGetDistributionOSReleaseType();
227 }
228 }
229 
230 } // DeviceInfo
231 } // CJSystemapi
232 } // OHOS