06b9c4c830c0525df3a06da99e9a6f6101b70bc8
[profile/tv/apps/native/settings.git] / ug / network / include / common.h
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
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 #ifndef __NETWORK_COMMON_H__
18 #define __NETWORK_COMMON_H__
19
20
21 #include <wifi.h>
22 #include "WifiMgr.h"
23
24
25 #define IP_STRING_MAX_SIZE 20
26 #define MAX_NAME_SIZE 256
27 #define CONTENT_TXT_SIZE 500
28
29 enum network_type_enum {
30         TYPE_WIRELESS = 0,
31         TYPE_WIRED
32 };
33
34 enum setting_mode {
35         MODE_INVALID = 0,
36         MODE_AUTO,
37         MODE_MAN
38 };
39
40 enum action_btn_enum {
41         CONNECT = 0,
42         REFRESH,
43         OTHER,
44         CLOSE
45 };
46
47 enum view_type {
48         NETWORK_MAIN_VIEW = 0,
49         NETWORK_WIFI_PASSCODE_VIEW,
50         NETWORK_IP_SETTING_VIEW
51 };
52
53 struct connection_info {
54         enum network_type_enum cur_type;
55         char name[MAX_NAME_SIZE];
56         wifi_ap_h ap;
57 };
58
59 struct network_info {
60         char ip_addr[IP_STRING_MAX_SIZE + 1];
61         char submask[IP_STRING_MAX_SIZE + 1];
62         char gateway[IP_STRING_MAX_SIZE + 1];
63         char dns[IP_STRING_MAX_SIZE + 1];
64 };
65
66 #define SSID_MAX_LENTH 256
67 #define PWD_MAX_LENTH 256
68
69 #define BTN_ACT 4
70 #define BTN_TYPE 2
71 #define TIMER_INTERNAL 0.1
72 #define KEY_PRIV "priv"
73 #define TYPE_POPUP_X_OFFSET 190
74
75 struct wifi_ap_info {
76         char essid[SSID_MAX_LENTH];
77         char bssid[SSID_MAX_LENTH];
78         int rssi;
79         int frequency;
80         int max_speed;
81         wifi_security_type_e secure_type;
82         wifi_encryption_type_e encryption_type;
83         bool passphrase_required;
84         int wps_supported;
85         wifi_connection_state_e state;
86
87         wifi_ip_config_type_e ip_type;
88         wifi_proxy_type_e proxy_type;
89         wifi_encryption_type_e enc_type;
90         wifi_eap_type_e eap_type;
91         wifi_eap_auth_type_e eap_auth_type;
92
93         CWifiAp *ap;
94         void *user_data;
95 };
96 #endif /* __NETWORK_COMMON_H__ */