1 /*
2 * Copyright (C) 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 #include "parameter.h"
17 #include "securec.h"
18
19 int g_ret = 0;
20
SetParameter(const char * key,const char * value)21 int SetParameter(const char *key, const char *value)
22 {
23 (void)key;
24 (void)value;
25 return 0;
26 }
27
GetParameter(const char * key,const char * def,char * value,unsigned int len)28 int GetParameter(const char *key, const char *def, char *value, unsigned int len)
29 {
30 char name[5] = "true";
31 (void)memcpy_s(value, sizeof(name), name, sizeof(name));
32 (void)key;
33 (void)def;
34 (void)len;
35 return 1;
36 }
37
WatchParameter(const char * keyprefix,ParameterChgPtr callback,void * context)38 int WatchParameter(const char *keyprefix, ParameterChgPtr callback, void *context)
39 {
40 (void)keyprefix;
41 (void)callback;
42 (void)context;
43 return g_ret;
44 }
45
WaitParameter(const char * key,const char * value,int timeout)46 int WaitParameter(const char *key, const char *value, int timeout)
47 {
48 g_ret = timeout;
49 return 0;
50 }