From a04e6effed0b81ec7495df2a1448484645b20cc5 Mon Sep 17 00:00:00 2001 From: laforge Date: Fri, 12 Jan 2007 23:57:33 +0000 Subject: - 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 --- include/gsmd/event.h | 21 +++++++++++++++++++++ include/gsmd/gsmd.h | 4 ++++ include/gsmd/usock.h | 14 ++++++++++++++ include/libgsmd/voicecall.h | 3 +++ 4 files changed, 42 insertions(+) (limited to 'include') 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 #include +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); diff --git a/include/libgsmd/voicecall.h b/include/libgsmd/voicecall.h index 4fffe4e..4141283 100644 --- a/include/libgsmd/voicecall.h +++ b/include/libgsmd/voicecall.h @@ -15,4 +15,7 @@ extern int lgsm_voice_in_accept(struct lgsm_handle *lh); /* Terminate outgoing (or incoming) voice call */ extern int lgsm_voice_hangup(struct lgsm_handle *lh); +/* Send DTMF character during voice call */ +extern int lgsm_voice_dtmf(struct lgsm_handle *lh, char dtmf_char); + #endif -- cgit v1.2.3