From ca1df4353f0ed7873fbc6e835f1f2972bbb55feb Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 20 Dec 2009 13:32:05 -0800 Subject: [PATCH] Add basic support for immutable services --- doc/service-api.txt | 9 +++++++++ src/service.c | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/service-api.txt b/doc/service-api.txt index caf1dbe..1fe37ea 100644 --- a/doc/service-api.txt +++ b/doc/service-api.txt @@ -214,6 +214,15 @@ Properties string State [readonly] it back to false the Remove() method needs to be used. + boolean Immutable [readonly] + + This value will be set to true if the service is + configured externally via a configuration file. + + The only valid operation are Connect() and of + course Disconnect(). The Remove() method will + result in an error. + boolean AutoConnect [readwrite] If set to true, this service will auto-connect diff --git a/src/service.c b/src/service.c index dec8622..d3089a0 100644 --- a/src/service.c +++ b/src/service.c @@ -47,6 +47,7 @@ struct connman_service { enum connman_service_error error; connman_uint8_t strength; connman_bool_t favorite; + connman_bool_t immutable; connman_bool_t hidden; connman_bool_t ignore; connman_bool_t autoconnect; @@ -489,6 +490,9 @@ static DBusMessage *get_properties(DBusConnection *conn, connman_dbus_dict_append_basic(&dict, "Favorite", DBUS_TYPE_BOOLEAN, &service->favorite); + connman_dbus_dict_append_basic(&dict, "Immutable", + DBUS_TYPE_BOOLEAN, &service->immutable); + if (service->favorite == TRUE) connman_dbus_dict_append_basic(&dict, "AutoConnect", DBUS_TYPE_BOOLEAN, &service->autoconnect); @@ -1216,7 +1220,8 @@ static void __connman_service_initialize(struct connman_service *service) service->security = CONNMAN_SERVICE_SECURITY_UNKNOWN; service->state = CONNMAN_SERVICE_STATE_UNKNOWN; - service->favorite = FALSE; + service->favorite = FALSE; + service->immutable = FALSE; service->hidden = FALSE; service->ignore = FALSE; -- 2.7.4