From: Dario <djdas@djdas.net>
To: ofono@ofono.org
Subject: Re: [PATCH 2/2] Added SQLite history plugin
Date: Wed, 07 Apr 2010 10:50:27 +0200 [thread overview]
Message-ID: <4BBC4753.6050105@djdas.net> (raw)
In-Reply-To: <201004061256.46026.denkenz@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3837 bytes --]
Hi Denis,
> Hi Dario,
>
>
>> +#define SQL_HISTORY_DB_PATH STORAGEDIR "/ofono_history.sqlite"
>> +#define SQL_HISTORY_DB_SQL STORAGEDIR "/oFono_History_DB.sql"
>>
>
> So I have my concerns about storing this in /. This should be in a proper
> directory, like /var/lib/ofono or something like that.
>
>
STORAGEDIR is a macro expanded by Autoconf to ${storagedir} (please see
rows 172-178 of configure.ac) which is normally /var/lib/ofono so the DB
and the scripts are already stored inside that dir.
> So remember that the history plugin is instantiated for each and every modem,
> so you will be sqlite_open/sqlite_closing the db in each instance. Not really
> sure if this is what you want, or whether you want a reference-counted
> database connection here.
>
Database connection is handled by sqlite3_* API in a transparent manner
so you could have different open connections at the same time without
any problem, each SQL statement is transactional so the DB is every time
consistent, but if you prefer I can rethink of it (maybe a DB for every
modem could be a possibility but this would overload the plugin because
we have to open and close the DB in every callback given that we have to
filter the files access by modem).
> Another thing to consider is that you might want to store the IMSI of the
> modem along with the history information for every call / sms event. That way
> when a SIM card is changed, the user can be shown a different set of call / sms
> history.
>
>
Thank you for this suggestion, didn't think about this :) I have one
question: what's the best way to get that info?
I see only one function to get the imsi information: const char
*ofono_sim_get_imsi(struct ofono_sim *sim) which needs a struct
ofono_sim pointer, but I don't have it in history as it's a member of
the struct ofono_modem which is blind for me. Can you please point me at
the function to achieve this?
> Finally, you might want to set limits on the number of entries in the
> database, and expire them as the limit is reached. Otherwise you'd need to
> expire them periodically from e.g. cron, but would need to release control of
> the database during that time.
>
>
Well this is a more complex topic because needs to point at the purpose
of the history plugins (in general); I thought at the plugin as a simple
"event logger" in which an "event" could be a call or a SMS; the
question is: must the plugin handle all the logic and possibly interface
with the applications (for example using DBus methods/signals) or is it
only a mere storage daemon letting applications handle the informations?
Talking about this with one of my team members (Nicola.mfb, which should
explain better than me applications point of view in a next email) we
arrived at the conclusion that the history plugin should be able to talk
directly to the applications (tipically sending DBus signals and
exporting methods) to mask the storage type of the history data.
Also in this case there could be some possible issues to handle: who is
aware of the msg_id? Only the plugin or even the application? In the
former case must the application provide to the plugin its own msg_id to
recover SMS data?
Another question is: what if we had different history plugins at the
same time, like an EDS one, a plain text one, a Berkley DB one and an
SQLite one? There should be only one plugin active per ofonod instance
or per modem? In case different plugins are active at the same time, the
"history DBus interface" is global for all the plugins (i.e. a method to
delete an incoming sms from modem /modem0 with msg_id = 123 must delete
it on all backends?) or each plugin has its own?
Thank you very much in advance, best regards,
Dario
next prev parent reply other threads:[~2010-04-07 8:50 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-06 10:43 [PATCH 2/2] Added SQLite history plugin Dario
2010-04-06 17:56 ` Denis Kenzior
2010-04-07 8:50 ` Dario [this message]
2010-04-07 17:01 ` Denis Kenzior
2010-04-07 17:54 ` Nicola Mfb
2010-04-07 18:05 ` Denis Kenzior
2010-04-07 19:20 ` Nicola Mfb
2010-04-07 19:33 ` Denis Kenzior
2010-04-07 21:26 ` Nicola Mfb
2010-04-07 11:47 ` Nicola Mfb
2010-04-07 17:28 ` Bastian, Waldo
2010-04-07 17:33 ` Denis Kenzior
2010-04-07 17:43 ` Nicola Mfb
2010-04-07 17:55 ` Denis Kenzior
2010-04-07 18:09 ` Nicola Mfb
2010-04-07 18:20 ` Denis Kenzior
2010-04-07 18:03 ` Bastian, Waldo
2010-04-07 18:27 ` Denis Kenzior
2010-04-07 19:28 ` Denis Kenzior
-- strict thread matches above, loose matches on Subject: below --
2010-04-04 21:51 Dario
2010-04-05 2:54 ` Bastian, Waldo
2010-04-06 10:55 ` Dario
2010-04-06 16:12 ` Bastian, Waldo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BBC4753.6050105@djdas.net \
--to=djdas@djdas.net \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.