extern void connman_device_set_mode(struct connman_device *device,
enum connman_device_mode mode);
extern enum connman_device_mode connman_device_get_mode(struct connman_device *device);
+extern void connman_device_set_secondary(struct connman_device *device,
+ connman_bool_t secondary);
+extern connman_bool_t connman_device_get_secondary(struct connman_device *device);
extern int connman_device_set_powered(struct connman_device *device,
connman_bool_t powered);
enum connman_device_type type;
enum connman_device_mode mode;
enum connman_device_policy policy;
+ connman_bool_t secondary;
connman_bool_t powered;
connman_bool_t carrier;
connman_bool_t scanning;
case CONNMAN_DEVICE_MODE_NETWORK_MULTIPLE:
break;
case CONNMAN_DEVICE_MODE_TRANSPORT_IP:
- __connman_profile_add_device(device);
+ if (device->secondary == FALSE)
+ __connman_profile_add_device(device);
break;
}
case CONNMAN_DEVICE_MODE_NETWORK_MULTIPLE:
break;
case CONNMAN_DEVICE_MODE_TRANSPORT_IP:
- __connman_profile_remove_device(device);
+ if (device->secondary == FALSE)
+ __connman_profile_remove_device(device);
break;
}
device->element.ipv4.method = CONNMAN_IPV4_METHOD_DHCP;
- device->type = type;
- device->name = g_strdup(type2description(device->type));
- device->mode = CONNMAN_DEVICE_MODE_UNKNOWN;
- device->policy = CONNMAN_DEVICE_POLICY_AUTO;
+ device->type = type;
+ device->name = g_strdup(type2description(device->type));
+ device->mode = CONNMAN_DEVICE_MODE_UNKNOWN;
+ device->policy = CONNMAN_DEVICE_POLICY_AUTO;
+ device->secondary = FALSE;
switch (type) {
case CONNMAN_DEVICE_TYPE_UNKNOWN:
}
/**
+ * connman_device_set_secondary:
+ * @device: device structure
+ * @secondary: secondary value
+ *
+ * Change secondary value of device
+ */
+void connman_device_set_secondary(struct connman_device *device,
+ connman_bool_t secondary)
+{
+ device->secondary = secondary;
+}
+
+/**
+ * connman_device_get_secondary:
+ * @device: device structure
+ *
+ * Get secondary value of device
+ */
+connman_bool_t connman_device_get_secondary(struct connman_device *device)
+{
+ return device->secondary;
+}
+
+/**
* connman_device_set_powered:
* @device: device structure
* @powered: powered state
struct connman_element element;
enum connman_network_type type;
enum connman_network_protocol protocol;
+ connman_bool_t secondary;
connman_bool_t available;
connman_bool_t connected;
connman_bool_t remember;
connman_element_set_uint8(&network->element, "Strength", strength);
- network->type = type;
+ network->type = type;
+ network->secondary = FALSE;
network->identifier = g_strdup(identifier);
return network;
return err;
}
+ network->secondary = connman_device_get_secondary(network->device);
+
switch (network->type) {
case CONNMAN_NETWORK_TYPE_UNKNOWN:
case CONNMAN_NETWORK_TYPE_VENDOR:
break;
case CONNMAN_NETWORK_TYPE_WIFI:
case CONNMAN_NETWORK_TYPE_WIMAX:
- __connman_profile_add_network(network);
+ if (network->secondary == FALSE)
+ __connman_profile_add_network(network);
break;
}
break;
case CONNMAN_NETWORK_TYPE_WIFI:
case CONNMAN_NETWORK_TYPE_WIMAX:
- __connman_profile_remove_network(network);
+ if (network->secondary == FALSE)
+ __connman_profile_remove_network(network);
break;
}