Indications for Wi-Fi tethering setting change are added
authorSeungyoun Ju <sy39.ju@samsung.com>
Thu, 24 Jan 2013 03:19:47 +0000 (12:19 +0900)
committerSeungyoun Ju <sy39.ju@samsung.com>
Thu, 24 Jan 2013 03:20:51 +0000 (12:20 +0900)
- Issues
  There is no way to know Wi-Fi tethering setting change by other applications.

- Fix description
  Added APIs are implemented

Change-Id: I479fb997f079e7d54da78d27957289dcde5a6de7

include/tethering.h
include/tethering.xml
include/tethering_private.h
src/tethering.c
test/tethering_test.c

index 8236c66d6d9f1acfb17800e741ba5e5ef14fcf9c..9c7aa1eefb43d9baa2e043b9338fba8ad6272341 100644 (file)
@@ -180,6 +180,32 @@ typedef bool(*tethering_connected_client_cb)(tethering_client_h client, void *us
  */
 typedef void (*tethering_data_usage_cb)(tethering_error_e result, unsigned long long received_data, unsigned long long sent_data, void *user_data);
 
+/**
+ * @brief  Called when the security type of Wi-Fi tethering is changed
+ * @param[in]  changed_type  The changed security type of Wi-Fi tethering
+ * @param[in]  user_data  The user data passed from the register function
+ * @see        tethering_wifi_set_security_type_changed_cb()
+ * @see        tethering_wifi_unset_security_type_changed_cb()
+ */
+typedef void (*tethering_wifi_security_type_changed_cb)(tethering_wifi_security_type_e changed_type, void *user_data);
+
+/**
+ * @brief  Called when the visibility of SSID is changed
+ * @param[in]  changed_visible  The changed visibility of SSID
+ * @param[in]  user_data  The user data passed from the register function
+ * @see        tethering_wifi_set_ssid_visibility_changed_cb()
+ * @see        tethering_wifi_unset_ssid_visibility_changed_cb()
+ */
+typedef void (*tethering_wifi_ssid_visibility_changed_cb)(bool changed_visible, void *user_data);
+
+/**
+ * @brief  Called when the passphrase of Wi-Fi tethering is changed
+ * @param[in]  user_data  The user data passed from the register function
+ * @see        tethering_wifi_set_passphrase_changed_cb()
+ * @see        tethering_wifi_unset_passphrase_changed_cb()
+ */
+typedef void (*tethering_wifi_passphrase_changed_cb)(void *user_data);
+
 /**
  * @brief  Creates the handle of tethering.
  * @remarks  The @a tethering must be released tethering_destroy() by you.
@@ -426,6 +452,67 @@ int tethering_set_connection_state_changed_cb(tethering_h tethering, tethering_t
  */
 int tethering_unset_connection_state_changed_cb(tethering_h tethering, tethering_type_e type);
 
+/**
+ * @brief Registers the callback function called when the security type of Wi-Fi tethering is changed.
+ * @param[in]  tethering  The handle of tethering
+ * @param[in]  callback  The callback function to invoke
+ * @param[in]  user_data  The user data to be passed to the callback function
+ * @retval  #TETHERING_ERROR_NONE  Successful
+ * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  tethering_wifi_unset_security_type_changed_cb()
+ */
+int tethering_wifi_set_security_type_changed_cb(tethering_h tethering, tethering_wifi_security_type_changed_cb callback, void *user_data);
+
+/**
+ * @brief Unregisters the callback function called when the security type of Wi-Fi tethering is changed.
+ * @param[in]  tethering  The handle of tethering
+ * @param[in]  type  The type of tethering
+ * @retval  #TETHERING_ERROR_NONE  Successful
+ * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  tethering_wifi_set_security_type_changed_cb()
+ */
+int tethering_wifi_unset_security_type_changed_cb(tethering_h tethering);
+
+/**
+ * @brief Registers the callback function called when the visibility of SSID is changed.
+ * @param[in]  tethering  The handle of tethering
+ * @param[in]  callback  The callback function to invoke
+ * @param[in]  user_data  The user data to be passed to the callback function
+ * @retval  #TETHERING_ERROR_NONE  Successful
+ * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  tethering_wifi_unset_ssid_visibility_changed_cb_cb()
+ */
+int tethering_wifi_set_ssid_visibility_changed_cb(tethering_h tethering, tethering_wifi_ssid_visibility_changed_cb callback, void *user_data);
+
+/**
+ * @brief Unregisters the callback function called when the visibility of SSID is changed.
+ * @param[in]  tethering  The handle of tethering
+ * @retval  #TETHERING_ERROR_NONE  Successful
+ * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  tethering_wifi_set_ssid_visibility_changed_cb()
+ */
+int tethering_wifi_unset_ssid_visibility_changed_cb(tethering_h tethering);
+
+/**
+ * @brief Registers the callback function called when the passphrase of Wi-Fi tethering is changed.
+ * @param[in]  tethering  The handle of tethering
+ * @param[in]  callback  The callback function to invoke
+ * @param[in]  user_data  The user data to be passed to the callback function
+ * @retval  #TETHERING_ERROR_NONE  Successful
+ * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  tethering_wifi_unset_passphrase_changed_cb()
+ */
+int tethering_wifi_set_passphrase_changed_cb(tethering_h tethering, tethering_wifi_passphrase_changed_cb callback, void *user_data);
+
+/**
+ * @brief Unregisters the callback function called when the passphrase of Wi-Fi tethering is changed.
+ * @param[in]  tethering  The handle of tethering
+ * @retval  #TETHERING_ERROR_NONE  Successful
+ * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  tethering_wifi_set_passphrase_changed_cb()
+ */
+int tethering_wifi_unset_passphrase_changed_cb(tethering_h tethering);
+
 /**
  * @}
  */
index dbba8e1daea8ad9c78f95ac2f500f1c86663e763..654b854008bd24357dbcb2d18444e131fbc13d8a 100644 (file)
                        <arg type="s" name="name" direction="out"/>
                </signal>
 
+               <signal name="security_type_changed">
+                       <arg type="s" name="arg1" direction="out"/>
+               </signal>
+
+               <signal name="ssid_visibility_changed">
+                       <arg type="s" name="arg1" direction="out"/>
+               </signal>
+
+               <signal name="passphrase_changed">
+                       <arg type="s" name="arg1" direction="out"/>
+               </signal>
+
        </interface>
 </node>
 
index 5e6837550bda61e05a4d83cdaebdfb40b66fbc63..722bbf710e323e5d2a13647ca17d0795b2f0fb36 100644 (file)
@@ -175,9 +175,14 @@ typedef enum {
 #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"
 
 /* Network Interface */
 #define TETHERING_SUBNET_MASK          "255.255.255.0"
@@ -218,6 +223,12 @@ typedef struct {
        void *changed_user_data[TETHERING_TYPE_MAX];
        tethering_data_usage_cb data_usage_cb;
        void *data_usage_user_data;
+       tethering_wifi_security_type_changed_cb security_type_changed_cb;
+       void *security_type_user_data;
+       tethering_wifi_ssid_visibility_changed_cb ssid_visibility_changed_cb;
+       void *ssid_visibility_user_data;
+       tethering_wifi_passphrase_changed_cb passphrase_changed_cb;
+       void *passphrase_user_data;
 } __tethering_h;
 
 typedef struct {
index bb6e89210dc3853183626a3fa8909b1b1a024059..3ca6c0b03d116c73af94fd18f401d4b65fa35645 100644 (file)
@@ -40,6 +40,9 @@ static void __handle_net_closed(DBusGProxy *proxy, const char *value_name, gpoin
 static void __handle_no_data_timeout(DBusGProxy *proxy, const char *value_name, gpointer user_data);
 static void __handle_low_battery_mode(DBusGProxy *proxy, const char *value_name, gpointer user_data);
 static void __handle_flight_mode(DBusGProxy *proxy, const char *value_name, gpointer user_data);
+static void __handle_security_type_changed(DBusGProxy *proxy, const char *value_name, gpointer user_data);
+static void __handle_ssid_visibility_changed(DBusGProxy *proxy, const char *value_name, gpointer user_data);
+static void __handle_passphrase_changed(DBusGProxy *proxy, const char *value_name, gpointer user_data);
 
 static __tethering_sig_t sigs[] = {
        {SIGNAL_NAME_NET_CLOSED, __handle_net_closed},
@@ -52,6 +55,9 @@ static __tethering_sig_t sigs[] = {
        {SIGNAL_NAME_NO_DATA_TIMEOUT, __handle_no_data_timeout},
        {SIGNAL_NAME_LOW_BATTERY_MODE, __handle_low_battery_mode},
        {SIGNAL_NAME_FLIGHT_MODE, __handle_flight_mode},
+       {SIGNAL_NAME_SECURITY_TYPE_CHANGED, __handle_security_type_changed},
+       {SIGNAL_NAME_SSID_VISIBILITY_CHANGED, __handle_ssid_visibility_changed},
+       {SIGNAL_NAME_PASSPHRASE_CHANGED, __handle_passphrase_changed},
        {"", NULL}};
 
 static bool __any_tethering_is_enabled(tethering_h tethering)
@@ -401,6 +407,81 @@ static void __handle_flight_mode(DBusGProxy *proxy, const char *value_name, gpoi
        }
 }
 
+static void __handle_security_type_changed(DBusGProxy *proxy, const char *value_name, gpointer user_data)
+{
+       DBG("+\n");
+
+       _retm_if(user_data == NULL, "parameter(user_data) is NULL\n");
+
+       __tethering_h *th = (__tethering_h *)user_data;
+       tethering_wifi_security_type_changed_cb scb = NULL;
+       void *data = NULL;
+       tethering_wifi_security_type_e security_type;
+
+       scb = th->security_type_changed_cb;
+       if (scb == NULL)
+               return;
+
+       data = th->security_type_user_data;
+       if (g_strcmp0(value_name, TETHERING_WIFI_SECURITY_TYPE_OPEN_STR) == 0)
+               security_type = TETHERING_WIFI_SECURITY_TYPE_NONE;
+       else if (g_strcmp0(value_name, TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK_STR) == 0)
+               security_type = TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK;
+       else {
+               ERR("Unknown security type : %s\n", value_name);
+               return;
+       }
+
+       scb(security_type, data);
+
+       return;
+}
+
+static void __handle_ssid_visibility_changed(DBusGProxy *proxy, const char *value_name, gpointer user_data)
+{
+       DBG("+\n");
+
+       _retm_if(user_data == NULL, "parameter(user_data) is NULL\n");
+
+       __tethering_h *th = (__tethering_h *)user_data;
+       tethering_wifi_ssid_visibility_changed_cb scb = NULL;
+       void *data = NULL;
+       bool visible = false;
+
+       scb = th->ssid_visibility_changed_cb;
+       if (scb == NULL)
+               return;
+
+       data = th->ssid_visibility_user_data;
+       if (g_strcmp0(value_name, SIGNAL_MSG_SSID_VISIBLE) == 0)
+               visible = true;
+
+       scb(visible, data);
+
+       return;
+}
+
+static void __handle_passphrase_changed(DBusGProxy *proxy, const char *value_name, gpointer user_data)
+{
+       DBG("+\n");
+
+       _retm_if(user_data == NULL, "parameter(user_data) is NULL\n");
+
+       __tethering_h *th = (__tethering_h *)user_data;
+       tethering_wifi_passphrase_changed_cb pcb = NULL;
+       void *data = NULL;
+
+       pcb = th->passphrase_changed_cb;
+       if (pcb == NULL)
+               return;
+
+       data = th->passphrase_user_data;
+
+       pcb(data);
+
+       return;
+}
+
 static void __cfm_cb(DBusGProxy *remoteobj, guint event, guint info,
                GError *g_error, gpointer user_data)
 {
@@ -676,11 +757,19 @@ static void __wifi_set_security_type_cb(DBusGProxy *remoteobj,
 {
        _retm_if(user_data == NULL, "parameter(user_data) is NULL\n");
 
+       tethering_h tethering = (tethering_h)user_data;
+       __tethering_h *th = (__tethering_h *)tethering;
+       DBusGProxy *proxy = th->client_bus_proxy;
+
        if (error) {
                ERR("DBus fail [%s]\n", error->message);
                g_error_free(error);
        }
 
+       dbus_g_proxy_connect_signal(proxy, SIGNAL_NAME_SECURITY_TYPE_CHANGED,
+                       G_CALLBACK(__handle_security_type_changed),
+                       (gpointer)tethering, NULL);
+
        return;
 }
 
@@ -689,11 +778,19 @@ static void __wifi_set_ssid_visibility_cb(DBusGProxy *remoteobj,
 {
        _retm_if(user_data == NULL, "parameter(user_data) is NULL\n");
 
+       tethering_h tethering = (tethering_h)user_data;
+       __tethering_h *th = (__tethering_h *)tethering;
+       DBusGProxy *proxy = th->client_bus_proxy;
+
        if (error) {
                ERR("DBus fail [%s]\n", error->message);
                g_error_free(error);
        }
 
+       dbus_g_proxy_connect_signal(proxy, SIGNAL_NAME_SSID_VISIBILITY_CHANGED,
+                       G_CALLBACK(__handle_ssid_visibility_changed),
+                       (gpointer)tethering, NULL);
+
        return;
 }
 
@@ -702,11 +799,19 @@ static void __wifi_set_passphrase_cb(DBusGProxy *remoteobj,
 {
        _retm_if(user_data == NULL, "parameter(user_data) is NULL\n");
 
+       tethering_h tethering = (tethering_h)user_data;
+       __tethering_h *th = (__tethering_h *)tethering;
+       DBusGProxy *proxy = th->client_bus_proxy;
+
        if (error) {
                ERR("DBus fail [%s]\n", error->message);
                g_error_free(error);
        }
 
+       dbus_g_proxy_connect_signal(proxy, SIGNAL_NAME_PASSPHRASE_CHANGED,
+                       G_CALLBACK(__handle_passphrase_changed),
+                       (gpointer)tethering, NULL);
+
        return;
 }
 
@@ -1518,6 +1623,140 @@ API int tethering_unset_connection_state_changed_cb(tethering_h tethering, tethe
        return TETHERING_ERROR_NONE;
 }
 
+/**
+ * @brief Registers the callback function called when the security type of Wi-Fi tethering is changed.
+ * @param[in]  tethering  The handle of tethering
+ * @param[in]  callback  The callback function to invoke
+ * @param[in]  user_data  The user data to be passed to the callback function
+ * @retval  #TETHERING_ERROR_NONE  Successful
+ * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  tethering_wifi_unset_security_type_changed_cb()
+ */
+API int tethering_wifi_set_security_type_changed_cb(tethering_h tethering, tethering_wifi_security_type_changed_cb callback, void *user_data)
+{
+       _retvm_if(tethering == NULL, TETHERING_ERROR_INVALID_PARAMETER,
+                       "parameter(tethering) is NULL\n");
+       _retvm_if(callback == NULL, TETHERING_ERROR_INVALID_PARAMETER,
+                       "parameter(callback) is NULL\n");
+
+       __tethering_h *th = (__tethering_h *)tethering;
+
+       th->security_type_changed_cb = callback;
+       th->security_type_user_data = user_data;
+
+       return TETHERING_ERROR_NONE;
+
+}
+
+/**
+ * @brief Unregisters the callback function called when the security type of Wi-Fi tethering is changed.
+ * @param[in]  tethering  The handle of tethering
+ * @param[in]  type  The type of tethering
+ * @retval  #TETHERING_ERROR_NONE  Successful
+ * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  tethering_wifi_set_security_type_changed_cb()
+ */
+API int tethering_wifi_unset_security_type_changed_cb(tethering_h tethering)
+{
+       _retvm_if(tethering == NULL, TETHERING_ERROR_INVALID_PARAMETER,
+                       "parameter(tethering) is NULL\n");
+
+       __tethering_h *th = (__tethering_h *)tethering;
+
+       th->security_type_changed_cb = NULL;
+       th->security_type_user_data = NULL;
+
+       return TETHERING_ERROR_NONE;
+}
+
+/**
+ * @brief Registers the callback function called when the visibility of SSID is changed.
+ * @param[in]  tethering  The handle of tethering
+ * @param[in]  callback  The callback function to invoke
+ * @param[in]  user_data  The user data to be passed to the callback function
+ * @retval  #TETHERING_ERROR_NONE  Successful
+ * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  tethering_wifi_unset_ssid_visibility_changed_cb_cb()
+ */
+API int tethering_wifi_set_ssid_visibility_changed_cb(tethering_h tethering, tethering_wifi_ssid_visibility_changed_cb callback, void *user_data)
+{
+       _retvm_if(tethering == NULL, TETHERING_ERROR_INVALID_PARAMETER,
+                       "parameter(tethering) is NULL\n");
+       _retvm_if(callback == NULL, TETHERING_ERROR_INVALID_PARAMETER,
+                       "parameter(callback) is NULL\n");
+
+       __tethering_h *th = (__tethering_h *)tethering;
+
+       th->ssid_visibility_changed_cb = callback;
+       th->ssid_visibility_user_data = user_data;
+
+       return TETHERING_ERROR_NONE;
+}
+
+/**
+ * @brief Unregisters the callback function called when the visibility of SSID is changed.
+ * @param[in]  tethering  The handle of tethering
+ * @retval  #TETHERING_ERROR_NONE  Successful
+ * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  tethering_wifi_set_ssid_visibility_changed_cb()
+ */
+API int tethering_wifi_unset_ssid_visibility_changed_cb(tethering_h tethering)
+{
+       _retvm_if(tethering == NULL, TETHERING_ERROR_INVALID_PARAMETER,
+                       "parameter(tethering) is NULL\n");
+
+       __tethering_h *th = (__tethering_h *)tethering;
+
+       th->ssid_visibility_changed_cb = NULL;
+       th->ssid_visibility_user_data = NULL;
+
+       return TETHERING_ERROR_NONE;
+}
+
+/**
+ * @brief Registers the callback function called when the passphrase of Wi-Fi tethering is changed.
+ * @param[in]  tethering  The handle of tethering
+ * @param[in]  callback  The callback function to invoke
+ * @param[in]  user_data  The user data to be passed to the callback function
+ * @retval  #TETHERING_ERROR_NONE  Successful
+ * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  tethering_wifi_unset_passphrase_changed_cb()
+ */
+API int tethering_wifi_set_passphrase_changed_cb(tethering_h tethering, tethering_wifi_passphrase_changed_cb callback, void *user_data)
+{
+       _retvm_if(tethering == NULL, TETHERING_ERROR_INVALID_PARAMETER,
+                       "parameter(tethering) is NULL\n");
+       _retvm_if(callback == NULL, TETHERING_ERROR_INVALID_PARAMETER,
+                       "parameter(callback) is NULL\n");
+
+       __tethering_h *th = (__tethering_h *)tethering;
+
+       th->passphrase_changed_cb = callback;
+       th->passphrase_user_data = user_data;
+
+       return TETHERING_ERROR_NONE;
+}
+
+/**
+ * @brief Unregisters the callback function called when the passphrase of Wi-Fi tethering is changed.
+ * @param[in]  tethering  The handle of tethering
+ * @retval  #TETHERING_ERROR_NONE  Successful
+ * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  tethering_wifi_set_passphrase_changed_cb()
+ */
+API int tethering_wifi_unset_passphrase_changed_cb(tethering_h tethering)
+{
+       _retvm_if(tethering == NULL, TETHERING_ERROR_INVALID_PARAMETER,
+                       "parameter(tethering) is NULL\n");
+
+       __tethering_h *th = (__tethering_h *)tethering;
+
+       th->passphrase_changed_cb = NULL;
+       th->passphrase_user_data = NULL;
+
+       return TETHERING_ERROR_NONE;
+}
+
 /**
  * @brief Sets the security type of Wi-Fi tethering.
  * @remarks You must set this value when Wi-Fi tethering is disabled.
@@ -1551,6 +1790,10 @@ API int tethering_wifi_set_security_type(tethering_h tethering, tethering_wifi_s
                return TETHERING_ERROR_INVALID_PARAMETER;
        }
 
+       dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_SECURITY_TYPE_CHANGED,
+                       G_CALLBACK(__handle_security_type_changed),
+                       (gpointer)tethering);
+
        com_samsung_mobileap_set_wifi_tethering_security_type_async(proxy, type_str,
                        __wifi_set_security_type_cb, (gpointer)tethering);
 
@@ -1684,6 +1927,10 @@ int tethering_wifi_set_ssid_visibility(tethering_h tethering, bool visible)
        else
                hide_mode = VCONFKEY_MOBILE_AP_HIDE_ON;
 
+       dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_SSID_VISIBILITY_CHANGED,
+                       G_CALLBACK(__handle_ssid_visibility_changed),
+                       (gpointer)tethering);
+
        com_samsung_mobileap_set_wifi_tethering_hide_mode_async(proxy, hide_mode,
                        __wifi_set_ssid_visibility_cb, (gpointer)tethering);
 
@@ -1757,6 +2004,9 @@ API int tethering_wifi_set_passphrase(tethering_h tethering, const char *passphr
        __tethering_h *th = (__tethering_h *)tethering;
        DBusGProxy *proxy = th->client_bus_proxy;
 
+       dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_PASSPHRASE_CHANGED,
+                       G_CALLBACK(__handle_passphrase_changed),
+                       (gpointer)tethering);
 
        com_samsung_mobileap_set_wifi_tethering_passphrase_async(proxy,
                        passphrase, strlen(passphrase),
index a0f8ffcfc9d9a8d6b6fd6097161f11aa0d3d09f4..a79651d0bc412e15823b8badfb508748a7c1ef7f 100644 (file)
@@ -36,6 +36,9 @@ typedef struct {
        tethering_enabled_cb enabled_cb;
        tethering_disabled_cb disabled_cb;
        tethering_connection_state_changed_cb changed_cb;
+       tethering_wifi_security_type_changed_cb security_type_changed_cb;
+       tethering_wifi_ssid_visibility_changed_cb ssid_visibility_changed_cb;
+       tethering_wifi_passphrase_changed_cb passphrase_changed_cb;
 } __tethering_cbs;
 
 static GMainLoop *mainloop = NULL;
@@ -178,6 +181,24 @@ static void __register_cbs(tethering_h th, __tethering_cbs *cbs, void *user_data
                g_print("tethering_set_connection_state_changed_cb is failed\n");
        }
 
+       ret = tethering_wifi_set_security_type_changed_cb(th,
+                       cbs->security_type_changed_cb, user_data);
+       if (__is_err(ret) == true) {
+               g_print("tethering_wifi_set_security_type_changed_cb is failed\n");
+       }
+
+       ret = tethering_wifi_set_ssid_visibility_changed_cb(th,
+                       cbs->ssid_visibility_changed_cb, user_data);
+       if (__is_err(ret) == true) {
+               g_print("tethering_wifi_set_ssid_visibility_changed_cb is failed\n");
+       }
+
+       ret = tethering_wifi_set_passphrase_changed_cb(th,
+                       cbs->passphrase_changed_cb, user_data);
+       if (__is_err(ret) == true) {
+               g_print("tethering_wifi_set_passphrase_changed_cb is failed\n");
+       }
+
        return;
 }
 
@@ -200,6 +221,21 @@ static void __deregister_cbs(tethering_h th)
                g_print("tethering_unset_connection_state_changed_cb is failed\n");
        }
 
+       ret = tethering_wifi_unset_security_type_changed_cb(th);
+       if (__is_err(ret) == true) {
+               g_print("tethering_wifi_unset_security_type_changed_cb is failed\n");
+       }
+
+       ret = tethering_wifi_unset_ssid_visibility_changed_cb(th);
+       if (__is_err(ret) == true) {
+               g_print("tethering_wifi_unset_ssid_visibility_changed_cb is failed\n");
+       }
+
+       ret = tethering_wifi_unset_passphrase_changed_cb(th);
+       if (__is_err(ret) == true) {
+               g_print("tethering_wifi_unset_passphrase_changed_cb is failed\n");
+       }
+
        return;
 }
 
@@ -355,6 +391,27 @@ static bool __clients_foreach_cb(tethering_client_h client, void *data)
        /* Continue iteration */
        return true;
 }
+
+static void __security_type_changed_cb(tethering_wifi_security_type_e changed_type, void *user_data)
+{
+       g_print("Wi-Fi Tethering Security type is changed to [%s]\n",
+                       changed_type == TETHERING_WIFI_SECURITY_TYPE_NONE ?
+                       "open" : "wpa2-psk");
+       return;
+}
+
+static void __ssid_visibility_changed_cb(bool changed_visible, void *user_data)
+{
+       g_print("SSID visibility for Wi-Fi tethering changed to [%s]\n",
+                       changed_visible ? "visible" : "invisible");
+       return;
+}
+
+static void __passphrase_changed_cb(void *user_data)
+{
+       g_print("Wi-Fi Tethering passphrase is changed\n");
+       return;
+}
 /* End of tethering callbacks */
 
 static void __enable_tethering(tethering_h th, tethering_type_e type)
@@ -609,7 +666,10 @@ int main(int argc, char *argv[])
        tethering_h th = NULL;
        GIOChannel *stdin_channel = NULL;
        tethering_error_e ret = TETHERING_ERROR_NONE;
-       __tethering_cbs cbs = {__enabled_cb, __disabled_cb, __connection_state_changed_cb};
+       __tethering_cbs cbs = {
+               __enabled_cb, __disabled_cb,
+               __connection_state_changed_cb, __security_type_changed_cb,
+               __ssid_visibility_changed_cb, __passphrase_changed_cb};
 
        g_type_init();