Fix auto connection failure
[platform/upstream/connman.git] / include / technology.h
1 /*
2  *
3  *  Connection Manager
4  *
5  *  Copyright (C) 2007-2013  Intel Corporation. All rights reserved.
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License version 2 as
9  *  published by the Free Software Foundation.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  */
21
22 #ifndef __CONNMAN_TECHNOLOGY_H
23 #define __CONNMAN_TECHNOLOGY_H
24
25 #include <connman/service.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 /**
32  * SECTION:technology
33  * @title: technology premitives
34  * @short_description: Functions for handling technology details
35  */
36
37 #if defined TIZEN_EXT
38 typedef enum {
39         CONNMAN_MULTI_SCAN_SSID = 0x01,
40         CONNMAN_MULTI_SCAN_FREQ,
41         CONNMAN_MULTI_SCAN_SSID_FREQ,
42 } connman_multi_scan_type_e;
43
44 typedef enum {
45         CONNMAN_SCAN_TYPE_FULL_CHANNEL = 0x00,
46         CONNMAN_SCAN_TYPE_SPECIFIC_AP,
47         CONNMAN_SCAN_TYPE_MULTI_AP,
48         CONNMAN_SCAN_TYPE_WPA_SUPPLICANT,
49         CONNMAN_SCAN_TYPE_UNKNOWN,
50 } connman_scan_type_e;
51
52 typedef struct {
53         char str[128];
54         gboolean flag;
55 } connman_multi_scan_ap_s;
56 #endif
57
58 struct connman_technology;
59
60 int connman_technology_tethering_notify(struct connman_technology *technology,
61                                                         bool enabled);
62 int connman_technology_set_regdom(const char *alpha2);
63 void connman_technology_regdom_notify(struct connman_technology *technology,
64                                                         const char *alpha2);
65
66 enum connman_service_type connman_technology_get_type
67                                 (struct connman_technology *technology);
68 bool connman_technology_get_wifi_tethering(const char **ssid,
69                                                         const char **psk);
70 bool connman_technology_is_tethering_allowed(enum connman_service_type type);
71
72 struct connman_technology_driver {
73         const char *name;
74         enum connman_service_type type;
75         int priority;
76         int (*probe) (struct connman_technology *technology);
77         void (*remove) (struct connman_technology *technology);
78         void (*add_interface) (struct connman_technology *technology,
79                                                 int index, const char *name,
80                                                         const char *ident);
81         void (*remove_interface) (struct connman_technology *technology,
82                                                                 int index);
83         int (*set_tethering) (struct connman_technology *technology,
84                                 const char *identifier, const char *passphrase,
85                                 const char *bridge, bool enabled);
86         int (*set_regdom) (struct connman_technology *technology,
87                                                 const char *alpha2);
88 };
89
90 int connman_technology_driver_register(struct connman_technology_driver *driver);
91 void connman_technology_driver_unregister(struct connman_technology_driver *driver);
92 #if defined TIZEN_EXT
93 const char *connman_techonology_get_path(enum connman_service_type type);
94 void __connman_technology_notify_scan_done(const char *ifname, int val);
95 void __connman_technology_append_interfaces(DBusMessageIter *array,
96                                 enum connman_service_type type, const char *ifname);
97 #endif
98
99 #ifdef __cplusplus
100 }
101 #endif
102
103 #endif /* __CONNMAN_TECHNOLOGY_H */