1 /*
2 * Copyright (c) 2020-2021 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 "parameter.h"
17 #include <stdio.h>
18 #include <stdlib.h>
19
ObtainProductParms()20 void ObtainProductParms()
21 {
22 const char *bootloaderVersion = GetBootloaderVersion();
23 if (bootloaderVersion != nullptr) {
24 printf("The bootloaderVersion is [%s]\n", bootloaderVersion);
25 }
26
27 const char *securityPatchTag = GetSecurityPatchTag();
28 if (securityPatchTag != nullptr) {
29 printf("The Security Patch is [%s]\n", securityPatchTag);
30 }
31
32 const char *abiList = GetAbiList();
33 if (abiList != nullptr) {
34 printf("The AbiList is [%s]\n", abiList);
35 }
36
37 int sdkApiLevel = GetSdkApiVersion();
38 if (sdkApiLevel != 0) {
39 printf("The sdkApiLevel is [%d]\n", sdkApiLevel);
40 }
41
42 int firstApiLevel = GetFirstApiVersion();
43 if (firstApiLevel != 0) {
44 printf("The firstApiLevel is [%d]\n", firstApiLevel);
45 }
46
47 const char *incrementalVersion = GetIncrementalVersion();
48 if (incrementalVersion != nullptr) {
49 printf("The productSeries is [%s]\n", incrementalVersion);
50 }
51
52 const char *versionId = GetVersionId();
53 if (versionId != nullptr) {
54 printf("The VersionID is [%s]\n", versionId);
55 }
56
57 const char *buildType = GetBuildType();
58 if (buildType != nullptr) {
59 printf("The buildType is [%s]\n", buildType);
60 }
61
62 const char *buildUser = GetBuildUser();
63 if (buildUser != nullptr) {
64 printf("The buildUser is [%s]\n", buildUser);
65 }
66
67 const char *buildHost = GetBuildHost();
68 if (buildHost != nullptr) {
69 printf("The buildHost is [%s]\n", buildHost);
70 }
71
72 const char *buildTime = GetBuildTime();
73 if (buildTime != nullptr) {
74 printf("The buildTime is [%s]\n", buildTime);
75 }
76
77 const char *buildRootHash = GetBuildRootHash();
78 if (buildRootHash != nullptr) {
79 printf("The BuildRootHash is [%s]\n", buildRootHash);
80 }
81 }
82
main()83 int main()
84 {
85 printf("******To Obtain Product Params Start******\n");
86 const char *productType = GetDeviceType();
87 if (productType != nullptr) {
88 printf("The Product Type is [%s]\n", productType);
89 }
90
91 const char *manuFacture = GetManufacture();
92 if (manuFacture != nullptr) {
93 printf("The manuFacture is [%s]\n", manuFacture);
94 }
95
96 const char *brand = GetBrand();
97 if (brand != nullptr) {
98 printf("The brand is [%s]\n", brand);
99 }
100
101 const char *marketName = GetMarketName();
102 if (marketName != nullptr) {
103 printf("The marketName is [%s]\n", marketName);
104 }
105
106 const char *productSeries = GetProductSeries();
107 if (productSeries != nullptr) {
108 printf("The productSeries is [%s]\n", productSeries);
109 }
110
111 const char *softwareModel = GetSoftwareModel();
112 if (softwareModel != nullptr) {
113 printf("The softwareModel is [%s]\n", softwareModel);
114 }
115
116 const char *hardWareModel = GetHardwareModel();
117 if (hardWareModel != nullptr) {
118 printf("The HardwareModel is [%s]\n", hardWareModel);
119 }
120
121 const char *hardWareProfile = GetHardwareProfile();
122 if (hardWareProfile != nullptr) {
123 printf("The HardwareProfile is [%s]\n", hardWareProfile);
124 }
125
126 const char *serial = GetSerial();
127 if (serial != nullptr) {
128 printf("The serial is [%s]\n", serial);
129 }
130
131 const char *osName = GetOSFullName();
132 if (osName != nullptr) {
133 printf("The osName is [%s]\n", osName);
134 }
135
136 const char *displayVersion = GetDisplayVersion();
137 if (displayVersion != nullptr) {
138 printf("The OS Version is [%s]\n", displayVersion);
139 }
140
141 ObtainProductParms();
142
143 printf("******To Obtain Product Params End ******\n");
144 return 0;
145 }
146