time_t last_user_selection_time;
char *last_user_selection_ident;
char *last_connected_ident;
- DBusMessage *pending_reply;
+ GList *pending_reply_list; /* List of DBusMessage* for async reply to multiple
+ * device power dbus calls, which are made before
+ * connman_device_set_powered().
+ */
int max_scan_ssids;
bool is_5_0_ghz_supported;
unsigned int mac_policy;
#endif
};
+#if defined TIZEN_EXT
+static void __clear_pending_trigger(gpointer data, gpointer user_data)
+{
+ DBusMessage *msg = (DBusMessage *)data;
+ dbus_message_unref(msg);
+}
+#endif
+
static void clear_pending_trigger(struct connman_device *device)
{
#if defined TIZEN_EXT
- if (device->pending_reply) {
- dbus_message_unref(device->pending_reply);
- device->pending_reply = NULL;
+ if (device->pending_reply_list) {
+ g_list_foreach(device->pending_reply_list, __clear_pending_trigger, NULL);
+ g_list_free(device->pending_reply_list);
+ device->pending_reply_list = NULL;
}
#endif
if (device->pending_timeout > 0) {
return service_type == device_service_type;
}
+#if defined TIZEN_EXT
+static void __device_pending_reset(gpointer data, gpointer user_data)
+{
+ DBusMessage *msg = (DBusMessage *)data;
+ DBusMessage *reply;
+
+ reply = __connman_error_failed(msg, ETIMEDOUT);
+ if (reply)
+ g_dbus_send_message(connection, reply);
+
+ dbus_message_unref(msg);
+}
+#endif
+
static gboolean device_pending_reset(gpointer user_data)
{
struct connman_device *device = user_data;
DBusMessage *reply;
/* Power request timed out, send ETIMEDOUT. */
- if (device->pending_reply) {
- reply = __connman_error_failed(device->pending_reply, ETIMEDOUT);
- if (reply)
- g_dbus_send_message(connection, reply);
-
- dbus_message_unref(device->pending_reply);
- device->pending_reply = NULL;
+ if (device->pending_reply_list) {
+ g_list_foreach(device->pending_reply_list, __device_pending_reset, NULL);
+ g_list_free(device->pending_reply_list);
+ device->pending_reply_list = NULL;
}
#endif
/* Power request timedout, reset power pending state. */
dbus_message_unref(signal);
}
+static void __device_send_reply(gpointer data, gpointer user_data)
+{
+ DBusMessage *msg = (DBusMessage *)data;
+ g_dbus_send_reply(connection, msg, DBUS_TYPE_INVALID);
+ dbus_message_unref(msg);
+}
+
static void device_send_reply(struct connman_device *device)
{
- if (device->pending_reply) {
- g_dbus_send_reply(connection,
- device->pending_reply, DBUS_TYPE_INVALID);
- dbus_message_unref(device->pending_reply);
- device->pending_reply = NULL;
+ if (device->pending_reply_list) {
+ g_list_foreach(device->pending_reply_list, __device_send_reply, NULL);
+ g_list_free(device->pending_reply_list);
+ device->pending_reply_list = NULL;
}
}
#endif
const char *ident)
{
#ifdef TIZEN_EXT
- if (device->ident)
+ if (device->ident && device->powered)
return;
else
#endif
if (g_str_equal(key, "Address")) {
#ifdef TIZEN_EXT
- if (device->address)
+ if (device->address && device->powered)
return 0;
else
#endif
void connman_device_set_pending_reply(struct connman_device *device,
DBusMessage *msg)
{
- device->pending_reply = dbus_message_ref(msg);
+ device->pending_reply_list = g_list_prepend(device->pending_reply_list, dbus_message_ref(msg));
}
void connman_device_send_connected_signal(struct connman_device *device,
case CONNMAN_DEVICE_TYPE_ETHERNET:
case CONNMAN_DEVICE_TYPE_GADGET:
case CONNMAN_DEVICE_TYPE_WIFI:
-#if defined TIZEN_EXT
- if (type == CONNMAN_DEVICE_TYPE_WIFI)
- name = _get_wifi_ident();
- if (!name)
-#endif
name = index2ident(index, "");
-#if defined TIZEN_EXT
- if (type == CONNMAN_DEVICE_TYPE_WIFI)
- addr = _get_wifi_addr();
- if (!addr)
-#endif
addr = index2addr(index);
break;
case CONNMAN_DEVICE_TYPE_BLUETOOTH:
ident = index2ident(index, NULL);
break;
case CONNMAN_DEVICE_TYPE_WIFI:
-#if defined TIZEN_EXT
- ident = _get_wifi_ident();
- if (!ident)
-#endif
ident = index2ident(index, NULL);
break;
case CONNMAN_DEVICE_TYPE_BLUETOOTH: