aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mm-qcdm-serial-port.c17
-rw-r--r--src/mm-qcdm-serial-port.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/src/mm-qcdm-serial-port.c b/src/mm-qcdm-serial-port.c
index 1ce27e79..72463fbf 100644
--- a/src/mm-qcdm-serial-port.c
+++ b/src/mm-qcdm-serial-port.c
@@ -196,6 +196,23 @@ mm_qcdm_serial_port_new (const char *name, MMPortType ptype)
NULL));
}
+MMQcdmSerialPort *
+mm_qcdm_serial_port_new_fd (int fd, MMPortType ptype)
+{
+ MMQcdmSerialPort *port;
+ char *name;
+
+ name = g_strdup_printf ("port%d", fd);
+ port = MM_QCDM_SERIAL_PORT (g_object_new (MM_TYPE_QCDM_SERIAL_PORT,
+ MM_PORT_DEVICE, name,
+ MM_PORT_SUBSYS, MM_PORT_SUBSYS_TTY,
+ MM_PORT_TYPE, ptype,
+ MM_SERIAL_PORT_FD, fd,
+ NULL));
+ g_free (name);
+ return port;
+}
+
static void
mm_qcdm_serial_port_init (MMQcdmSerialPort *self)
{
diff --git a/src/mm-qcdm-serial-port.h b/src/mm-qcdm-serial-port.h
index e70e124b..2786ee81 100644
--- a/src/mm-qcdm-serial-port.h
+++ b/src/mm-qcdm-serial-port.h
@@ -50,6 +50,8 @@ GType mm_qcdm_serial_port_get_type (void);
MMQcdmSerialPort *mm_qcdm_serial_port_new (const char *name, MMPortType ptype);
+MMQcdmSerialPort *mm_qcdm_serial_port_new_fd (int fd, MMPortType ptype);
+
void mm_qcdm_serial_port_queue_command (MMQcdmSerialPort *self,
GByteArray *command,
guint32 timeout_seconds,