Re: [patch 12/20] struct tx_queue_entry: add a destructor

2010-07-23 Thread Denis Kenzior
Hi Inaky, >> tx_queue_entry * here. Casting the destructor in g_foo_foreach is >> acceptable. > > Heh, I'd rather have it like this: Repeat after me in a 1000-loop: casts > are evil and should be avoided for they muck the code by hiding warnings > when you change things and miss updating all the

Re: [patch 08/20] sms: document the org.ofono.SMSMessage D-Bus interface

2010-07-23 Thread Denis Kenzior
Hi Inaky, On 07/23/2010 03:59 PM, Inaky Perez-Gonzalez wrote: > From: Inaky Perez-Gonzalez > > --- > doc/sms-api.txt | 49 +++-- > 1 files changed, 47 insertions(+), 2 deletions(-) > > diff --git a/doc/sms-api.txt b/doc/sms-api.txt > index 1fc32ac.

Re: [patch 12/20] struct tx_queue_entry: add a destructor

2010-07-23 Thread Inaky Perez-Gonzalez
On Fri, 2010-07-23 at 16:06 -0700, Denis Kenzior wrote: > Hi Inaky, > > > + > > +/* > > + * Destroy/release the contents of a 'struct tx_queue_entry' > > + * > > + * This releases resources allocated *inside* @entry and @entry > > + * itself. > > + */ > > +static void tx_queue_entry_destroy_free(

Re: [patch 12/20] struct tx_queue_entry: add a destructor

2010-07-23 Thread Denis Kenzior
Hi Inaky, > + > +/* > + * Destroy/release the contents of a 'struct tx_queue_entry' > + * > + * This releases resources allocated *inside* @entry and @entry > + * itself. > + */ > +static void tx_queue_entry_destroy_free(gpointer _entry, gpointer unused) Can't this be simply tx_queue_entry_free?

Re: [patch 11/20] SMS: rename create_tx_queue_entry() to tx_queue_entry_new()

2010-07-23 Thread Denis Kenzior
Hi Inaky, On 07/23/2010 03:59 PM, Inaky Perez-Gonzalez wrote: > From: Inaky Perez-Gonzalez > > This is for symmetry with tx_queue_entry_free() > --- > src/sms.c |6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > Applied with a minor tweak to the commit header. Regards, -Deni

Re: [patch 10/20] sms_text_prepare: document @use_delivery_reports

2010-07-23 Thread Denis Kenzior
Hi Inaky, On 07/23/2010 03:59 PM, Inaky Perez-Gonzalez wrote: > From: Inaky Perez-Gonzalez > > --- > src/smsutil.c |3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > This one has been applied with a minor tweak to the commit message. Regards, -Denis

Re: [patch 02/20] write_file: make transaction-safe

2010-07-23 Thread Inaky Perez-Gonzalez
On Fri, 2010-07-23 at 14:57 -0700, Denis Kenzior wrote: > Hi Inaky, > > On 07/23/2010 03:59 PM, Inaky Perez-Gonzalez wrote: > > From: Inaky Perez-Gonzalez > > > > write_file(), as written wasn't transaction-safe; a crash bewtween a > > file being open and the buffer being written before a safe

Re: [patch 06/20] _assembly_encode_address: export and rename

2010-07-23 Thread Denis Kenzior
Hi Inaky, On 07/23/2010 03:59 PM, Inaky Perez-Gonzalez wrote: > From: Inaky Perez-Gonzalez > > The new name better reflects the function's purpose. > > We need to export it, as for generating unique message naming (for > persistence and D-Bus object naming), we'll be using the > address. > ---

Re: [patch 05/20] introduce DECLARE_SMS_ADDR_STR()

2010-07-23 Thread Denis Kenzior
Hi Inaky, On 07/23/2010 03:59 PM, Inaky Perez-Gonzalez wrote: > From: Inaky Perez-Gonzalez > > Introduce DECLARE_SMS_ADDR_STR(), which declares a string variable of > the right size for passing to sms_assembly_decode_address(). This way > we detach each client having to have the knowledge of wha

Re: [patch 03/20] manpage: explain debugging options to -d

2010-07-23 Thread Denis Kenzior
Hi Inaky, On 07/23/2010 03:59 PM, Inaky Perez-Gonzalez wrote: > From: Inaky Perez-Gonzalez > > Modified HACKING and man page to have more formation on what are the > debugging options and how to enable them. > --- > HACKING | 10 ++ > doc/ofonod.8 |5 - > 2 files changed,

Re: [PATCH 1/2] stkutil: convert img to xpm

2010-07-23 Thread Denis Kenzior
Hi Kristen, >> Also, you might want to change unsigned ints to unsigned chars. The >> image size and CLUT size can never be more than 256. >> > > The image size can be greater than 256, but I think you mean the value of > height, width, and ncolors can never be greater than 256, which is true.

Re: [PATCH 1/2] stkutil: convert img to xpm

2010-07-23 Thread Kristen Carlson Accardi
On Fri, 23 Jul 2010 16:46:51 -0500 Denis Kenzior wrote: > Hi Kristen, > > On 07/23/2010 04:39 PM, Kristen Carlson Accardi wrote: > > On Fri, 23 Jul 2010 16:03:16 -0500 > > Denis Kenzior wrote: > > > >> Hi Kristen, > >> > >> On 07/23/2010 03:52 PM, Kristen Carlson Accardi wrote: > >>> On Fri, 2

Re: [patch 01/20] bug.h: Add BUILD_BUG_ON() and friends for compile-time assert checking

2010-07-23 Thread Denis Kenzior
Hi Inaky, >> Second, please actually check that your code passes make distcheck: >> >> CCLD unit/test-idmap >> CC unit/test-sms.o >> CC src/smsutil.o >> ../src/smsutil.c:40:17: error: bug.h: No such file or directory >> make[2]: *** [src/smsutil.o] Error 1 >> make[1]: *** [all] Err

Re: [patch 02/20] write_file: make transaction-safe

2010-07-23 Thread Denis Kenzior
Hi Inaky, On 07/23/2010 03:59 PM, Inaky Perez-Gonzalez wrote: > From: Inaky Perez-Gonzalez > > write_file(), as written wasn't transaction-safe; a crash bewtween a > file being open and the buffer being written before a safe close would > leave the file with a set of undetermined contents. > >

Re: [patch 01/20] bug.h: Add BUILD_BUG_ON() and friends for compile-time assert checking

2010-07-23 Thread Inaky Perez-Gonzalez
On Fri, 2010-07-23 at 14:41 -0700, Denis Kenzior wrote: > Hi Inaky, > > On 07/23/2010 03:59 PM, Inaky Perez-Gonzalez wrote: > > From: Inaky Perez-Gonzalez > > > > These have been stolen from the Linux kernel source; come pretty handy > > to make build-time consistency checks and thus avoid run-

Re: [PATCH 1/2] stkutil: convert img to xpm

2010-07-23 Thread Denis Kenzior
Hi Kristen, On 07/23/2010 04:39 PM, Kristen Carlson Accardi wrote: > On Fri, 23 Jul 2010 16:03:16 -0500 > Denis Kenzior wrote: > >> Hi Kristen, >> >> On 07/23/2010 03:52 PM, Kristen Carlson Accardi wrote: >>> On Fri, 23 Jul 2010 15:03:59 -0500 >>> Denis Kenzior wrote: This also brings

Re: [patch 01/20] bug.h: Add BUILD_BUG_ON() and friends for compile-time assert checking

2010-07-23 Thread Denis Kenzior
Hi Inaky, On 07/23/2010 03:59 PM, Inaky Perez-Gonzalez wrote: > From: Inaky Perez-Gonzalez > > These have been stolen from the Linux kernel source; come pretty handy > to make build-time consistency checks and thus avoid run-time > surprises. > --- > src/bug.h | 50 +++

Re: [PATCH 1/2] stkutil: convert img to xpm

2010-07-23 Thread Kristen Carlson Accardi
On Fri, 23 Jul 2010 16:03:16 -0500 Denis Kenzior wrote: > Hi Kristen, > > On 07/23/2010 03:52 PM, Kristen Carlson Accardi wrote: > > On Fri, 23 Jul 2010 15:03:59 -0500 > > Denis Kenzior wrote: > >> > >> This also brings up another point. You're assuming that the caller is > >> appending the CL

Re: [PATCH 1/2] stkutil: convert img to xpm

2010-07-23 Thread Denis Kenzior
Hi Kristen, On 07/23/2010 03:52 PM, Kristen Carlson Accardi wrote: > On Fri, 23 Jul 2010 15:03:59 -0500 > Denis Kenzior wrote: >> >> This also brings up another point. You're assuming that the caller is >> appending the CLUT right after the image data and massaging the clut >> offset appropriate

[patch 20/20] SMS: Implement D-Bus SMS-MSG::GetProperties

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez Currently this only returns the state of the SMS message. --- src/sms.c | 25 + 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/src/sms.c b/src/sms.c index 97c9eab..5be2e39 100644 --- a/src/sms.c +++ b/src/sms.c @@ -537,6 +537,

[patch 19/20] SMS: introduce sms_msg_cancel and its D-Bus wrapper

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez This introduces the ability to cancel a pending SMS message, accessible via an internal API and over a D-Bus wrapper. Sending a note to the network to cancel an in-transit message is not yet implemented. Note the test case code requires follow up commits that propagat

[patch 18/20] SMS: send D-Bus SMS-MSG::PropertyChanged signals when message changes status

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez This hooks sms_msg_stch_dbus_cb() into the SMS state change callback so that a D-Bus signal will be emitted whenever an SMS Message transitions state. This allows a client to track, if desired, what is going on with the SMS Message it cares about. --- src/sms.c

[patch 16/20] SMS: introduce a state change callback for TX messages

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez When the SMS message going through the TX hoops changes states, call the given callback function (if any). This will be used later to hook up the D-Bus propagation of property changed signals. Note this will takes away with the ofono_sms_txq_submit_cb callback, as it c

[patch 17/20] SMS: export outgoing messages over D-Bus

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez Splits sms_send_message() into a D-Bus front end and an internal API: - sms_msg_send(), a full C interface for SMS sending - dbus_sms_msg_send(): adapts sms_msg_send() to be a D-Bus call, exporting the object on the bus, returning its name and setting up all the c

[patch 14/20] SMS: introduce bare state machine and transitions

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez This adds state to outgoing/in-transit SMS messages. This will be used later on for persistence / D-Bus, when the SMS life cycle is expanded. The state is a variable in the 'struct tx_queue_entry' which gets updated as messages go through the hoops. --- src/ofono.h |

[patch 15/20] SMS: introduce Wait-for-Status-Report state and infrastructure

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez A WSR (Waiting for Status Report) state definition is added to the state transtition machine; as well, a queue (ofono_sms->tx_wfaq) where messages waiting for an status report are queued. When the message's delivery is acknowledged, the message is removed from the queue

[patch 13/20] SMS: encapsulate D-Bus specific data in 'struct sms_msg_dbus_data'

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez This will ease adding later on other fields that are D-Bus specific and needed to export SMS messages in TX transit over D-Bus. --- src/sms.c | 21 +++-- 1 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/sms.c b/src/sms.c index 5f5df

[patch 12/20] struct tx_queue_entry: add a destructor

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez Introduce a destructor function to encapsulate all the release steps for this data type, as more are to be added later. --- src/sms.c | 25 +++-- 1 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/sms.c b/src/sms.c index 85353ff..

[patch 11/20] SMS: rename create_tx_queue_entry() to tx_queue_entry_new()

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez This is for symmetry with tx_queue_entry_free() --- src/sms.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sms.c b/src/sms.c index b53f880..85353ff 100644 --- a/src/sms.c +++ b/src/sms.c @@ -522,7 +522,7 @@ static void set_ref_and_t

[patch 10/20] sms_text_prepare: document @use_delivery_reports

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez --- src/smsutil.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/smsutil.c b/src/smsutil.c index 969c1b7..3ca5979 100644 --- a/src/smsutil.c +++ b/src/smsutil.c @@ -2831,6 +2831,9 @@ static inline GSList *sms_list_append(GSList *l, const

[patch 09/20] SMS: document handle_sms_status_report()

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez --- src/sms.c |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/src/sms.c b/src/sms.c index 49f3e54..b53f880 100644 --- a/src/sms.c +++ b/src/sms.c @@ -887,6 +887,15 @@ static void handle_deliver(struct ofono_sms *sms, const struct sms *

[patch 08/20] sms: document the org.ofono.SMSMessage D-Bus interface

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez --- doc/sms-api.txt | 49 +++-- 1 files changed, 47 insertions(+), 2 deletions(-) diff --git a/doc/sms-api.txt b/doc/sms-api.txt index 1fc32ac..af4baae 100644 --- a/doc/sms-api.txt +++ b/doc/sms-api.txt @@ -22,9 +22,27 @@

[patch 07/20] SMS: implement SHA256-based message IDs [incomplete]

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez This patch removes the sequential SMS message identification gig and replaces it with a 16-bit hash cookie based off message contents. FIXME: [incomplete] need to figure out how to do so that identical messages sent to the same number also have a different ID. Note th

[patch 06/20] _assembly_encode_address: export and rename

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez The new name better reflects the function's purpose. We need to export it, as for generating unique message naming (for persistence and D-Bus object naming), we'll be using the address. --- src/smsutil.c |7 +++ src/smsutil.h |2 ++ 2 files changed, 5 inse

[patch 05/20] introduce DECLARE_SMS_ADDR_STR()

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez Introduce DECLARE_SMS_ADDR_STR(), which declares a string variable of the right size for passing to sms_assembly_decode_address(). This way we detach each client having to have the knowledge of what the right size is, leaving that decission to the infrastructure provide

[patch 04/20] SMS: introduce message ID API

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez This adds a simple API to use for generating unique IDs for SMS messages. Note this adds missing #includes to src/smsutil.h; header files should included from any other .c or .h file. --- Makefile.am|5 +- src/smsutil.c | 191

[patch 03/20] manpage: explain debugging options to -d

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez Modified HACKING and man page to have more formation on what are the debugging options and how to enable them. --- HACKING | 10 ++ doc/ofonod.8 |5 - 2 files changed, 14 insertions(+), 1 deletions(-) diff --git a/HACKING b/HACKING index ae420aa

[patch 02/20] write_file: make transaction-safe

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez write_file(), as written wasn't transaction-safe; a crash bewtween a file being open and the buffer being written before a safe close would leave the file with a set of undetermined contents. Modified to the file is written to a temporary file name; once completed, it

[patch 00/20] SMS D-Bus support and misc small patches

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez This (3rd? 4th?) version of the patchset builds the D-Bus support on top of the new _txq_submit() callback mechanism. Note there are still a couple of opens that need discussion: - the message ID is generated based on the contents of the message -- thus, the curre

[patch 01/20] bug.h: Add BUILD_BUG_ON() and friends for compile-time assert checking

2010-07-23 Thread Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez These have been stolen from the Linux kernel source; come pretty handy to make build-time consistency checks and thus avoid run-time surprises. --- src/bug.h | 50 ++ src/smsutil.c |1 + 2 files changed, 51 inse

Re: [PATCH 1/2] stkutil: convert img to xpm

2010-07-23 Thread Kristen Carlson Accardi
On Fri, 23 Jul 2010 15:03:59 -0500 Denis Kenzior wrote: > > This also brings up another point. You're assuming that the caller is > appending the CLUT right after the image data and massaging the clut > offset appropriately. This is a really bad idea since the caller will > have to do some sign

Re: [PATCH 1/2] stkutil: convert img to xpm

2010-07-23 Thread Denis Kenzior
Hi Kristen, On 07/22/2010 07:10 PM, Kristen Carlson Accardi wrote: > --- > src/stkutil.c | 148 > + > src/stkutil.h |8 +++ > 2 files changed, 156 insertions(+), 0 deletions(-) > > diff --git a/src/stkutil.c b/src/stkutil.c > index 9c

Re: [PATCH 2/5] stk: Add menu related utilities.

2010-07-23 Thread Denis Kenzior
Hi Andrew, > +static struct stk_menu *stk_menu_create(const char *title, > + const struct stk_text_attribute *title_attr, GSList *items, > + const struct stk_item_text_attribute_list *item_attrs, > + const struct stk_items_next_action_indicator *next_action, > +

Re: [PATCH] watch: Free service data in service_reply

2010-07-23 Thread Marcel Holtmann
Hi Zhenhua, > Avoid the memory leak of server_data. > --- > gdbus/watch.c |5 - > 1 files changed, 4 insertions(+), 1 deletions(-) do me a favor and post this to linux-blueto...@vger.kernel.org as well for the Bluetooth guys to review. After that I can take of applying it to all trees.

RE: Howto about Qt QML and Ofono

2010-07-23 Thread Zhang, Zhenhua
Hi Matthias, Matthias Günther wrote: > Hi Yang, > >> http://matgnt.wordpress.com/2010/07/19/qt-ofono-d-bus-and-qml-part-1/ >> http://matgnt.wordpress.com/2010/07/19/qt-ofono-d-bus-and-qml-part-2/ >> http://matgnt.wordpress.com/2010/07/19/qt-ofono-d-bus-and-qml-part-3/ > > I h

[PATCH 5/5] emulator: Add emulator atom in oFono

2010-07-23 Thread Zhenhua Zhang
DUN server could create emulator and use GAtServer to talk AT commands to DUN client side. --- Makefile.am|4 +- include/emulator.h | 41 ++ plugins/dun_gw.c |8 +++ src/emulator.c | 121 src/ofono.h

[PATCH 4/5] dun_gw: Add DUN server plugin for oFono

2010-07-23 Thread Zhenhua Zhang
DUN server plug-in watches ofono modem status. When the modem comes to ONLINE state, it registers itself on Bluetooth adapter and want for incoming DUN connection. --- Makefile.am |4 ++ plugins/dun_gw.c | 143 ++ 2 files changed, 147 i

[PATCH 3/5] modem: Add method to get modem by path

2010-07-23 Thread Zhenhua Zhang
Return modem instance by searching modem path. --- include/modem.h |1 + src/modem.c | 15 +++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/include/modem.h b/include/modem.h index e1cd049..34c3fbf 100644 --- a/include/modem.h +++ b/include/modem.h @@ -36,6

[PATCH 2/5] bluetooth: Add bluetooth server support for DUN

2010-07-23 Thread Zhenhua Zhang
It watches Bluetooth adapter property changes and added DUN record to listen client connection request. Btio library is the low level socket API for RFCOMM connection. --- plugins/bluetooth.c | 379 plugins/bluetooth.h | 14 ++ plugins/btio.c | 480

[PATCH 0/5] Add oFono DUN emulator

2010-07-23 Thread Zhenhua Zhang
Hi, These are the updated patches for DUN emulator. First, it listens modem "Online" signal to register itself to bluetooth library. Second, it register DUN record through D-Bus interface. Btio library from Obex is simplified to only keep RFCOMM part. Thanks, Zhenhua __

[PATCH 1/5] bluetooth: Add reference count for bluetooth utils

2010-07-23 Thread Zhenhua Zhang
Add bluetooth_ref()/bluetooth_unref() to support reference count in bluetooth utils. --- plugins/bluetooth.c | 62 +-- 1 files changed, 45 insertions(+), 17 deletions(-) diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c index 5a85eaa..10cc49d