aboutsummaryrefslogtreecommitdiff
path: root/src/mm-base-modem-at.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-03-08 12:47:45 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-16 14:53:23 +0100
commitcc6d4a97fb0a11c799f1079c6db86b31db7eadf7 (patch)
treea1b6214fdc960285dcb020f45b132db2598fd3c1 /src/mm-base-modem-at.c
parent48285dcfdf04becbe90922ac3f2dd942bc43de53 (diff)
base-modem: new port getters and peekers
* mm_base_modem_peek_port_* () will return either a port object (no new reference), or NULL if none available. You would usually peek() a port if you're going to use it just in the current method, as there is no way to that reference to get invalid (we're single threaded). * mm_base_modem_get_port_* () will return either NEW references to valid port objects, or NULL if none available. And, you would usually get() a port, whenever you want the port object to be valid even out of the current method, for example when keeping it in the context of an async operation. Also, we need to consider that the primary AT port MAY BE NULL when you peek() or get() it. This is due to the fact that we may be releasing ports (due to device disconnection) in the middle of async operations.
Diffstat (limited to 'src/mm-base-modem-at.c')
-rw-r--r--src/mm-base-modem-at.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mm-base-modem-at.c b/src/mm-base-modem-at.c
index 820063b8..70b4e41f 100644
--- a/src/mm-base-modem-at.c
+++ b/src/mm-base-modem-at.c
@@ -277,7 +277,7 @@ mm_base_modem_at_sequence (MMBaseModem *self,
GError *error = NULL;
/* No port given, so we'll try to guess which is best */
- port = mm_base_modem_get_best_at_port (self, &error);
+ port = mm_base_modem_peek_best_at_port (self, &error);
if (!port) {
g_assert (error != NULL);
g_simple_async_report_take_gerror_in_idle (G_OBJECT (self),
@@ -487,7 +487,7 @@ mm_base_modem_at_command (MMBaseModem *self,
GError *error = NULL;
/* No port given, so we'll try to guess which is best */
- port = mm_base_modem_get_best_at_port (self, &error);
+ port = mm_base_modem_peek_best_at_port (self, &error);
if (!port) {
g_assert (error != NULL);
g_simple_async_report_take_gerror_in_idle (G_OBJECT (self),
@@ -536,7 +536,7 @@ mm_base_modem_at_command_ignore_reply (MMBaseModem *self,
MMAtSerialPort *port;
/* No port given, so we'll try to guess which is best */
- port = mm_base_modem_get_best_at_port (self, NULL);
+ port = mm_base_modem_peek_best_at_port (self, NULL);
if (!port)
/* No valid port, and we ignore replies, so just exit. */
return;