#define SIGNAL_NAME_LOW_BATTERY_MODE "low_batt_mode"
#define SIGNAL_NAME_FLIGHT_MODE "flight_mode"
#define SIGNAL_NAME_DHCP_STATUS "dhcp_status"
+#define SIGNAL_NAME_SECURITY_TYPE_CHANGED "security_type_changed"
+#define SIGNAL_NAME_SSID_VISIBILITY_CHANGED "ssid_visibility_changed"
+#define SIGNAL_NAME_PASSPHRASE_CHANGED "passphrase_changed"
#define SIGNAL_MSG_NOT_AVAIL_INTERFACE "Interface is not available"
#define SIGNAL_MSG_TIMEOUT "There is no connection for a while"
+#define SIGNAL_MSG_SSID_VISIBLE "ssid_visible"
+#define SIGNAL_MSG_SSID_HIDE "ssid_hide"
#define DNSMASQ_LEASES_FILE "/var/lib/misc/dnsmasq.leases"
#define IP_USB_SUBNET "192.168.129"
E_SIGNAL_NO_DATA_TIMEOUT,
E_SIGNAL_LOW_BATTERY_MODE,
E_SIGNAL_FLIGHT_MODE,
+ E_SIGNAL_SECURITY_TYPE_CHANGED,
+ E_SIGNAL_SSID_VISIBILITY_CHANGED,
+ E_SIGNAL_PASSPHRASE_CHANGED,
E_SIGNAL_MAX
} mobile_ap_sig_e;
g_assert(obj != NULL);
g_assert(context != NULL);
+ int old_hide_mode;
+
+ ret = __get_hide_mode(&old_hide_mode);
+ if (ret != MOBILE_AP_ERROR_NONE) {
+ ERR("__get_hide_mode is failed : %d\n", ret);
+ } else if (old_hide_mode == hide_mode) {
+ DBG("old_hide_mode == hide_mode\n");
+ dbus_g_method_return(context);
+ return TRUE;
+ }
+
ret = __set_hide_mode(hide_mode);
if (ret < 0) {
ERR("__set_hide_mode is failed : %d\n", ret);
}
+ _emit_mobileap_dbus_signal(obj, E_SIGNAL_SSID_VISIBILITY_CHANGED,
+ hide_mode == VCONFKEY_MOBILE_AP_HIDE_OFF ?
+ SIGNAL_MSG_SSID_VISIBLE :
+ SIGNAL_MSG_SSID_HIDE);
dbus_g_method_return(context);
return TRUE;
gboolean mobileap_set_wifi_tethering_security_type(MobileAPObject *obj,
gchar *security_type, DBusGMethodInvocation *context)
{
- int ret = 0;
+ mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
+ char old_security_type[SECURITY_TYPE_LEN] = {0, };
DBG("+\n");
g_assert(obj != NULL);
g_assert(context != NULL);
+ ret = __get_security_type(old_security_type, sizeof(old_security_type));
+ if (ret != MOBILE_AP_ERROR_NONE) {
+ ERR("__get_security_type is failed : %d\n", ret);
+ } else if (g_strcmp0(old_security_type, security_type) == 0) {
+ DBG("old_security_type == security_type\n");
+ dbus_g_method_return(context);
+ return TRUE;
+ }
+
ret = __set_security_type(security_type);
if (ret < 0) {
ERR("__set_security_type is failed: %d\n", ret);
}
+ _emit_mobileap_dbus_signal(obj, E_SIGNAL_SECURITY_TYPE_CHANGED,
+ security_type);
dbus_g_method_return(context);
return TRUE;
gboolean mobileap_get_wifi_tethering_passphrase(MobileAPObject *obj,
DBusGMethodInvocation *context)
{
- int ret = MOBILE_AP_ERROR_NONE;
+ mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
char passphrase[MOBILE_AP_WIFI_KEY_MAX_LEN + 1] = {0, };
unsigned int len = 0;
gchar *passphrase, guint len, DBusGMethodInvocation *context)
{
mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
+ char old_passphrase[MOBILE_AP_WIFI_KEY_MAX_LEN + 1] = {0, };
+ unsigned int old_len = 0;
DBG("+\n");
g_assert(obj != NULL);
g_assert(context != NULL);
+ ret = __get_passphrase(old_passphrase, sizeof(old_passphrase), &old_len);
+ if (ret != MOBILE_AP_ERROR_NONE) {
+ ERR("__get_passphrase is failed : %d\n", ret);
+ } else if (old_len == len && !g_strcmp0(old_passphrase, passphrase)) {
+ dbus_g_method_return(context);
+ return TRUE;
+ }
+
ret = __set_passphrase(passphrase, len);
if (ret != MOBILE_AP_ERROR_NONE) {
ERR("__set_passphrase is failed : %d\n", ret);
}
+ _emit_mobileap_dbus_signal(obj, E_SIGNAL_PASSPHRASE_CHANGED, NULL);
dbus_g_method_return(context);
return TRUE;