aboutsummaryrefslogtreecommitdiff
path: root/src/mm-serial-port.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-02-18 12:56:24 +0100
committerAleksander Morgado <aleksander@lanedo.com>2013-02-18 13:47:35 +0100
commitbe37f41f06af74280edd3e412c42e2357c180925 (patch)
tree93c48c3c7d156a43584c3f978f1476ceb0b884f8 /src/mm-serial-port.c
parent30639606d35dcc323cb13a29b6e0627aad87dd8d (diff)
at-serial-port: new properties to define and manage a set of init commands
We are now able to specify a list of AT commands to be run whenever the port is opened for the first time (i.e. open_count from 0 to 1). These commands are to be treated as a 'port initialization' sequence, where port-configuration specific AT commands are defined (e.g. ATE0).
Diffstat (limited to 'src/mm-serial-port.c')
-rw-r--r--src/mm-serial-port.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mm-serial-port.c b/src/mm-serial-port.c
index 45e10094..c519ddb8 100644
--- a/src/mm-serial-port.c
+++ b/src/mm-serial-port.c
@@ -947,6 +947,11 @@ mm_serial_port_open (MMSerialPort *self, GError **error)
success:
priv->open_count++;
mm_dbg ("(%s) device open count is %d (open)", device, priv->open_count);
+
+ /* Run additional port config if just opened */
+ if (priv->open_count == 1 && MM_SERIAL_PORT_GET_CLASS (self)->config)
+ MM_SERIAL_PORT_GET_CLASS (self)->config (self);
+
return TRUE;
error: