From 1c4526b52edc7c245cb76ba801bbbe9da1a3b5ae Mon Sep 17 00:00:00 2001 From: laforge Date: Thu, 16 Aug 2007 05:48:59 +0000 Subject: 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 --- include/gsmd/usock.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'include/gsmd') diff --git a/include/gsmd/usock.h b/include/gsmd/usock.h index f42a766..b60e28e 100644 --- a/include/gsmd/usock.h +++ b/include/gsmd/usock.h @@ -66,7 +66,9 @@ enum gsmd_msg_network { GSMD_NETWORK_VMAIL_GET = 3, GSMD_NETWORK_VMAIL_SET = 4, GSMD_NETWORK_OPER_GET = 5, - GSMD_NETWORK_CIND_GET = 6, + GSMD_NETWORK_OPER_LIST = 6, + GSMD_NETWORK_CIND_GET = 7, + GSMD_NETWORK_DEREGISTER = 8, }; enum gsmd_msg_sms { @@ -358,6 +360,26 @@ struct gsmd_phonebook_support { u_int8_t tlength; } __attribute__ ((packed)); +/* Operator status from 3GPP TS 07.07, Clause 7.3 */ +enum gsmd_oper_status { + GSMD_OPER_UNKNOWN, + GSMD_OPER_AVAILABLE, + GSMD_OPER_CURRENT, + GSMD_OPER_FORBIDDEN, +}; + +/* Theoretically numeric operator code is five digits long but some + * operators apparently use six digit codes. */ +typedef char gsmd_oper_numeric[6]; + +struct gsmd_msg_oper { + enum gsmd_oper_status stat; + int is_last; + char opname_longalpha[16]; + char opname_shortalpha[8]; + gsmd_oper_numeric opname_num; +}; + struct gsmd_msg_hdr { u_int8_t version; u_int8_t msg_type; -- cgit v1.2.3