Hi Denis,

On 23 June 2010 21:44, Denis Kenzior <[email protected]> wrote:
>> +     struct stk_command *pending_cmd;
>>  };
>>
>> +static void stk_respond(struct ofono_stk *stk,
>> +                     struct stk_response *rsp, generic_cb_t cb)
>> +{
>> +     struct ofono_error error = { .type = OFONO_ERROR_TYPE_FAILURE };
>> +     const guint8 *tlv;
>> +     unsigned int tlv_len;
>> +
>> +     rsp->src = STK_DEVICE_IDENTITY_TYPE_TERMINAL;
>> +     rsp->dst = STK_DEVICE_IDENTITY_TYPE_UICC;
>> +     rsp->number = stk->pending_cmd->number;
>> +     rsp->type = stk->pending_cmd->type;
>> +     rsp->qualifier = stk->pending_cmd->qualifier;
>> +
>> +     if (stk->driver->terminal_response == NULL) {
>> +             cb(&error, stk);
>> +             return;
>> +     }
>
> What do you think of returning an int here (e.g. -ENOTSUPPORTED) instead of
> calling a callback?  I think that would make things a bit cleaner.

In that case can I use another function to wrap stk_respond? :)  The
reason I added this wrapper around driver->terminal_response is to
avoid repeating the same sequence everywhere.  If the caller needs to
check the return value from stk_respond then you have lots of
repetition again, the error handling will look the same in every case.

Regards
_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to