diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-08-19 11:32:46 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-08-19 14:20:05 -0500 |
commit | 8f0796ff4f7020ba637c3615fc58f0c7d80bb0a4 (patch) | |
tree | e1e19f13b41591b0559edb9ce74a98eb9e156c49 /src | |
parent | b73ebe3c8310a5e67555fbeaf89e393a693420fb (diff) | |
download | ofono-8f0796ff4f7020ba637c3615fc58f0c7d80bb0a4.tar.bz2 |
gprs: Update CreateContext to AddContext
Diffstat (limited to 'src')
-rw-r--r-- | src/gprs.c | 25 |
1 files changed, 10 insertions, 15 deletions
@@ -1155,26 +1155,21 @@ static DBusMessage *gprs_set_property(DBusConnection *conn, return dbus_message_new_method_return(msg); } -static DBusMessage *gprs_create_context(DBusConnection *conn, +static DBusMessage *gprs_add_context(DBusConnection *conn, DBusMessage *msg, void *data) { struct ofono_gprs *gprs = data; struct pri_context *context; - const char *name; const char *typestr; const char *path; enum gprs_context_type type; char **objpath_list; unsigned int id; - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &name, - DBUS_TYPE_STRING, &typestr, + if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &typestr, DBUS_TYPE_INVALID)) return __ofono_error_invalid_args(msg); - if (strlen(name) == 0 || strlen(name) > MAX_CONTEXT_NAME_LENGTH) - return __ofono_error_invalid_format(msg); - type = gprs_context_string_to_type(typestr); if (type == GPRS_CONTEXT_TYPE_INVALID) @@ -1188,7 +1183,7 @@ static DBusMessage *gprs_create_context(DBusConnection *conn, if (id > idmap_get_max(gprs->pid_map)) return __ofono_error_not_supported(msg); - context = pri_context_create(gprs, name, type); + context = pri_context_create(gprs, typestr, type); context->id = id; if (!context) { @@ -1354,13 +1349,13 @@ static DBusMessage *gprs_deactivate_all(DBusConnection *conn, } static GDBusMethodTable manager_methods[] = { - { "GetProperties", "", "a{sv}", gprs_get_properties }, - { "SetProperty", "sv", "", gprs_set_property }, - { "CreateContext", "ss", "o", gprs_create_context }, - { "RemoveContext", "o", "", gprs_remove_context, - G_DBUS_METHOD_FLAG_ASYNC }, - { "DeactivateAll", "", "", gprs_deactivate_all, - G_DBUS_METHOD_FLAG_ASYNC }, + { "GetProperties", "", "a{sv}", gprs_get_properties }, + { "SetProperty", "sv", "", gprs_set_property }, + { "AddContext", "s", "o", gprs_add_context }, + { "RemoveContext", "o", "", gprs_remove_context, + G_DBUS_METHOD_FLAG_ASYNC }, + { "DeactivateAll", "", "", gprs_deactivate_all, + G_DBUS_METHOD_FLAG_ASYNC }, { } }; |