diff options
Diffstat (limited to 'src/technology.c')
-rw-r--r-- | src/technology.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/technology.c b/src/technology.c index d2f0ae2b..4e053fc9 100644 --- a/src/technology.c +++ b/src/technology.c @@ -100,7 +100,7 @@ static void rfkill_check(gpointer key, gpointer value, gpointer user_data) struct connman_rfkill *rfkill = value; enum connman_service_type type = GPOINTER_TO_INT(user_data); - /* Calling _technology_rfkill_add will update the tech. */ + /* Calling _technology_add_rfkill will update the tech. */ if (rfkill->type == type) __connman_technology_add_rfkill(rfkill->index, type, rfkill->softblock, rfkill->hardblock); @@ -196,8 +196,6 @@ done: __connman_storage_save_global(keyfile); g_key_file_free(keyfile); - - return; } static void tethering_changed(struct connman_technology *technology) @@ -347,6 +345,15 @@ static struct connman_technology *technology_find(enum connman_service_type type return NULL; } +enum connman_service_type connman_technology_get_type + (struct connman_technology *technology) +{ + if (!technology) + return CONNMAN_SERVICE_TYPE_UNKNOWN; + + return technology->type; +} + bool connman_technology_get_wifi_tethering(const char **ssid, const char **psk) { @@ -435,8 +442,6 @@ done: g_free(identifier); g_key_file_free(keyfile); - - return; } bool __connman_technology_get_offlinemode(void) @@ -474,8 +479,6 @@ static void connman_technology_save_offlinemode(void) } g_key_file_free(keyfile); - - return; } static bool connman_technology_load_offlinemode(void) @@ -620,7 +623,7 @@ static gboolean technology_pending_reply(gpointer user_data) struct connman_technology *technology = user_data; DBusMessage *reply; - /* Power request timedout, send ETIMEDOUT. */ + /* Power request timed out, send ETIMEDOUT. */ if (technology->pending_reply) { reply = __connman_error_failed(technology->pending_reply, ETIMEDOUT); if (reply) @@ -787,6 +790,8 @@ static int technology_disable(struct connman_technology *technology) if (technology->type == CONNMAN_SERVICE_TYPE_P2P) { technology->enable_persistent = false; + __connman_device_stop_scan(CONNMAN_SERVICE_TYPE_P2P); + __connman_peer_disconnect_all(); return technology_disabled(technology); } else if (technology->type == CONNMAN_SERVICE_TYPE_WIFI) { struct connman_technology *p2p; @@ -1022,10 +1027,7 @@ void __connman_technology_scan_stopped(struct connman_device *device, if (device == other_device) continue; - if (__connman_device_get_service_type(other_device) != type) - continue; - - if (connman_device_get_scanning(other_device)) + if (connman_device_get_scanning(other_device, type)) count += 1; } @@ -1085,7 +1087,7 @@ static DBusMessage *scan(DBusConnection *conn, DBusMessage *msg, void *data) technology->scan_pending = g_slist_prepend(technology->scan_pending, msg); - err = __connman_device_request_scan(technology->type); + err = __connman_device_request_scan_full(technology->type); if (err < 0) reply_scan_pending(technology, err); @@ -1476,7 +1478,7 @@ int __connman_technology_add_device(struct connman_device *device) int err = __connman_device_enable(device); /* * connman_technology_add_device() calls __connman_device_enable() - * but since the device is already enabled, the calls does not + * but since the device is already enabled, the call does not * propagate through to connman_technology_enabled via * connman_device_set_powered. */ @@ -1580,7 +1582,7 @@ int __connman_technology_set_offlinemode(bool offlinemode) * resuming offlinemode from last saved profile. We need that * information in rfkill_update, otherwise it falls back on the * technology's persistent state. Hence we set the offline mode here - * but save it & call the notifier only if its successful. + * but save it & call the notifier only if it is successful. */ global_offlinemode = offlinemode; |