diff options
author | Gjermund Hodnebrog <gjermund.hodnebrog@stericsson.com> | 2011-05-16 14:04:04 +0200 |
---|---|---|
committer | Sverre Vegge <sverre.vegge@stericsson.com> | 2011-08-03 10:38:05 +0200 |
commit | f68ebd71a39dd455dfe14216794386b2a1af52d1 (patch) | |
tree | 7260cc33102b5dbf13e2a40e2cee6c5e182f19b0 | |
parent | 9818aa969b029ccb4285bcf340d1f4ffda4b0220 (diff) | |
download | u300-f68ebd71a39dd455dfe14216794386b2a1af52d1.tar.gz |
Callhandling: New AT command for DTMF control
AT*EDTMF is introduced to be able to explicitly start and stop
DTMF tones. This replaces the workaround using AT+VTD and AT+VTS.
Signed-off-by: Sverre Vegge <sverre.vegge@stericsson.com>
-rwxr-xr-x | Android.mk | 7 | ||||
-rw-r--r-- | u300-ril-callhandling.c | 11 |
2 files changed, 18 insertions, 0 deletions
@@ -50,6 +50,9 @@ LOCAL_C_INCLUDES := \ # Disable prelink, or add to build/core/prelink-linux-arm.map LOCAL_PRELINK_MODULE := false +# TODO: Remove when AT*EDTMF is merged to modem main track +USE_LEGACY_DTMF_AT_CMDS := true + LOCAL_LDLIBS += -lpthread LOCAL_CFLAGS += -DRIL_SHLIB @@ -95,6 +98,10 @@ ifneq ($(USE_LEGACY_SAT_AT_CMDS),) LOCAL_CFLAGS += -DUSE_LEGACY_SAT_AT_CMDS endif +ifneq ($(USE_LEGACY_DTMF_AT_CMDS),) +LOCAL_CFLAGS += -DUSE_LEGACY_DTMF_AT_CMDS +endif + ifneq ($(USE_EXT1_INSTEAD_OF_EXT5_WHEN_SIM_CARD_IS_2G_TYPE),) LOCAL_CFLAGS += -DUSE_EXT1_INSTEAD_OF_EXT5_WHEN_SIM_CARD_IS_2G_TYPE endif diff --git a/u300-ril-callhandling.c b/u300-ril-callhandling.c index 0a2fa8e..262c332 100644 --- a/u300-ril-callhandling.c +++ b/u300-ril-callhandling.c @@ -1072,6 +1072,7 @@ void requestDTMFStart(void *data, size_t datalen, RIL_Token t) char *cmd = NULL; int err = 0; +#ifdef USE_LEGACY_DTMF_AT_CMDS /* Set duration to maximum, 10000000 n/10 ms = 10000s. */ err = at_send_command("AT+VTD=10000000", &atresponse); if (err < 0 || atresponse->success == 0) @@ -1082,6 +1083,10 @@ void requestDTMFStart(void *data, size_t datalen, RIL_Token t) /* Start the DTMF tone. */ asprintf(&cmd, "AT+VTS=%c", c); +#else + /* Start the DTMF tone. */ + asprintf(&cmd, "AT*EDTMF=1,\"%c\"", c); +#endif err = at_send_command(cmd, &atresponse); if (err < 0 || atresponse->success == 0) goto error; @@ -1112,7 +1117,13 @@ void requestDTMFStop(void *data, size_t datalen, RIL_Token t) int err = 0; ATResponse *atresponse = NULL; + /* Stop the DTMF tone. */ +#ifdef USE_LEGACY_DTMF_AT_CMDS err = at_send_command("AT+VTD=0", &atresponse); +#else + err = at_send_command("AT*EDTMF=0", &atresponse); +#endif + if (err < 0 || atresponse->success == 0) goto error; |