All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] gsmdial: add option for Bluetooth DUN dialing
@ 2011-02-16 21:41 Gustavo F. Padovan
  2011-02-16 21:41 ` [PATCH 2/2] emulator: add dialing support Gustavo F. Padovan
  2011-02-16 21:55 ` [PATCH 1/2] gsmdial: add option for Bluetooth DUN dialing Denis Kenzior
  0 siblings, 2 replies; 5+ messages in thread
From: Gustavo F. Padovan @ 2011-02-16 21:41 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1869 bytes --]

---
 gatchat/gsmdial.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/gatchat/gsmdial.c b/gatchat/gsmdial.c
index 1be80e3..bae5efb 100644
--- a/gatchat/gsmdial.c
+++ b/gatchat/gsmdial.c
@@ -56,6 +56,7 @@ static gboolean option_legacy = FALSE;
 static gchar *option_username = NULL;
 static gchar *option_password = NULL;
 static gchar *option_pppdump = NULL;
+static gboolean option_bluetooth = 0;
 
 static GAtPPP *ppp;
 static GAtChat *control;
@@ -266,6 +267,11 @@ static void no_carrier_notify(GAtResult *result, gpointer user_data)
 {
 	char buf[64];
 
+	if (option_bluetooth) {
+		g_main_loop_quit(event_loop);
+		return;
+	}
+
 	sprintf(buf, "AT+CFUN=%u", option_offmode);
 	g_at_chat_send(control, buf, none_prefix, power_down, NULL, NULL);
 }
@@ -612,6 +618,8 @@ static GOptionEntry options[] = {
 				"Specify CFUN offmode" },
 	{ "legacy", 'l', 0, G_OPTION_ARG_NONE, &option_legacy,
 				"Use ATD*99***<cid>#" },
+	{ "bluetooth", 'b', 0, G_OPTION_ARG_NONE, &option_bluetooth,
+				"Use only ATD*99" },
 	{ "username", 'u', 0, G_OPTION_ARG_STRING, &option_username,
 				"Specify PPP username" },
 	{ "password", 'w', 0, G_OPTION_ARG_STRING, &option_password,
@@ -700,9 +708,14 @@ int main(int argc, char **argv)
 
 	event_loop = g_main_loop_new(NULL, FALSE);
 
-	g_at_chat_send(control, "ATE0Q0V1", NULL, NULL, NULL, NULL);
-	g_at_chat_send(control, "AT+CFUN?", cfun_prefix,
-						check_mode, NULL, NULL);
+	if (option_bluetooth) {
+		g_at_chat_send(control, "ATD*99", none_prefix, connect_cb,
+				NULL, NULL);
+	} else {
+		g_at_chat_send(control, "ATE0Q0V1", NULL, NULL, NULL, NULL);
+		g_at_chat_send(control, "AT+CFUN?", cfun_prefix,
+							check_mode, NULL, NULL);
+	}
 
 	g_main_loop_run(event_loop);
 	g_source_remove(signal_source);
-- 
1.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-02-17 14:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-16 21:41 [PATCH 1/2] gsmdial: add option for Bluetooth DUN dialing Gustavo F. Padovan
2011-02-16 21:41 ` [PATCH 2/2] emulator: add dialing support Gustavo F. Padovan
2011-02-17 13:27   ` Guillaume Zajac
2011-02-17 14:14     ` Gustavo F. Padovan
2011-02-16 21:55 ` [PATCH 1/2] gsmdial: add option for Bluetooth DUN dialing 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.