[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Nokia Series 40 comunication protocol
From: |
Daniele Forsi |
Subject: |
Re: Nokia Series 40 comunication protocol |
Date: |
Sat, 26 May 2007 15:29:41 +0200 |
User-agent: |
KMail/1.9.4 |
The Nux wrote:
> I want the user of my program to be able to change phone port or
> model without having to use gnokiirc (and without using gnokiirc myself).
those don't seem good ideas because you need to reinvent the wheel (a way to
read the same information stored in gnokiirc) and you and your users can't
use commandline gnokii for debugging a set of config options
if you decide to go that way you have two options:
1) create a gnokiirc in memory and use gn_cfg_memory_read()
from ./common/cfgreader.c
this will catch syntax errors and some illegal values
or
2) directly set the fields of struct gn_config
see ./include/gnokii/data.h for gn_config
and ./common/cfgreader.c for cfg_psection_load() which is the only example of
setting these fields
you need to check for errors
> I looked at cfgreader.c, but there isn't even comments to explain use
> of most of the functions...
you don't need these functions at all, unless you are reinventing the config
file, in a normal application you are supposed to use the functions
from ./include/gnokii.h where there are more comments;
you would use gn_lib_phoneprofile_load() or
gn_lib_phoneprofile_load_from_file() from ./common/libfunctions.c, their
source lacks comments as well, but this is a reason why gnokii is at version
0.x, not 1.x
patches or suggestions for adding or improving comments (or code) are always
welcome
--
Daniele