summaryrefslogtreecommitdiff
path: root/include/gsmd
diff options
context:
space:
mode:
authorlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-01-12 23:57:33 +0000
committerlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-01-12 23:57:33 +0000
commita04e6effed0b81ec7495df2a1448484645b20cc5 (patch)
tree6292af769d08022e68cd183358ccc78c6a27238c /include/gsmd
parent496d202f517dbecc1be4e1afc6782c0e3dc48373 (diff)
- use talloc (of samba project) to debug memory allocations and simplify code
- introduce new ucmd_alloc() function - add DTMF support to gsmd, libgsmd and gsmd-util - fix crash of libgsmd when events don't have handlers registered - implement call progress for TI modem - split modem init string in separate commands to fit our parser git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@544 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'include/gsmd')
-rw-r--r--include/gsmd/event.h21
-rw-r--r--include/gsmd/gsmd.h4
-rw-r--r--include/gsmd/usock.h14
3 files changed, 39 insertions, 0 deletions
diff --git a/include/gsmd/event.h b/include/gsmd/event.h
index 6ae4e02..acffba5 100644
--- a/include/gsmd/event.h
+++ b/include/gsmd/event.h
@@ -55,4 +55,25 @@ enum gsmd_netreg_state {
__NUM_GSMD_NETREG
};
+enum gsmd_call_progress {
+ GSMD_CALLPROG_SETUP = 0,
+ GSMD_CALLPROG_DISCONNECT = 1,
+ GSMD_CALLPROG_ALERT = 2,
+ GSMD_CALLPROG_CALL_PROCEED = 3,
+ GSMD_CALLPROG_SYNC = 4,
+ GSMD_CALLPROG_PROGRESS = 5,
+ GSMD_CALLPROG_CONNECTED = 6,
+ GSMD_CALLPROG_RELEASE = 7,
+ GSMD_CALLPROG_REJECT = 8,
+ GSMD_CALLPROG_UNKNOWN = 9,
+ __NUM_GSMD_CALLPROG
+};
+
+enum gsmd_call_direction {
+ GSMD_CALL_DIR_MO = 0, /* Mobile Originated (Outgoing) */
+ GSMD_CALL_DIR_MT = 1, /* Mobile Terminated (Incoming) */
+ GSMD_CALL_DIR_CCBS = 2, /* network initiated MO */
+ GSMD_CALL_DIR_MO_REDIAL = 3, /* Mobile Originated Redial */
+};
+
#endif
diff --git a/include/gsmd/gsmd.h b/include/gsmd/gsmd.h
index 9b99a15..22058b2 100644
--- a/include/gsmd/gsmd.h
+++ b/include/gsmd/gsmd.h
@@ -10,6 +10,8 @@
#include <gsmd/vendorplugin.h>
#include <gsmd/select.h>
+void *gsmd_tallocs;
+
/* Refer to 3GPP TS 07.07 v 7.8.0, Chapter 4.1 */
#define LGSM_ATCMD_F_EXTENDED 0x01 /* as opposed to basic */
#define LGSM_ATCMD_F_PARAM 0x02 /* as opposed to action */
@@ -87,6 +89,8 @@ void __gsmd_log(int level, const char *file, int line, const char *function, con
#define DEBUGP(x, args ...) gsmd_log(GSMD_DEBUG, x, ## args)
+extern int gsmd_simplecmd(struct gsmd *gsmd, char *cmdtxt);
+
#endif /* __GSMD__ */
#endif /* _GSMD_H */
diff --git a/include/gsmd/usock.h b/include/gsmd/usock.h
index 94e8c37..457cc01 100644
--- a/include/gsmd/usock.h
+++ b/include/gsmd/usock.h
@@ -34,6 +34,7 @@ enum gsmd_msg_voicecall_type {
GSMD_VOICECALL_DIAL = 1,
GSMD_VOICECALL_HANGUP = 2,
GSMD_VOICECALL_ANSWER = 3,
+ GSMD_VOICECALL_DTMF = 4,
};
/* Handset / MT related commands */
@@ -66,6 +67,11 @@ struct gsmd_addr {
char number[GSMD_ADDR_MAXLEN+1];
} __attribute__ ((packed));
+struct gsmd_dtmf {
+ u_int8_t len;
+ char dtmf[0];
+} __attribute__ ((packed));
+
struct gsmd_signal_quality {
u_int8_t rssi;
u_int8_t ber;
@@ -105,6 +111,13 @@ struct gsmd_evt_auxdata {
struct {
struct gsmd_signal_quality sigq;
} signal;
+ struct {
+ enum gsmd_call_progress prog;
+ struct gsmd_addr addr;
+ u_int8_t ibt:1,
+ tch:1,
+ dir:2;
+ } call_status;
} u;
} __attribute__((packed));
@@ -134,6 +147,7 @@ struct gsmd_ucmd {
char buf[];
} __attribute__ ((packed));
+extern struct gsmd_ucmd *ucmd_alloc(int extra_size);
extern int usock_init(struct gsmd *g);
extern void usock_cmd_enqueue(struct gsmd_ucmd *ucmd, struct gsmd_user *gu);
extern struct gsmd_ucmd *usock_build_event(u_int8_t type, u_int8_t subtype, u_int8_t len);
personal git repositories of Harald Welte. Your mileage may vary