summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-08-17 08:32:50 +0000
committerlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-08-17 08:32:50 +0000
commitc5eec553984f937b1f1682378ab7096b7f6b3933 (patch)
tree16c7413845e962384ef49191689f9a06567e33cd /include
parent86c7ff07f100489d085efd6541b8c104a44209e0 (diff)
SIM Phonebook access implementation.
This patch adds primitive-but-working support for SIM phonebook access, including phonebook memory storage and entry read/write/delete. Also, libgsmd-tools shell is modified to perform listing actions. API changes: lgsm_pb_read_entryies -> lgsm_pb_read_entries lgsm_pb_list_storage (new): List of supported phonebook memory storage. lgsm_pb_set_storage (new); Select phonebook memory storage. lgsmd_pb_del_entry -> lgsm_pb_del_entry lgsmd_pb_write_entry -> lgsm_pb_write_entry git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@2726 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'include')
-rw-r--r--include/gsmd/usock.h11
-rw-r--r--include/libgsmd/phonebook.h12
2 files changed, 18 insertions, 5 deletions
diff --git a/include/gsmd/usock.h b/include/gsmd/usock.h
index 0f9f05c..3472189 100644
--- a/include/gsmd/usock.h
+++ b/include/gsmd/usock.h
@@ -2,6 +2,7 @@
#define _GSMD_USOCK_H
#include <gsmd/event.h>
+#include <common/linux_list.h>
#define GSMD_UNIX_SOCKET "\0gsmd"
//#define GSMD_UNIX_SOCKET_TYPE SOCK_SEQPACKET
@@ -192,6 +193,8 @@ enum gsmd_msg_phonebook {
GSMD_PHONEBOOK_WRITE = 4,
GSMD_PHONEBOOK_DELETE = 5,
GSMD_PHONEBOOK_GET_SUPPORT = 6,
+ GSMD_PHONEBOOK_LIST_STORAGE = 7,
+ GSMD_PHONEBOOK_SET_STORAGE = 8,
};
/* Type-of-Address, Numbering-Plan-Identification field, GSM 03.40, 9.1.2.5 */
@@ -423,6 +426,7 @@ struct gsmd_phonebook_readrg {
#define GSMD_PB_NUMB_MAXLEN 44
#define GSMD_PB_TEXT_MAXLEN 14
struct gsmd_phonebook {
+ struct llist_head list;
u_int8_t index;
char numb[GSMD_PB_NUMB_MAXLEN+1];
u_int8_t type;
@@ -469,6 +473,11 @@ struct gsmd_msg_prefoper {
char opname_longalpha[16];
};
+struct gsmd_phonebook_storage {
+ struct llist_head list;
+ char storage[3];
+} __attribute__ ((packed));
+
struct gsmd_msg_hdr {
u_int8_t version;
u_int8_t msg_type;
@@ -481,8 +490,6 @@ struct gsmd_msg_hdr {
#ifdef __GSMD__
-#include <common/linux_list.h>
-
#include <gsmd/usock.h>
#include <gsmd/gsmd.h>
diff --git a/include/libgsmd/phonebook.h b/include/libgsmd/phonebook.h
index a08d891..badb76f 100644
--- a/include/libgsmd/phonebook.h
+++ b/include/libgsmd/phonebook.h
@@ -78,6 +78,12 @@ extern int lgsm_pb_get_entry(struct lgsm_handle *lh,
extern int lgsm_pb_set_entry(struct lgsm_handle *lh,
struct lgsm_pb_entry *pb);
+/* List of supported phonebook memory storage */
+extern int lgsm_pb_list_storage(struct lgsm_handle *lh);
+
+/* Select phonebook memory storage */
+extern int lgsm_pb_set_storage(struct lgsm_handle *lh, char *storage);
+
/* Find phonebook entires which alphanumeric filed start
* with string <findtext> */
extern int lgsm_pb_find_entry(struct lgsm_handle *lh,
@@ -87,14 +93,14 @@ extern int lgsm_pb_find_entry(struct lgsm_handle *lh,
extern int lgsm_pb_read_entry(struct lgsm_handle *lh, int index);
/* Read phonebook entries in location number range */
-extern int lgsm_pb_read_entryies(struct lgsm_handle *lh,
+extern int lgsm_pb_read_entries(struct lgsm_handle *lh,
const struct lgsm_phonebook_readrg *pb_readrg);
/* Delete phonebook entry in location index */
-extern int lgsmd_pb_del_entry(struct lgsm_handle *lh, int index);
+extern int lgsm_pb_del_entry(struct lgsm_handle *lh, int index);
/* Write phonebook entry in location */
-extern int lgsmd_pb_write_entry(struct lgsm_handle *lh,
+extern int lgsm_pb_write_entry(struct lgsm_handle *lh,
const struct lgsm_phonebook *pb);
/* Get the location range/nlength/tlength supported */
personal git repositories of Harald Welte. Your mileage may vary