Add API to get access list
[platform/core/connectivity/libwifi-direct.git] / src / wifi-direct-utils.c
1 /*
2  * libwifi-direct
3  *
4  * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Sungsik Jang <sungsik.jang@samsung.com>, Dongwook Lee <dwmax.lee@samsung.com> 
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #include <stdio.h>
23 #include <string.h>
24 #include <stdbool.h>
25 #include <errno.h>
26 #include <sys/time.h>
27
28 #define _GNU_SOURCE
29 #include <unistd.h>
30 #include <sys/syscall.h>
31
32 #include "wifi-direct.h"
33 #include "wifi-direct-client-proxy.h"
34 #include "wifi-direct-internal.h"
35
36
37 char *wfd_print_state(wifi_direct_state_e s)
38 {
39         switch (s)
40         {
41         case WIFI_DIRECT_STATE_DEACTIVATED:
42                 return "DEACTIVATED";
43                 break;
44         case WIFI_DIRECT_STATE_DEACTIVATING:
45                 return "DEACTIVATING";
46                 break;
47         case WIFI_DIRECT_STATE_ACTIVATING:
48                 return "ACTIVATING";
49                 break;
50         case WIFI_DIRECT_STATE_ACTIVATED:
51                 return "ACTIVATED";
52                 break;
53         case WIFI_DIRECT_STATE_DISCOVERING:
54                 return "DISCOVERING";
55                 break;
56         case WIFI_DIRECT_STATE_CONNECTING:
57                 return "CONNECTING";
58                 break;
59         case WIFI_DIRECT_STATE_DISCONNECTING:
60                 return "DISCONNECTING";
61                 break;
62         case WIFI_DIRECT_STATE_CONNECTED:
63                 return "CONNECTED";
64                 break;
65         case WIFI_DIRECT_STATE_GROUP_OWNER:
66                 return "GROUP OWNER";
67                 break;
68         default:
69                 return "Unknown";
70         }
71 }