gsmd patch, was Re: [patch] modify some functions for phonebook

andrzej zaborowski balrogg at
Wed Oct 17 22:09:42 CEST 2007


On 04/10/2007, Koen Kooi <koen at> wrote:
> Hash: SHA1
> Erin Yueh schreef:
> > hi there,
> >
> > i made a patch
> I tried adding all your patches to OE and these apply:
> add_sms_mem_full_evt.patch
> add_voicemail_tag.patch
> fix_read_msg_index.patch
> and these don't:
> add_err_det_inShell.patch
> phonebook_v2.patch
> sms_decode_dcs.patch
> The current OE recipe for gsmd has:
> SRC_URI = "svn://;module=gsm;proto=http \
>            file://024_sms-text-in-bracket.patch;patch=1;minrev=2957 \
>            file://025_sms-status-report.patch;patch=1;minrev=2957 \
>            file://027_phonebook-find-and-read-range-support.patch;patch=1;minrev=2957 \
>            file://028_shell-phonebook-find-and-read-range-support.patch;patch=1;minrev=2957 \
>            file://0001-Introduce-ports.patch;patch=1;minrev=2957 \
> file://0002-Flush-all-pending-commands-before-restarting-the-mod.patch;patch=1;minrev=2957 \
> file://0003-Correctly-segment-incoming-usock-data-into-packets.patch;patch=1;minrev=2957 \
>            file://0004-Handle-read-and-write-return-values.patch;patch=1;minrev=2957 \
>            file://0005-Add-ask-ds-option-forSMS.patch;patch=1;minrev=2957 \
>            file://lgsm_send_fix_return_value.patch;patch=1 \
>            file://gsmd \
>            file://default"
> I want to add:
>            file://add_sms_mem_full_evt.patch;patch=1;pnum=0 \
>            file://add_voicemail_tag.patch;patch=1;pnum=0 \
>            file://fix_read_msg_index.patch;patch=1;pnum=0 \
> Is that reasonable? And could someone please update

I tried to update the patches and apply them to my tree, unfortunately
it meant rewriting them partially. You can clone the tree with

$ cg-clone

and take patches from there, it's currently based on this week's (not
today) svn + the patches from OE, the top patch being Mike Westerhof's
lgsmd_send fix.

> add_err_det_inShell.patch

Commit 14d2219dee1698e94d13d0609e25aca27a1b7962 (I tried to clean the
code formatting a bit but admittedly it is still horribly varied
across every file. Also the input validation introduced in this patch
is not complete and imho not really a priority since libgsmd-tool is a
testing tool)

> phonebook_v2.patch

Skipped because it has all kinds of issues, e.g. commenting out
definitions even ones that are used.

> sms_decode_dcs.patch

Commit 736d7f7dc42516553cc9ab00567980b162f5446d (I think we don't want
to decode and expose *all* of the data in a PDU, for example there are
bits that the GSM specs don't define any interpretation for, leaving
it for future expansion, it will only confuse people writing gsmd
client programs)

> to apply on top of all this? I've given up waiting for patches being applied to svn and
> want to have a full featured gsmd in OE that the openezx hackers can work with.

In addition there are other fixes in this tree that I think are worth applying:

4b30df08754d350b103f1c7af7d5265d8b0926da is a fix for
(bugzilla attachment #355). It should fix bug #906, which depends on

8e4a2c682185ee441c8b3f4a067ffe36a8de7605 is a fix for
(bugzilla attachment #359).

dfdffa502f5dc9b71dc041d61e8e2f94bf14e02e is the bugzilla attachment
#360 (see bug #928).

d2f677230a0d3619c9336c2b60ebdfc123aa1c38 changes a free() to a
talloc_free() in gsmd, the free() caused a glibc abort on my PC (but
not on Neo for some reason).

8f0be827f5da5c62c64e287a0054d9597b00cee8 makes sure no clients can
submit their commands through usock before gsmd executes the commands
from its init sequence. This eliminates a timing issue where
openmoko-dialer commands (e.g. the antenna power-up, register to
network) could sometimes be queued before the AT interpreter was
initialised by gsmd.

I think the proper solution to this is to not fork gsmd into
background before it is actually ready to accept clients, this should
remove all timing problems. Optimally the usock socket would be opened
only after the modem has responded and we have sent the initial
commands to it. I'm happy to implement this and submit a patch, what
does everyone think about this approach?

There were other patches on the list that I have not applied:

Erin Yueh: [patch] handle CMS & CME errors
see the commen about phonebook_v2.patch above.

Erin Yueh: [patch] enable CPHS and retrieve voicemail number from SIM card
I have searched and I couldn't find the documentation for AT%CPMB and
AT%CPHS commands anywhere - what document are they from (please insert
comments like in other places in gsmd, e.g. "Refer to GSM 03.40,
chapter X.Y.Z"). If they are TI Calypso specific they should sit in
the vendor plugin.


More information about the gsmd-devel mailing list