* [PATCH] gatserver: add tone and pulse dialing AT commands
@ 2011-03-28 10:23 Olivier Guiter
2011-03-29 18:55 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: Olivier Guiter @ 2011-03-28 10:23 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2449 bytes --]
---
gatchat/gatserver.c | 38 ++++++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c
index 35f126f..3a996cb 100644
--- a/gatchat/gatserver.c
+++ b/gatchat/gatserver.c
@@ -96,6 +96,7 @@ struct v250_settings {
int c108; /* set by &D<val> */
char l; /* set by L<val> */
char m; /* set by M<val> */
+ char dial_mode; /* set by P or T */
};
/* AT command set that server supported */
@@ -300,6 +301,7 @@ static void v250_settings_create(struct v250_settings *v250)
v250->c108 = 0;
v250->l = 0;
v250->m = 1;
+ v250->dial_mode = 'T';
}
static void s_template_cb(GAtServerRequestType type, GAtResult *result,
@@ -481,6 +483,40 @@ static void at_c108_cb(GAtServer *server, GAtServerRequestType type,
at_template_cb(type, result, server, &server->v250.c108, "&D", 0, 2, 2);
}
+/* According to ITU V.250 6.3.2 and 6.3.3: "Implementation of this command
+ * is mandatory; however, if DTMF or pulse dialling is not implemented,
+ * this command will have no effect"
+ */
+static void at_t_cb(GAtServer *server, GAtServerRequestType type,
+ GAtResult *result, gpointer user_data)
+{
+ switch (type) {
+ case G_AT_SERVER_REQUEST_TYPE_COMMAND_ONLY:
+ server->v250.dial_mode = 'T';
+ g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+ break;
+
+ default:
+ g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
+ break;
+ }
+}
+
+static void at_p_cb(GAtServer *server, GAtServerRequestType type,
+ GAtResult *result, gpointer user_data)
+{
+ switch (type) {
+ case G_AT_SERVER_REQUEST_TYPE_COMMAND_ONLY:
+ server->v250.dial_mode = 'P';
+ g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+ break;
+
+ default:
+ g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
+ break;
+ }
+}
+
static void at_f_cb(GAtServer *server, GAtServerRequestType type,
GAtResult *result, gpointer user_data)
{
@@ -1177,6 +1213,8 @@ static void basic_command_register(GAtServer *server)
g_at_server_register(server, "&F", at_f_cb, NULL, NULL);
g_at_server_register(server, "L", at_l_cb, NULL, NULL);
g_at_server_register(server, "M", at_m_cb, NULL, NULL);
+ g_at_server_register(server, "T", at_t_cb, NULL, NULL);
+ g_at_server_register(server, "P", at_p_cb, NULL, NULL);
}
GAtServer *g_at_server_new(GIOChannel *io)
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gatserver: add tone and pulse dialing AT commands
2011-03-28 10:23 [PATCH] gatserver: add tone and pulse dialing AT commands Olivier Guiter
@ 2011-03-29 18:55 ` Denis Kenzior
0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2011-03-29 18:55 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 252 bytes --]
Hi Olivier,
On 03/28/2011 05:23 AM, Olivier Guiter wrote:
> ---
> gatchat/gatserver.c | 38 ++++++++++++++++++++++++++++++++++++++
> 1 files changed, 38 insertions(+), 0 deletions(-)
>
Patch has been applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-03-29 18:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-28 10:23 [PATCH] gatserver: add tone and pulse dialing AT commands Olivier Guiter
2011-03-29 18:55 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.