1 /*
2  * Copyright 2024 NXP
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "phNxpNciHal_VendorProp.h"
18 #undef PROPERTY_VALUE_MAX
19 #undef property_get
20 #undef property_set
21 #include <cutils/properties.h>
22 
23 /******************************************************************************
24  * Function         phNxpNciHal_getVendorProp_int32
25  *
26  * Description      This function will read and return property
27  *                  value of input key as integer.
28  * Parameters       key - property string for which value to be read.
29  *                  default_value - default value to be return if property not
30  *                  set.
31  *
32  * Returns          integer value of key from vendor properties if set else
33  *                  return the input default_value.
34  *
35  ******************************************************************************/
phNxpNciHal_getVendorProp_int32(const char * key,int32_t default_value)36 int32_t phNxpNciHal_getVendorProp_int32(const char* key,
37                                         int32_t default_value) {
38   return property_get_int32(key, default_value);
39 }
40 
41 /******************************************************************************
42  * Function         phNxpNciHal_setVendorProp
43  *
44  * Description      This function will set the value for input property.
45  *
46  * Parameters       key - property string for which value to be set.
47  *                  value - value of key property be set.
48  *
49  * Returns          returns 0 on success and, < 0 on failure
50  *
51  ******************************************************************************/
phNxpNciHal_setVendorProp(const char * key,const char * value)52 int phNxpNciHal_setVendorProp(const char* key, const char* value) {
53   return property_set(key, value);
54 }
55