void *data, const char *fac)
{
struct ofono_call_barring *cb = data;
- DBusMessageIter iter;
- const char *passwd = "";
+ const char *passwd;
+
+ if (!cb->driver->set)
+ return __ofono_error_not_implemented(msg);
if (cb->pending)
return __ofono_error_busy(msg);
- if (!dbus_message_iter_init(msg, &iter))
- return __ofono_error_invalid_args(msg);
-
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
+ if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &passwd,
+ DBUS_TYPE_INVALID) == FALSE)
return __ofono_error_invalid_args(msg);
- dbus_message_iter_get_basic(&iter, &passwd);
if (!is_valid_pin(passwd))
return __ofono_error_invalid_format(msg);
- if (!cb->driver->set)
- return __ofono_error_not_implemented(msg);
-
cb_set_query_bounds(cb, fac, FALSE);
cb->pending = dbus_message_ref(msg);
void *data)
{
struct ofono_call_barring *cb = data;
- DBusMessageIter iter;
- const char *old_passwd, *new_passwd;
+ const char *old_passwd;
+ const char *new_passwd;
+
+ if (!cb->driver->set_passwd)
+ return __ofono_error_not_implemented(msg);
if (cb->pending)
return __ofono_error_busy(msg);
- if (!dbus_message_iter_init(msg, &iter))
+ if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &old_passwd,
+ DBUS_TYPE_STRING, &new_passwd,
+ DBUS_TYPE_INVALID) == FALSE)
return __ofono_error_invalid_args(msg);
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
- return __ofono_error_invalid_args(msg);
-
- dbus_message_iter_get_basic(&iter, &old_passwd);
if (!is_valid_pin(old_passwd))
return __ofono_error_invalid_format(msg);
- dbus_message_iter_next(&iter);
-
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
- return __ofono_error_invalid_args(msg);
-
- dbus_message_iter_get_basic(&iter, &new_passwd);
if (!is_valid_pin(new_passwd))
return __ofono_error_invalid_format(msg);
- if (!cb->driver->set_passwd)
- return __ofono_error_not_implemented(msg);
-
cb->pending = dbus_message_ref(msg);
cb->driver->set_passwd(cb, "AB", old_passwd, new_passwd,
cb_set_passwd_callback, cb);
static DBusMessage *sim_lock_or_unlock(struct ofono_sim *sim, int lock,
DBusConnection *conn, DBusMessage *msg)
{
- DBusMessageIter iter;
enum ofono_sim_password_type type;
const char *typestr;
const char *pin;
if (sim->pending)
return __ofono_error_busy(msg);
- if (!dbus_message_iter_init(msg, &iter))
- return __ofono_error_invalid_args(msg);
-
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
+ if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &typestr,
+ DBUS_TYPE_STRING, &pin,
+ DBUS_TYPE_INVALID) == FALSE)
return __ofono_error_invalid_args(msg);
- dbus_message_iter_get_basic(&iter, &typestr);
-
type = sim_string_to_passwd(typestr);
/* SIM PIN2 cannot be locked / unlocked according to 27.007,
type == OFONO_SIM_PASSWORD_SIM_PIN2)
return __ofono_error_invalid_format(msg);
- dbus_message_iter_next(&iter);
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
- return __ofono_error_invalid_args(msg);
-
- dbus_message_iter_get_basic(&iter, &pin);
-
if (!is_valid_pin(pin))
return __ofono_error_invalid_format(msg);
void *data)
{
struct ofono_sim *sim = data;
- DBusMessageIter iter;
enum ofono_sim_password_type type;
const char *typestr;
const char *old;
if (sim->pending)
return __ofono_error_busy(msg);
- if (!dbus_message_iter_init(msg, &iter))
- return __ofono_error_invalid_args(msg);
-
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
+ if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &typestr,
+ DBUS_TYPE_STRING, &old,
+ DBUS_TYPE_STRING, &new,
+ DBUS_TYPE_INVALID) == FALSE)
return __ofono_error_invalid_args(msg);
- dbus_message_iter_get_basic(&iter, &typestr);
-
type = sim_string_to_passwd(typestr);
if (password_is_pin(type) == FALSE)
return __ofono_error_invalid_format(msg);
- dbus_message_iter_next(&iter);
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
- return __ofono_error_invalid_args(msg);
-
- dbus_message_iter_get_basic(&iter, &old);
-
if (!is_valid_pin(old))
return __ofono_error_invalid_format(msg);
- dbus_message_iter_next(&iter);
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
- return __ofono_error_invalid_args(msg);
-
- dbus_message_iter_get_basic(&iter, &new);
-
if (!is_valid_pin(new))
return __ofono_error_invalid_format(msg);
void *data)
{
struct ofono_sim *sim = data;
- DBusMessageIter iter;
const char *typestr;
enum ofono_sim_password_type type;
const char *pin;
if (sim->pending)
return __ofono_error_busy(msg);
- if (!dbus_message_iter_init(msg, &iter))
- return __ofono_error_invalid_args(msg);
-
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
+ if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &typestr,
+ DBUS_TYPE_STRING, &pin,
+ DBUS_TYPE_INVALID) == FALSE)
return __ofono_error_invalid_args(msg);
- dbus_message_iter_get_basic(&iter, &typestr);
-
type = sim_string_to_passwd(typestr);
if (type == OFONO_SIM_PASSWORD_NONE || type != sim->pin_type)
return __ofono_error_invalid_format(msg);
- dbus_message_iter_next(&iter);
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
- return __ofono_error_invalid_args(msg);
-
- dbus_message_iter_get_basic(&iter, &pin);
-
if (!is_valid_pin(pin))
return __ofono_error_invalid_format(msg);
void *data)
{
struct ofono_sim *sim = data;
- DBusMessageIter iter;
const char *typestr;
enum ofono_sim_password_type type;
const char *puk;
if (sim->pending)
return __ofono_error_busy(msg);
- if (!dbus_message_iter_init(msg, &iter))
- return __ofono_error_invalid_args(msg);
-
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
+ if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &typestr,
+ DBUS_TYPE_STRING, &puk,
+ DBUS_TYPE_STRING, &pin,
+ DBUS_TYPE_INVALID) == FALSE)
return __ofono_error_invalid_args(msg);
- dbus_message_iter_get_basic(&iter, &typestr);
-
type = sim_string_to_passwd(typestr);
if (type == OFONO_SIM_PASSWORD_NONE || type != sim->pin_type)
return __ofono_error_invalid_format(msg);
- dbus_message_iter_next(&iter);
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
- return __ofono_error_invalid_args(msg);
-
- dbus_message_iter_get_basic(&iter, &puk);
-
if (!is_valid_pin(puk))
return __ofono_error_invalid_format(msg);
- dbus_message_iter_next(&iter);
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
- return __ofono_error_invalid_args(msg);
-
- dbus_message_iter_get_basic(&iter, &pin);
-
if (!is_valid_pin(pin))
return __ofono_error_invalid_format(msg);