int __connman_profile_add_device(struct connman_device *device);
int __connman_profile_remove_device(struct connman_device *device);
-int __connman_profile_set_carrier(struct connman_device *device,
- connman_bool_t carrier);
#include <connman/network.h>
int __connman_service_set_carrier(struct connman_service *service,
connman_bool_t carrier);
+int __connman_service_indicate_configuration(struct connman_service *service);
#include <connman/notifier.h>
static int set_carrier(struct connman_device *device, connman_bool_t carrier)
{
- __connman_profile_set_carrier(device, carrier);
+ struct connman_service *service;
+
+ service = __connman_service_lookup_from_device(device);
+ __connman_service_set_carrier(service, carrier);
if (carrier == TRUE) {
enum connman_element_type type = CONNMAN_ELEMENT_TYPE_UNKNOWN;
if (connman_element_register(element,
&device->element) < 0)
connman_element_unref(element);
+
+ __connman_service_indicate_configuration(service);
}
} else
connman_element_unregister_children(&device->element);
return 0;
}
-int __connman_profile_set_carrier(struct connman_device *device,
- connman_bool_t carrier)
-{
- struct connman_service *service;
-
- DBG("device %p carrier %d", device, carrier);
-
- service = __connman_service_lookup_from_device(device);
- if (service == NULL)
- return -EINVAL;
-
- return __connman_service_set_carrier(service, carrier);
-}
-
int __connman_profile_add_network(struct connman_network *network)
{
struct connman_service *service;
int __connman_service_set_carrier(struct connman_service *service,
connman_bool_t carrier)
{
+ if (service == NULL)
+ return -EINVAL;
+
switch (service->type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
case CONNMAN_SERVICE_TYPE_WIFI:
return connman_service_set_favorite(service, carrier);
}
+int __connman_service_indicate_configuration(struct connman_service *service)
+{
+ if (service == NULL)
+ return -EINVAL;
+
+ service->state = CONNMAN_SERVICE_STATE_CONFIGURATION;
+
+ return 0;
+}
+
/**
* connman_service_lookup:
* @identifier: service identifier