Hi Kristen,

2010/11/25 Kristen Carlson Accardi <[email protected]>:
> @@ -1923,6 +1928,8 @@ int __ofono_sms_txq_submit(struct ofono_sms *sms, 
> GSList *list,
>                        sms->ref = sms->ref + 1;
>        }
>
> +       entry->id = tx_counter++;
> +
>        g_queue_push_tail(sms->txq, entry);

Can't you use g_queue_get_length() here to get the position of the
newly pushed entry? That would make tx_counter unnecessary (and
anyway, it should probably be internal to each sms atom data instead
of a static variable).

>        if (g_queue_get_length(sms->txq) == 1)
> @@ -1931,6 +1938,16 @@ int __ofono_sms_txq_submit(struct ofono_sms *sms, 
> GSList *list,
>        if (uuid)
>                memcpy(uuid, &entry->uuid, sizeof(*uuid));
>
> +       i = 0;
> +
> +       for (l = list; l; l = l->next) {
> +               struct sms *s = l->data;
> +               sms_tx_store(sms->imsi, entry->id,
> +                               ofono_uuid_to_str(&entry->uuid),
> +                               s, i);
> +               i++;
> +       }
> +
>        if (cb)
>                cb(sms, &entry->uuid, data);
>
> diff --git a/src/smsutil.c b/src/smsutil.c
> index e6dbf5f..4904419 100644
> --- a/src/smsutil.c
> +++ b/src/smsutil.c
> @@ -48,6 +48,10 @@
>  #define SMS_SR_BACKUP_PATH STORAGEDIR "/%s/sms_sr"
>  #define SMS_SR_BACKUP_PATH_FILE SMS_SR_BACKUP_PATH "/%s-%s"
>
> +#define SMS_TX_BACKUP_PATH STORAGEDIR "/%s/tx_queue"
> +#define SMS_TX_BACKUP_PATH_DIR SMS_TX_BACKUP_PATH "/%lu-%s"
> +#define SMS_TX_BACKUP_PATH_FILE SMS_TX_BACKUP_PATH_DIR "/%03i"
> +
>  #define SMS_ADDR_FMT "%24[0-9A-F]"
>  #define SMS_MSGID_FMT "%40[0-9A-F]"
>
> @@ -3125,6 +3129,28 @@ void status_report_assembly_expire(struct 
> status_report_assembly *assembly,
>        }
>  }
>
> +gboolean sms_tx_store(const char *imsi, unsigned long id, const char *uuid,
> +                       struct sms *s, guint8 seq)
> +{
> +       int len;
> +       unsigned char buf[177];
> +
> +       if (!imsi)

Need to explicitly compare to NULL here. A recently added convention, I admit.

Cheers,
Aki
_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to