int ignore_broadcast_ssid;
#if defined TIZEN_EXT
unsigned char *bssid;
+ unsigned int bssid_for_connect_len;
+ unsigned char bssid_for_connect[6];
#endif
};
dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH,
&interface->network_path);
#if defined TIZEN_EXT
- dbus_message_iter_append_basic(iter, DBUS_TYPE_INT32, &ssid->freq);
+ if (!ssid->bssid_for_connect_len)
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_INT32, &ssid->freq);
#endif
}
#if defined TIZEN_EXT
SUPPLICANT_DBG(".Interface.SelectNetworkFreq");
-#endif
+ GSupplicantSSID *ssid = data->ssid;
-#if defined TIZEN_EXT
- supplicant_dbus_method_call(data->interface->path,
- SUPPLICANT_INTERFACE ".Interface", "SelectNetworkFreq",
- interface_select_network_params,
- interface_select_network_result, data,
- interface);
+ if (!ssid->bssid_for_connect_len)
+ supplicant_dbus_method_call(data->interface->path,
+ SUPPLICANT_INTERFACE ".Interface", "SelectNetworkFreq",
+ interface_select_network_params,
+ interface_select_network_result, data,
+ interface);
+ else
+ supplicant_dbus_method_call(data->interface->path,
+ SUPPLICANT_INTERFACE ".Interface", "SelectNetwork",
+ interface_select_network_params,
+ interface_select_network_result, data,
+ interface);
#else
supplicant_dbus_method_call(data->interface->path,
SUPPLICANT_INTERFACE ".Interface", "SelectNetwork",
supplicant_dbus_dict_close(iter, &dict);
return;
}
- snprintf(bssid, 18, "%02x:%02x:%02x:%02x:%02x:%02x",
+
+ if (ssid->bssid_for_connect_len)
+ snprintf(bssid, 18, "%02x:%02x:%02x:%02x:%02x:%02x",
+ ssid->bssid_for_connect[0], ssid->bssid_for_connect[1], ssid->bssid_for_connect[2],
+ ssid->bssid_for_connect[3], ssid->bssid_for_connect[4], ssid->bssid_for_connect[5]);
+ else
+ snprintf(bssid, 18, "%02x:%02x:%02x:%02x:%02x:%02x",
ssid->bssid[0], ssid->bssid[1], ssid->bssid[2],
ssid->bssid[3], ssid->bssid[4], ssid->bssid[5]);
+
supplicant_dbus_dict_append_basic(&dict, "bssid",
DBUS_TYPE_STRING, &bssid);
g_free(bssid);
DBG("network %p result %d", network, result);
#if defined TIZEN_EXT
+ set_connman_bssid(RESET_BSSID, NULL);
+
for (list = iface_list; list; list = list->next) {
wifi = list->data;
ssid->bssid = connman_network_get_bssid(network);
#endif
#if defined TIZEN_EXT
- ssid->freq = connman_network_get_frequency(network);
+ if (set_connman_bssid(CHECK_BSSID, NULL) == 6) {
+ ssid->bssid_for_connect_len = 6;
+ set_connman_bssid(GET_BSSID, (char *)ssid->bssid_for_connect);
+ DBG("BSSID : %02x:%02x:%02x:%02x:%02x:%02x",
+ ssid->bssid_for_connect[0], ssid->bssid_for_connect[1],
+ ssid->bssid_for_connect[2], ssid->bssid_for_connect[3],
+ ssid->bssid_for_connect[4], ssid->bssid_for_connect[5]);
+ } else {
+ ssid->freq = connman_network_get_frequency(network);
+ }
#endif
if (connman_setting_get_bool("BackgroundScanning"))
return true;
}
- ret = send_encryption_request(passphrase, passphrase);
+ ret = send_encryption_request(passphrase, network);
g_free(passphrase);
void __connman_technology_notify_regdom_by_device(struct connman_device *device,
int result, const char *alpha2);
+#if defined TIZEN_EXT
+enum bssid_type {
+ CHECK_BSSID = 0,
+ GET_BSSID = 1,
+ SET_BSSID = 2,
+ RESET_BSSID = 3,
+};
+
+int set_connman_bssid(enum bssid_type mode, char *bssid);
+#endif
+
#include <connman/device.h>
int __connman_device_init(const char *device, const char *nodevice);
#include <errno.h>
#include <string.h>
+#if defined TIZEN_EXT
+#include <stdio.h>
+#endif
#include <gdbus.h>
return reply;
}
+#if defined TIZEN_EXT
+int set_connman_bssid(enum bssid_type mode, char *bssid)
+{
+ static unsigned char bssid_for_connect[6];
+ static int bssid_len;
+
+ DBG("mode : %d", mode);
+
+ if (mode == CHECK_BSSID) {
+ return bssid_len;
+ }
+
+ if (mode == GET_BSSID && bssid) {
+ memcpy(bssid, bssid_for_connect, 6);
+ return bssid_len;
+ }
+
+ if (mode == RESET_BSSID) {
+ bssid_len = 0;
+ return bssid_len;
+ }
+
+ if (mode != SET_BSSID || !bssid) {
+ DBG("Invalid parameter");
+ return 0;
+ }
+
+ bssid_len = sscanf(bssid, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx",
+ &bssid_for_connect[0], &bssid_for_connect[1], &bssid_for_connect[2],
+ &bssid_for_connect[3], &bssid_for_connect[4], &bssid_for_connect[5]);
+ if (bssid_len != 6) {
+ DBG("Incorrect BSSID format. bssid_len = %d", bssid_len);
+ bssid_len = 0;
+ }
+
+ DBG("SET BSSID len : %d, BSSID : %02x:%02x:%02x:%02x:%02x:%02x", bssid_len,
+ bssid_for_connect[0], bssid_for_connect[1], bssid_for_connect[2],
+ bssid_for_connect[3], bssid_for_connect[4], bssid_for_connect[5]);
+
+ return bssid_len;
+}
+#endif
+
static DBusMessage *set_property(DBusConnection *conn,
DBusMessage *msg, void *data)
{
dbus_message_iter_get_basic(&value, &enable);
return set_powered(technology, msg, enable);
+#if defined TIZEN_EXT
+ } else if (g_str_equal(name, "SetBSSID")) {
+ char *key;
+
+ if (type != DBUS_TYPE_STRING)
+ return __connman_error_invalid_arguments(msg);
+
+ dbus_message_iter_get_basic(&value, &key);
+ DBG("BSSID %s", key);
+ set_connman_bssid(SET_BSSID, key);
+#endif
} else
return __connman_error_invalid_property(msg);