Fix for wrong statement
[platform/core/api/nfc.git] / src / net_nfc_client_context.c
1 /*
2  * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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 "vconf.h"
18
19 #include "net_nfc_typedef.h"
20 #include "net_nfc_client.h"
21
22 #ifndef NET_NFC_EXPORT_API
23 #define NET_NFC_EXPORT_API __attribute__((visibility("default")))
24 #endif
25
26 /* LCOV_EXCL_START */
27
28
29 NET_NFC_EXPORT_API
30 net_nfc_error_e net_nfc_client_initialize()
31 {
32         net_nfc_error_e result = NET_NFC_OK;
33
34         net_nfc_client_gdbus_init();
35
36         return result;
37 }
38
39
40 NET_NFC_EXPORT_API
41 net_nfc_error_e net_nfc_client_deinitialize()
42 {
43         net_nfc_error_e result = NET_NFC_OK;
44
45         net_nfc_client_gdbus_deinit();
46
47         return result;
48 }
49
50
51 NET_NFC_EXPORT_API
52 net_nfc_error_e net_nfc_client_is_nfc_supported(int *state)
53 {
54         net_nfc_error_e ret;
55
56         if (state != NULL) {
57                 if (vconf_get_bool(VCONFKEY_NFC_FEATURE, state) == 0)
58                         ret = NET_NFC_OK;
59                 else
60                         ret = NET_NFC_INVALID_STATE;
61         } else {
62                 ret = NET_NFC_NULL_PARAMETER;
63         }
64
65         return ret;
66 }
67
68
69 NET_NFC_EXPORT_API
70 net_nfc_error_e net_nfc_client_get_nfc_state(int *state)
71 {
72         net_nfc_error_e ret;
73
74         if (state != NULL) {
75                 if (vconf_get_bool(VCONFKEY_NFC_STATE, state) == 0)
76                         ret = NET_NFC_OK;
77                 else
78                         ret = NET_NFC_INVALID_STATE;
79         } else {
80                 ret = NET_NFC_NULL_PARAMETER;
81         }
82
83         return ret;
84 }
85
86 /* LCOV_EXCL_STOP */
87