extern int connman_service_set_favorite(struct connman_service *service,
connman_bool_t favorite);
-extern struct connman_service *connman_service_lookup(const char *identifier);
-extern struct connman_service *connman_service_get(const char *identifier);
-extern void connman_service_put(struct connman_service *service);
-
#ifdef __cplusplus
}
#endif
if (iter == NULL)
return -ENOENT;
- if (service->favorite)
+ if (service->favorite == favorite)
return -EALREADY;
service->favorite = favorite;
static int service_register(struct connman_service *service)
{
const char *path = __connman_profile_active_path();
+ GSequenceIter *iter;
DBG("service %p", service);
service_methods, service_signals,
NULL, service, NULL);
+ __connman_storage_load_service(service);
+
+ iter = g_hash_table_lookup(service_hash, service->identifier);
+ if (iter != NULL)
+ g_sequence_sort_changed(iter, service_compare, NULL);
+
__connman_profile_changed();
return 0;
def property_changed(name, value, path, interface):
iface = interface[interface.rfind(".") + 1:]
ipath = path[path.rfind("/") + 1:]
- if iface not in ["Manager", "Service"]:
+ if iface not in ["Service"]:
return
if name in ["Profiles", "Services",
"Devices", "Networks", "Connections"]:
service = dbus.Interface(bus.get_object("org.moblin.connman", path),
"org.moblin.connman.Service")
- service.Connect()
+ service.Connect(timeout=60000)
elif sys.argv[1] in ["disconnect", "disc"]:
if (len(sys.argv) < 3):