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 <securec.h>
17
18 #include "syspara/parameter.h"
19
20 namespace {
21 constexpr int32_t buffSize = 10; // buff len: 64
22 char value_[buffSize] = "light";
23 } // namespace
24
GetParameter(const char * key,const char * def,char * value,unsigned int len)25 int GetParameter(const char* key, const char* def, char* value, unsigned int len)
26 {
27 (void)key;
28 (void)def;
29 (void)strncpy_s(value, len, value_, buffSize);
30 return 1;
31 }
32
SetParameter(const char * key,const char * value)33 int SetParameter(const char* key, const char* value)
34 {
35 (void)key;
36 (void)strncpy_s(value_, buffSize, value, strlen(value) + 1);
37 return 0;
38 }
39