Hi Denis,

2010/9/1 Denis Kenzior <[email protected]>:
>>       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,
>
> Honestly I'm still lost, why are we doing this again?  reset_passwd
> corresponds to CPIN from 27.007.  This one does not accept a type.  Some
> modems (like the calypso) have the +CPIN2 command which can be used to
> enter PIN/PUK2.  Are you trying to solve this case?

Yes, I'm trying to reset PIN2. The +CPIN="puk","pin" uses the type
from the last +CPIN?. Unfortunately it may be transient (and I still
don't understand how the PIN2 is supposed to be entered using the AT
command interface).

> If so, we either need to add the type to both reset_passwd and
> send_passwd or leave this up to the driver to figure out.

OK, I'll do it that way.

>>                       ofono_sim_lock_unlock_cb_t cb, void *data);
>>       void (*change_passwd)(struct ofono_sim *sim,
>>                       enum ofono_sim_password_type type,
>> diff --git a/src/sim.c b/src/sim.c
>> index d0b5988..5e918f2 100644
>> --- a/src/sim.c
>> +++ b/src/sim.c
>> @@ -747,8 +747,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;
>> +     default:
>
> And now you're changing the API semantics completely.  ResetPin is
> supposed to be called like this:
>
> ResetPin("puk"/"puk2"/"corppuk"/"networkpuk"/etc, puk, newpin)
>
> Now you're changing this to be called like:
>
> ResetPin("pin"/"pin2", ...)
>
> I'm not necessarily saying this is a bad idea, but this does not cover
> all the other puks described in 27.007.

Oops.  I'll remove the check, it should be in the driver.

-- 
Pekka.Pessi mail at nokia.com
_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to