gboolean _mobileap_clear_state(int state);
-int _mobileap_is_disabled(void);
-int _mobileap_is_enabled(int state);
+gboolean _mobileap_is_disabled(void);
+gboolean _mobileap_is_enabled(mobile_ap_type_e type);
gboolean _mobileap_set_state(int state);
#endif
mobile_ap_station_info_t *si = NULL;
int i = 0;
+ if (_get_station_info(info->mac, _slist_find_station_by_mac, &si) ==
+ MOBILE_AP_ERROR_NONE) {
+ DBG("Already exist station : %s\n", info->mac);
+ return MOBILE_AP_ERROR_INTERNAL;
+ }
+
station_list = g_slist_append(station_list, info);
for (l = station_list; l != NULL; l = g_slist_next(l)) {
si = (mobile_ap_station_info_t *)l->data;
return TRUE;
}
-int _mobileap_is_disabled(void)
+gboolean _mobileap_is_disabled(void)
{
- return !mobileap_state;
+ return mobileap_state ? FALSE : TRUE;
}
-int _mobileap_is_enabled(int state)
+gboolean _mobileap_is_enabled(mobile_ap_type_e type)
{
- return (mobileap_state & state) ? 1 : 0;
+ return (mobileap_state & type) ? TRUE : FALSE;
}
gboolean _mobileap_clear_state(int state)
dbus_error_free(&error);
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
-
DBG("DhcpConnected signal : %s %s %s\n", ip_addr, mac, name);
if (_get_tethering_type_from_ip(ip_addr, &type) != MOBILE_AP_ERROR_NONE)
return DBUS_HANDLER_RESULT_HANDLED;
+ if (_mobileap_is_enabled(type) != FALSE) {
+ DBG("Tethering[%d] is disabled. Ignore ACK\n", type);
+ return DBUS_HANDLER_RESULT_HANDLED;
+ }
+
info = (mobile_ap_station_info_t *)malloc(sizeof(mobile_ap_station_info_t));
if (info == NULL) {
ERR("malloc failed\n");
}
}
- _add_station_info(info);
+ if (_add_station_info(info) != MOBILE_AP_ERROR_NONE) {
+ free(info);
+ return DBUS_HANDLER_RESULT_HANDLED;
+ }
+
_send_dbus_station_info("DhcpConnected", info);
return DBUS_HANDLER_RESULT_HANDLED;