Hi Pekka,
On 08/26/2010 07:49 AM, [email protected] wrote:
> From: Pekka Pessi <[email protected]>
>
> ---
> include/sim.h | 5 +++--
> src/sim.c | 9 +++++++--
> 2 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/include/sim.h b/include/sim.h
> index 36a99b9..d3e564c 100644
> --- a/include/sim.h
> +++ b/include/sim.h
> @@ -143,8 +143,9 @@ struct ofono_sim_driver {
> ofono_sim_passwd_cb_t cb, void *data);
> void (*send_passwd)(struct ofono_sim *sim, const char *passwd,
> ofono_sim_lock_unlock_cb_t cb, void *data);
> - void (*reset_passwd)(struct ofono_sim *sim, const char *puk,
> - const char *passwd,
> + void (*reset_passwd)(struct ofono_sim *sim,
> + enum ofono_sim_password_type type,
> + const char *puk, const char *passwd,
> ofono_sim_lock_unlock_cb_t cb, void *data);
I don't get it, reset_passwd maps to +CPIN which does not take a type
parameter...
> void (*change_passwd)(struct ofono_sim *sim,
> enum ofono_sim_password_type type,
> diff --git a/src/sim.c b/src/sim.c
> index 04a708b..bac77e0 100644
> --- a/src/sim.c
> +++ b/src/sim.c
> @@ -753,8 +753,13 @@ static DBusMessage *sim_reset_pin(DBusConnection *conn,
> DBusMessage *msg,
>
> type = sim_string_to_passwd(typestr);
>
> - if (type == OFONO_SIM_PASSWORD_NONE || type != sim->pin_type)
> + switch (type) {
> + case OFONO_SIM_PASSWORD_SIM_PIN:
> + case OFONO_SIM_PASSWORD_SIM_PIN2:
> + break;
sim->pin_type is PUK or PUK2 here, not PIN/PIN2.
> + default:
> return __ofono_error_invalid_format(msg);
> + }
>
> if (!is_valid_pin(puk, PIN_TYPE_PUK))
> return __ofono_error_invalid_format(msg);
> @@ -763,7 +768,7 @@ static DBusMessage *sim_reset_pin(DBusConnection *conn,
> DBusMessage *msg,
> return __ofono_error_invalid_format(msg);
>
> sim->pending = dbus_message_ref(msg);
> - sim->driver->reset_passwd(sim, puk, pin, sim_enter_pin_cb, sim);
> + sim->driver->reset_passwd(sim, type, puk, pin, sim_enter_pin_cb, sim);
>
> return NULL;
> }
Regards,
-Denis
_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono