summaryrefslogtreecommitdiff
path: root/include/libgsmd
diff options
context:
space:
mode:
authorlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2006-10-23 20:28:37 +0000
committerlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2006-10-23 20:28:37 +0000
commitcbffc8d64707828b045b679e8db0269ae362ffcf (patch)
tree9ba71c11b92600548581af9d582a2c1feb18473f /include/libgsmd
parent7fe163099476937a14dd7a0714de542f7f94f665 (diff)
more gsmd/libgsm implementation
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@114 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'include/libgsmd')
-rw-r--r--include/libgsmd/event.h12
-rw-r--r--include/libgsmd/libgsmd.h35
2 files changed, 31 insertions, 16 deletions
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 <gsmd/event.h>
/* 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 <sys/types.h>
#include <errno.h>
+#include <gsmd/usock.h>
+
/* 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
personal git repositories of Harald Welte. Your mileage may vary