diff options
author | laforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2007-08-16 05:48:59 +0000 |
---|---|---|
committer | laforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2007-08-16 05:48:59 +0000 |
commit | 1c4526b52edc7c245cb76ba801bbbe9da1a3b5ae (patch) | |
tree | c6cc10078666dd145694d72ec497420593b09889 /src/libgsmd/libgsmd_event.c | |
parent | 929473af86307cb76dcb75183094c56c9fce2939 (diff) |
Operator Selection (Andrzej Zaborowski)
This adds gsmd/libgsmd/libgmsd-tool commands to:
* query available operators,
* register to given operator,
* register automatically (like gsmd did until now),
* deregister,
* get current operator name,
* query signal quality,
* query current connection state (a bit hacky, but it's the only way
I found to satisfy the synchronous prototype in misc.h).
The operator cache is not used as it wouldn't give any benefit here. Retrieving
the list of present operators takes very long but there doesn't seem to exist
any way around it and all other phones I used also take that long.
The libgmsd call for registration to an automatically chosen operator now takes
a parameter of a different type so all libgsmd clients need to be updated (this
patch updates libgsmd-tool already, but not libmokogsmd which is not a part of
gsmd project).
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@2713 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src/libgsmd/libgsmd_event.c')
-rw-r--r-- | src/libgsmd/libgsmd_event.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libgsmd/libgsmd_event.c b/src/libgsmd/libgsmd_event.c index c751cad..777edd8 100644 --- a/src/libgsmd/libgsmd_event.c +++ b/src/libgsmd/libgsmd_event.c @@ -63,6 +63,12 @@ static int evt_demux_msghandler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh gmh->msg_subtype >= __NUM_GSMD_EVT) return -EINVAL; + switch (gmh->msg_subtype) { + case GSMD_EVT_NETREG: + lh->netreg_state = aux->u.netreg.state; + break; + } + if (evt_handlers[gmh->msg_subtype]) return evt_handlers[gmh->msg_subtype](lh, gmh->msg_subtype, aux); else @@ -71,6 +77,7 @@ static int evt_demux_msghandler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh int lgsm_evt_init(struct lgsm_handle *lh) { + lh->netreg_state = LGSM_NETREG_ST_NOTREG; return lgsm_register_handler(lh, GSMD_MSG_EVENT, &evt_demux_msghandler); } |