}
static int
+_on_cmd_service_get_immutable(char *cmd, char *args)
+{
+ const char *path;
+ bool immutable;
+ E_Connman_Element *e;
+
+ if (!args)
+ {
+ fputs("ERROR: missing the service path\n", stderr);
+ return 1;
+ }
+ _tok(args);
+ path = args;
+
+ e = e_connman_service_get(path);
+ if (e_connman_service_immutable_get(e, &immutable))
+ printf(":::Service %s Immutable = %hhu\n", path, immutable);
+ else
+ fputs("ERROR: can't get service immutable\n", stderr);
+ return 1;
+}
+
+static int
_on_cmd_service_get_auto_connect(char *cmd, char *args)
{
const char *path;
{"service_get_passphrase_required", _on_cmd_service_get_passphrase_required},
{"service_get_strength", _on_cmd_service_get_strength},
{"service_get_favorite", _on_cmd_service_get_favorite},
+ {"service_get_immutable", _on_cmd_service_get_immutable},
{"service_get_auto_connect", _on_cmd_service_get_auto_connect},
{"service_set_auto_connect", _on_cmd_service_set_auto_connect},
{"service_get_setup_required", _on_cmd_service_get_setup_required},
};
static const struct test_desc test_desc_profile[] = {
- TEST_DESC_STRING_GET(e_connman_profile_name_get, 0),
+ TEST_DESC_STRING_GET(e_connman_profile_name_get, 1),
TEST_DESC_BOOL_GET(e_connman_profile_offline_mode_get, 0),
//TEST_DESC_BOOL_SET(e_connman_profile_offline_mode_set, 0),
TEST_DESC_ELEMENTS_GET(e_connman_profile_services_get, 1),
/* TODO: need to check exactly what properties may fail */
TEST_DESC_STRING_GET(e_connman_service_state_get, 1),
TEST_DESC_STRING_GET(e_connman_service_error_get, 1),
- TEST_DESC_STRING_GET(e_connman_service_name_get, 1),
- TEST_DESC_STRING_GET(e_connman_service_type_get, 1),
+ TEST_DESC_STRING_GET(e_connman_service_name_get, 0),
+ TEST_DESC_STRING_GET(e_connman_service_type_get, 0),
TEST_DESC_STRING_GET(e_connman_service_mode_get, 1),
TEST_DESC_STRING_GET(e_connman_service_security_get, 1),
TEST_DESC_STRING_GET(e_connman_service_passphrase_get, 1),
//TEST_DESC_STRING_SET(e_connman_service_passphrase_set, 1),
TEST_DESC_BOOL_GET(e_connman_service_passphrase_required_get, 1),
TEST_DESC_UCHAR_GET(e_connman_service_strength_get, 1),
- TEST_DESC_BOOL_GET(e_connman_service_favorite_get, 1),
- TEST_DESC_BOOL_GET(e_connman_service_auto_connect_get, 1),
+ TEST_DESC_BOOL_GET(e_connman_service_favorite_get, 0),
+ TEST_DESC_BOOL_GET(e_connman_service_immutable_get, 0),
+ TEST_DESC_BOOL_GET(e_connman_service_auto_connect_get, 0),
//TEST_DESC_BOOL_SET(e_connman_service_auto_connect_set, 1),
TEST_DESC_BOOL_GET(e_connman_service_setup_required_get, 1),
TEST_DESC_STRING_GET(e_connman_service_apn_get, 1),
EAPI bool e_connman_service_favorite_get(const E_Connman_Element *service, bool *favorite) EINA_ARG_NONNULL(1, 2) EINA_PURE EINA_WARN_UNUSED_RESULT;
+ EAPI bool e_connman_service_immutable_get(const E_Connman_Element *service, bool *immutable) EINA_ARG_NONNULL(1, 2) EINA_PURE EINA_WARN_UNUSED_RESULT;
+
EAPI bool e_connman_service_auto_connect_get(const E_Connman_Element *service, bool *auto_connect) EINA_ARG_NONNULL(1, 2) EINA_PURE EINA_WARN_UNUSED_RESULT;
EAPI bool e_connman_service_auto_connect_set(E_Connman_Element *service, bool auto_connect, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
EAPI bool e_connman_service_ipv4_address_get(const E_Connman_Element *service, const char **address) EINA_ARG_NONNULL(1, 2) EINA_PURE EINA_WARN_UNUSED_RESULT;
- // TODO: immutable_get
// TODO: ipv4_netmask_get
// TODO: ipv4_gateway_get
// TODO: ipv4_configuration_metod_get
const char *e_connman_prop_passphrase = NULL;
const char *e_connman_prop_passphrase_required = NULL;
const char *e_connman_prop_favorite = NULL;
+const char *e_connman_prop_immutable = NULL;
const char *e_connman_prop_auto_connect = NULL;
const char *e_connman_prop_setup_required = NULL;
const char *e_connman_prop_apn = NULL;
e_connman_prop_passphrase_required = eina_stringshare_add("PassphraseRequired");
if (e_connman_prop_favorite == NULL)
e_connman_prop_favorite = eina_stringshare_add("Favorite");
+ if (e_connman_prop_immutable == NULL)
+ e_connman_prop_immutable = eina_stringshare_add("Immutable");
if (e_connman_prop_auto_connect == NULL)
e_connman_prop_auto_connect = eina_stringshare_add("AutoConnect");
if (e_connman_prop_setup_required == NULL)
_stringshare_del(&e_connman_prop_passphrase);
_stringshare_del(&e_connman_prop_passphrase_required);
_stringshare_del(&e_connman_prop_favorite);
+ _stringshare_del(&e_connman_prop_immutable);
_stringshare_del(&e_connman_prop_auto_connect);
_stringshare_del(&e_connman_prop_setup_required);
_stringshare_del(&e_connman_prop_apn);
extern const char *e_connman_prop_passphrase;
extern const char *e_connman_prop_passphrase_required;
extern const char *e_connman_prop_favorite;
+extern const char *e_connman_prop_immutable;
extern const char *e_connman_prop_auto_connect;
extern const char *e_connman_prop_setup_required;
extern const char *e_connman_prop_apn;
}
/**
+ * Get property "Immutable" value.
+ *
+ * This value will be set to true if the service is configured
+ * externally via a configuration file.
+ *
+ * The only valid operation are e_connman_service_connect() and
+ * e_connman_service_disconnect(). The e_connman_service_remove()
+ * method will result in an error.
+
+ * @param service_path to get property.
+ * @param immutable where to store the property value, must be a
+ * pointer to bollean (bool *).
+ *
+ * @return 1 on success, 0 otherwise.
+ */
+bool
+e_connman_service_immutable_get(const E_Connman_Element *service, bool *immutable)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(immutable, 0);
+ return e_connman_element_property_get_stringshared
+ (service, e_connman_prop_immutable, NULL, immutable);
+}
+
+/**
* Get property "AutoConnect" value.
*
* If this property isn't found then 0 is returned.