1 /* 2 * Copyright (c) 2021-2022 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 INIT_PARAM_COMM_H 17 #define INIT_PARAM_COMM_H 18 #include <stdint.h> 19 #include "beget_ext.h" 20 21 #ifdef __cplusplus 22 #if __cplusplus 23 extern "C" { 24 #endif 25 #endif /* __cplusplus */ 26 27 #define UDID_LEN 65 28 #define MAX_SERIAL_LEN 65 29 #define HASH_LENGTH 32 30 #define DEV_BUF_LENGTH 3 31 #define DEV_BUF_MAX_LENGTH 1024 32 33 typedef char *(*PropertyValueProcessor)(const char *key, char *value); 34 35 INIT_LOCAL_API const char *GetProperty(const char *key, const char **paramHolder); 36 INIT_LOCAL_API PropertyValueProcessor SetPropertyGetProcessor(PropertyValueProcessor processor); 37 INIT_LOCAL_API int GetParameter_(const char *key, const char *def, char *value, uint32_t len); 38 39 INIT_LOCAL_API const char *GetProductModel_(void); 40 INIT_LOCAL_API const char *GetManufacture_(void); 41 INIT_LOCAL_API const char *GetSerial_(void); 42 INIT_LOCAL_API int GetDevUdid_(char *udid, int size); 43 INIT_LOCAL_API int IsValidParamValue(const char *value, uint32_t len); 44 45 INIT_LOCAL_API const char *GetFullName_(void); 46 INIT_LOCAL_API int GetSystemError(int err); 47 #ifdef __cplusplus 48 #if __cplusplus 49 } 50 #endif 51 #endif /* __cplusplus */ 52 53 #endif // STARTUP_PARAM_COMM_H 54