3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #ifndef __MOBILEAP_INTERNAL_H__
19 #define __MOBILEAP_INTERNAL_H__
25 /* Client / Agent common */
26 #define DBUS_STRUCT_UINT_STRING (dbus_g_type_get_struct ("GValueArray", \
27 G_TYPE_UINT, G_TYPE_STRING, G_TYPE_INVALID))
29 #define DBUS_STRUCT_STATIONS (dbus_g_type_get_struct ("GValueArray", \
30 G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING, \
31 G_TYPE_STRING, G_TYPE_INVALID))
33 #define DBUS_STRUCT_STATION (dbus_g_type_get_struct ("GValueArray", \
34 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, \
37 #define DBUS_STRUCT_INTERFACE (dbus_g_type_get_struct ("GValueArray", \
38 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, \
39 G_TYPE_STRING, G_TYPE_INVALID))
42 #define TETHERING_SERVICE_OBJECT_PATH "/Tethering"
43 #define TETHERING_SERVICE_NAME "org.tizen.tethering"
44 #define TETHERING_SERVICE_INTERFACE "org.tizen.tethering"
46 #define SIGNAL_NAME_NET_CLOSED "net_closed"
47 #define SIGNAL_NAME_STA_CONNECT "sta_connected"
48 #define SIGNAL_NAME_STA_DISCONNECT "sta_disconnected"
49 #define SIGNAL_NAME_WIFI_TETHER_ON "wifi_on"
50 #define SIGNAL_NAME_WIFI_TETHER_OFF "wifi_off"
51 #define SIGNAL_NAME_USB_TETHER_ON "usb_on"
52 #define SIGNAL_NAME_USB_TETHER_OFF "usb_off"
53 #define SIGNAL_NAME_BT_TETHER_ON "bluetooth_on"
54 #define SIGNAL_NAME_BT_TETHER_OFF "bluetooth_off"
55 #define SIGNAL_NAME_NO_DATA_TIMEOUT "no_data_timeout"
56 #define SIGNAL_NAME_LOW_BATTERY_MODE "low_batt_mode"
57 #define SIGNAL_NAME_FLIGHT_MODE "flight_mode"
58 #define SIGNAL_NAME_DHCP_STATUS "dhcp_status"
59 #define SIGNAL_NAME_SECURITY_TYPE_CHANGED "security_type_changed"
60 #define SIGNAL_NAME_SSID_VISIBILITY_CHANGED "ssid_visibility_changed"
61 #define SIGNAL_NAME_PASSPHRASE_CHANGED "passphrase_changed"
63 #define SIGNAL_MSG_NOT_AVAIL_INTERFACE "Interface is not available"
64 #define SIGNAL_MSG_TIMEOUT "There is no connection for a while"
65 #define SIGNAL_MSG_SSID_VISIBLE "ssid_visible"
66 #define SIGNAL_MSG_SSID_HIDE "ssid_hide"
68 #define DNSMASQ_LEASES_FILE "/var/lib/misc/dnsmasq.leases"
69 #define IP_USB_SUBNET "192.168.129"
74 E_SIGNAL_STA_DISCONNECT,
75 E_SIGNAL_WIFI_TETHER_ON,
76 E_SIGNAL_WIFI_TETHER_OFF,
77 E_SIGNAL_USB_TETHER_ON,
78 E_SIGNAL_USB_TETHER_OFF,
79 E_SIGNAL_BT_TETHER_ON,
80 E_SIGNAL_BT_TETHER_OFF,
81 E_SIGNAL_NO_DATA_TIMEOUT,
82 E_SIGNAL_LOW_BATTERY_MODE,
84 E_SIGNAL_SECURITY_TYPE_CHANGED,
85 E_SIGNAL_SSID_VISIBILITY_CHANGED,
86 E_SIGNAL_PASSPHRASE_CHANGED,
91 * WiFi tethering configuration
93 #define MOBILE_AP_WIFI_CHANNEL 7 /**< Channel number */
94 #define MOBILE_AP_WIFI_BSSID_LEN 6 /**< BSSID Length */
95 #define MOBILE_AP_WIFI_SSID_MAX_LEN 31 /**< Maximum length of ssid */
96 #define MOBILE_AP_WIFI_KEY_MIN_LEN 8 /**< Minimum length of wifi key */
97 #define MOBILE_AP_WIFI_KEY_MAX_LEN 63 /**< Maximum length of wifi key */
100 * Common configuration
102 #define MOBILE_AP_MAX_WIFI_STA 8
103 #define MOBILE_AP_MAX_BT_STA 7
104 #define MOBILE_AP_MAX_USB_STA 1
105 #define MOBILE_AP_MAX_CONNECTED_STA 16 /**< Maximum connected station. 8(Wi-Fi) + 7(BT) + 1(USB) */
107 #define MOBILE_AP_STR_INFO_LEN 20 /**< length of the ip or mac address*/
108 #define MOBILE_AP_STR_HOSTNAME_LEN 32 /**< length of the hostname */
109 #define MOBILE_AP_NAME_UNKNOWN "UNKNOWN"
112 * Mobile AP error code
115 MOBILE_AP_ERROR_NONE, /**< No error */
116 MOBILE_AP_ERROR_RESOURCE, /**< Socket creation error, file open error */
117 MOBILE_AP_ERROR_INTERNAL, /**< Driver related error */
118 MOBILE_AP_ERROR_INVALID_PARAM, /**< Invalid parameter */
119 MOBILE_AP_ERROR_ALREADY_ENABLED, /**< Mobile AP is already ON */
120 MOBILE_AP_ERROR_NOT_ENABLED, /**< Mobile AP is not ON, so cannot be disabled */
121 MOBILE_AP_ERROR_NET_OPEN, /**< PDP network open error */
122 MOBILE_AP_ERROR_NET_CLOSE, /**< PDP network close error */
123 MOBILE_AP_ERROR_DHCP, /**< DHCP error */
124 MOBILE_AP_ERROR_IN_PROGRESS, /**< Request is in progress */
125 MOBILE_AP_ERROR_NOT_PERMITTED, /**< Operation is not permitted */
128 } mobile_ap_error_code_e;
131 * Event type on callback
134 MOBILE_AP_ENABLE_CFM, /* mobile_ap_enable() */
135 MOBILE_AP_DISABLE_CFM, /* mobile_ap_disable() */
137 MOBILE_AP_ENABLE_WIFI_TETHERING_CFM, /* mobile_ap_enable_wifi_tethering() */
138 MOBILE_AP_DISABLE_WIFI_TETHERING_CFM, /* mobile_ap_disable_wifi_tethering() */
139 MOBILE_AP_CHANGE_WIFI_CONFIG_CFM, /* mobile_ap_change_wifi_config() */
141 MOBILE_AP_ENABLE_USB_TETHERING_CFM, /* mobile_ap_enable_usb_tethering() */
142 MOBILE_AP_DISABLE_USB_TETHERING_CFM, /* mobile_ap_disable_usb_tethering() */
144 MOBILE_AP_ENABLE_BT_TETHERING_CFM, /* mobile_ap_enable_bt_tethering() */
145 MOBILE_AP_DISABLE_BT_TETHERING_CFM, /* mobile_ap_disable_bt_tethering() */
147 MOBILE_AP_GET_STATION_INFO_CFM, /* mobile_ap_get_station_info() */
148 MOBILE_AP_GET_DATA_PACKET_USAGE_CFM, /* mobile_ap_get_data_packet_usage() */
150 MOBILE_AP_DISABLED_IND, /* Turning off tethering service indication */
152 MOBILE_AP_ENABLED_WIFI_TETHERING_IND, /* Turning on WiFi tethering indication */
153 MOBILE_AP_DISABLED_WIFI_TETHERING_IND, /* Turning off WiFi tethering indication */
155 MOBILE_AP_ENABLED_USB_TETHERING_IND, /* Turning on USB tethering indication */
156 MOBILE_AP_DISABLED_USB_TETHERING_IND, /* Turning off USB tethering indication */
158 MOBILE_AP_ENABLED_BT_TETHERING_IND, /* Turning on BT tethering indication */
159 MOBILE_AP_DISABLED_BT_TETHERING_IND, /* Turning off BT tethering indication */
161 MOBILE_AP_STATION_CONNECT_IND, /* Station connection indication */
162 MOBILE_AP_STATION_DISCONNECT_IND, /* Station disconnection indication */
163 MOBILE_AP_USB_STATION_CONNECT_IND,
176 unsigned long long pdp_tx_bytes; /**< packet data transmitted */
177 unsigned long long pdp_rx_bytes; /**< packet data received */
178 } mobile_ap_data_packet_usage_t;
181 mobile_ap_type_e interface; /**< interface type */
182 char ip[MOBILE_AP_STR_INFO_LEN]; /**< assigned IP address */
183 char mac[MOBILE_AP_STR_INFO_LEN]; /**< MAC Address */
184 char hostname[MOBILE_AP_STR_HOSTNAME_LEN]; /**< alphanumeric name */
185 } mobile_ap_station_info_t;
188 mobile_ap_type_e interface; /**< interface type */
189 char interface_name[MOBILE_AP_STR_INFO_LEN]; /**< interface alphanumeric name */
190 char ip_address[MOBILE_AP_STR_INFO_LEN]; /**< assigned ip addresss to interface */
191 char gateway_address[MOBILE_AP_STR_INFO_LEN]; /**< gateway address of interface */
192 char subnet_mask[MOBILE_AP_STR_INFO_LEN]; /**< subnet mask of interface */
193 } mobile_ap_interface_info_t;
196 unsigned short number; /**< Number of connected device */
197 mobile_ap_station_info_t sta_info[MOBILE_AP_MAX_CONNECTED_STA];
198 } mobile_ap_device_info_t;
204 #endif /* __MOBILEAP_INTERNAL_H__ */