static int retry = 0;
-#if 0
-static void __send_dbus_signal(GDBusConnection *conn, const char *signal_name, const char *arg)
-{
- if (conn == NULL || signal_name == NULL)
- return;
-
- GVariant *message = NULL;
- GError *error = NULL;
-
- if (arg)
- message = g_variant_new("(s)", arg);
-
- g_dbus_connection_emit_signal(conn, NULL, SOFTAP_SERVICE_OBJECT_PATH,
- SOFTAP_SERVICE_INTERFACE, signal_name, message, &error);
- if (error) {
-//LCOV_EXCL_START
- ERR("g_dbus_connection_emit_signal is failed because %s\n", error->message);
- g_error_free(error);
-//LCOV_EXCL_END
- }
-}
-#endif
-
static int __get_common_ssid(char *ssid, unsigned int size)
{
if (ssid == NULL) {
softap_security_type_changed_cb scb = NULL;
void *data = NULL;
- softap_security_type_e security_type;
- char *buf = NULL;
+ int security_type;
scb = sa->security_type_changed_cb;
if (scb == NULL)
return;
- g_variant_get(parameters, "(s)", &buf);
+ g_variant_get(parameters, "(i)", &security_type);
data = sa->security_type_user_data;
- if (g_strcmp0(buf, SOFTAP_SECURITY_TYPE_OPEN_STR) == 0)
- security_type = SOFTAP_SECURITY_TYPE_NONE;
- else if (g_strcmp0(buf, SOFTAP_SECURITY_TYPE_WPA2_PSK_STR) == 0)
- security_type = SOFTAP_SECURITY_TYPE_WPA2_PSK;
- else if (g_strcmp0(buf, SOFTAP_SECURITY_TYPE_WPS_STR) == 0)
- security_type = SOFTAP_SECURITY_TYPE_WPS;
- else {
- SERR("Unknown type : %s", buf);
- g_free(buf);
- return;
- }
- g_free(buf);
- scb(security_type, data);
+ scb((softap_security_type_e)security_type, data);
return;
}
softap_ssid_visibility_changed_cb scb = NULL;
void *data = NULL;
- bool visible = false;
- char *buf = NULL;
+ int visible = 0;
scb = sa->ssid_visibility_changed_cb;
if (scb == NULL) {
DBG("-");
return;
}
- g_variant_get(parameters, "(s)", &buf);
+ g_variant_get(parameters, "(i)", &visible);
data = sa->ssid_visibility_user_data;
- if (g_strcmp0(buf, SIGNAL_MSG_SSID_VISIBLE) == 0)
- visible = true;
-
scb(visible, data);
- g_free(buf);
DBG("-");
}
static void __ssid_visibility_changed_cb(bool changed_visible, void *user_data)
{
- g_print("SSID visibility forSoftap changed to [%s]\n",
+ g_print("SSID visibility is changed to [%s]\n",
changed_visible ? "visible" : "invisible");
return;
}
+static void __passphrase_changed_cb(void *user_data)
+{
+
+ g_print("Passphrase is changed\n");
+}
+
static bool __clients_foreach_cb(softap_client_h client, void *data)
{
softap_client_h clone = NULL;
if (ret != SOFTAP_ERROR_NONE)
printf("Fail to set visibility changed callback!!\n");
+ ret = softap_set_passphrase_changed_cb(sa, __passphrase_changed_cb, NULL);
+ if (ret != SOFTAP_ERROR_NONE)
+ printf("Fail to set passphrase changed callback!!\n");
+
ret = softap_set_client_connection_state_changed_cb(sa, __connection_state_changed_cb, NULL);
if (ret != SOFTAP_ERROR_NONE)
printf("Fail to set client connection state changed callback!!\n");