[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: howto change gnokii driver on the run

From: Bastien Nocera
Subject: Re: howto change gnokii driver on the run
Date: Sat, 07 Jul 2007 15:33:11 +0100

On Sat, 2007-07-07 at 15:44 +0200, Pawel Kot wrote:
> Hi,
> For the applications using libgnokii it may be important to change the
> driver being used without restarting application and even without user
> manually disconnecting the phone and reconnecting. Here's the
> developers recipe.

Thanks very much for looking into that. I'll send some more patches to
help out :)

> We don't provide a separate function for the switch for various
> reasons. First of all, config provided for gnokii may ba a config file
> or memory based configuration. Moreover you could change any single
> variable from the config. If you would have proposal for such API
> please let me know (with patches preferably).
> It is surprisingly easy what should be done to switch the driver:
> First, close current connection:
> error = gn_lib_phone_close(state);
> Now, prepare new configuration. When you have new configuration in the memory:
> ret = gn_cfg_memory_read(mem);
> When you want to reread config file:
> ret = gn_cfg_file_read(file);
> or
> ret = gn_cfg_read_default();
> You may want just to switch the phone section being used in already
> read config file:
> ret = gn_cfg_phone_load(section, state); /* default section is "global" */
> If you want to change just some key value from the config:
> ret = cfg_set(gn_cfg_info, section, key, value); /* to change the

Nothing seems to use cfg_set (it's a gnokii-internal.h unused function),
and the first parameter is a gn_cfg_header, not a gn_cfg_info. How do I
get that out of the state?

> driver to AT use key = "model", value = "AT" */
> Please note that it will fail when the key is not present in the section.
> We need definitely much improvement in out config API but current
> functions seem to be quite powerful.
> And finally reconnect:
> error = gn_lib_phone_open(state);
> I'll put this howto on gnokii wiki and feel free to comment and extend
> it either here or on wiki.

If I manage to get this working with gnome-phone-manager, I'll make a
patch for gnokii.


Bastien Nocera <address@hidden> 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]