aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-03-31 11:02:25 +0200
committerAleksander Morgado <aleksander@aleksander.es>2021-03-31 13:55:52 +0200
commit65e860439a1a97c227e49731826d8705cf75496d (patch)
tree9901cabda74c633c16e674e76366844dd57e4953 /test
parent9d6ff2485ad1145bb4239027ed594190e8d4df7b (diff)
mmtty: allow enabling LF with --send-lf
Diffstat (limited to 'test')
-rw-r--r--test/mmtty.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/mmtty.c b/test/mmtty.c
index 398eb22b..818707a4 100644
--- a/test/mmtty.c
+++ b/test/mmtty.c
@@ -42,6 +42,7 @@ static gchar *device_str;
static gboolean no_flash_flag;
static gboolean no_echo_removal_flag;
static gint64 send_delay = -1;
+static gboolean send_lf_flag;
static gboolean verbose_flag;
static gboolean version_flag;
@@ -62,6 +63,10 @@ static GOptionEntry main_entries[] = {
"Send delay for each byte in microseconds (default=1000)",
"[DELAY]"
},
+ { "send-lf", 0, 0, G_OPTION_ARG_NONE, &send_lf_flag,
+ "Send <CR><LF> (default <CR> only)",
+ NULL
+ },
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose_flag,
"Run action with verbose logs",
NULL
@@ -212,6 +217,12 @@ start_cb (void)
g_object_set (port, MM_PORT_SERIAL_AT_REMOVE_ECHO, FALSE, NULL);
}
+ /* Setup LF */
+ if (send_lf_flag) {
+ g_print ("enabling LF...\n");
+ g_object_set (port, MM_PORT_SERIAL_AT_SEND_LF, TRUE, NULL);
+ }
+
/* Set common response parser */
mm_port_serial_at_set_response_parser (MM_PORT_SERIAL_AT (port),
mm_serial_parser_v1_parse,