From cbffc8d64707828b045b679e8db0269ae362ffcf Mon Sep 17 00:00:00 2001 From: laforge Date: Mon, 23 Oct 2006 20:28:37 +0000 Subject: more gsmd/libgsm implementation git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@114 99fdad57-331a-0410-800a-d7fa5415bdb3 --- include/libgsmd/event.h | 12 ++++++++---- include/libgsmd/libgsmd.h | 35 +++++++++++++++++++++++------------ 2 files changed, 31 insertions(+), 16 deletions(-) (limited to 'include/libgsmd') diff --git a/include/libgsmd/event.h b/include/libgsmd/event.h index d7faa9b..e1338f7 100644 --- a/include/libgsmd/event.h +++ b/include/libgsmd/event.h @@ -4,11 +4,15 @@ #include /* Prototype of libgsmd callback handler function */ -typedef int evt_cb_func(struct lgsm_handle *lh, enum gsmd_events evt, - void *user); +typedef int lgsm_evt_handler(struct lgsm_handle *lh, int evt_type, struct gsmd_evt_auxdata *aux); /* Register an event callback handler with libgsmd */ -extern int lgsm_register_evt_cb(struct lgsm_handle *lh, - evt_cb_func *cb, void *user); +extern int lgsm_evt_handler_register(struct lgsm_handle *lh, int evt_type, + lgsm_evt_handler *handler); +extern void lgsm_evt_handler_unregister(struct lgsm_handle *lh, int evt_type); + +extern int lgsm_evt_init(struct lgsm_handle *lh); +extern void lgsm_evt_exit(struct lgsm_handle *lh); + #endif diff --git a/include/libgsmd/libgsmd.h b/include/libgsmd/libgsmd.h index 7ce1a83..a89f4b6 100644 --- a/include/libgsmd/libgsmd.h +++ b/include/libgsmd/libgsmd.h @@ -9,6 +9,8 @@ #include #include +#include + /* Generic Information * * Return value: @@ -28,17 +30,6 @@ /* Opaque data structure, content only known to libgsm implementation */ struct lgsm_handle; -#define LGSMD_DEVICE_GSMD "gsmd" - -/* initialize usage of libgsmd, obtain handle for othe API calls */ -extern struct lgsm_handle *lgsm_init(const char *device); - -/* Terminate usage of libgsmd */ -extern int lgsm_exit(struct lgsm_handle *lh); - -/* Obtain file descriptor (e.g. for select-loop under app control) */ -extern int lgsm_fd(struct lgsm_handle *lh); - /* Refer to GSM 04.08 [8] subclause 10.5.4.7 */ enum lgsm_addr_type { LGSM_ATYPE_ISDN_UNKN = 161, @@ -48,9 +39,29 @@ enum lgsm_addr_type { #define LGSM_ADDR_MAXLEN 31 struct lgsm_addr { + enum lgsm_addr_type type; char addr[LGSM_ADDR_MAXLEN+1]; - enum lgsm_addr_type tyoe; }; +typedef int lgsm_msg_handler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh); + +#define LGSMD_DEVICE_GSMD "gsmd" + +/* initialize usage of libgsmd, obtain handle for othe API calls */ +extern struct lgsm_handle *lgsm_init(const char *device); + +/* Terminate usage of libgsmd */ +extern int lgsm_exit(struct lgsm_handle *lh); + +/* Obtain file descriptor (e.g. for select-loop under app control) */ +extern int lgsm_fd(struct lgsm_handle *lh); + +extern int lgsm_register_handler(struct lgsm_handle *lh, int type, lgsm_msg_handler *handler); +extern void lgsm_unregister_handler(struct lgsm_handle *lh, int type); + +extern int lgsm_passthrough_send(struct lgsm_handle *lh, const char *tx); extern int lgsm_passthrough(struct lgsm_handle *lh, const char *tx, char *rx, unsigned int *rx_len); +extern int lgsm_subscriptions(struct lgsm_handle *lh, u_int32_t subscriptions); + +extern int lgsm_pin(struct lgsm_handle *lh, char *pin); #endif -- cgit v1.2.3