diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-07-11 06:53:56 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-08-06 20:06:46 +0200 |
commit | 9b0f6c83f2e34620c99a7d3b2c945ef92314369a (patch) | |
tree | d803252cbcfbf253c5dbc61dc007d2e68e4501aa /src | |
parent | 89b3c0132879157c16526ae7da1aa3cdefe64fe8 (diff) |
plugin: renamed `custom-init' property to `custom-at-probe'
The `custom-at-probe' property is just to modify the way we check for AT port
support.
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-plugin.c | 22 | ||||
-rw-r--r-- | src/mm-plugin.h | 2 | ||||
-rw-r--r-- | src/mm-port-probe.c | 39 | ||||
-rw-r--r-- | src/mm-port-probe.h | 2 |
4 files changed, 23 insertions, 42 deletions
diff --git a/src/mm-plugin.c b/src/mm-plugin.c index 8970dfc7..e50211bb 100644 --- a/src/mm-plugin.c +++ b/src/mm-plugin.c @@ -60,7 +60,7 @@ struct _MMPluginPrivate { gboolean at; gboolean single_at; gboolean qcdm; - MMPortProbeAtCommand *custom_init; + MMPortProbeAtCommand *custom_at_probe; guint64 send_delay; }; @@ -77,7 +77,7 @@ enum { PROP_ALLOWED_AT, PROP_ALLOWED_SINGLE_AT, PROP_ALLOWED_QCDM, - PROP_CUSTOM_INIT, + PROP_CUSTOM_AT_PROBE, PROP_SEND_DELAY, LAST_PROP }; @@ -524,7 +524,7 @@ mm_plugin_supports_port (MMPlugin *self, mm_port_probe_run (probe, ctx->flags, self->priv->send_delay, - self->priv->custom_init, + self->priv->custom_at_probe, (GAsyncReadyCallback)port_probe_run_ready, ctx); @@ -646,9 +646,9 @@ set_property (GObject *object, /* Construct only */ self->priv->qcdm = g_value_get_boolean (value); break; - case PROP_CUSTOM_INIT: + case PROP_CUSTOM_AT_PROBE: /* Construct only */ - self->priv->custom_init = g_value_dup_boxed (value); + self->priv->custom_at_probe = g_value_dup_boxed (value); break; case PROP_SEND_DELAY: /* Construct only */ @@ -702,8 +702,8 @@ get_property (GObject *object, case PROP_ALLOWED_UDEV_TAGS: g_value_set_boxed (value, self->priv->udev_tags); break; - case PROP_CUSTOM_INIT: - g_value_set_boxed (value, self->priv->custom_init); + case PROP_CUSTOM_AT_PROBE: + g_value_set_boxed (value, self->priv->custom_at_probe); break; case PROP_SEND_DELAY: g_value_set_uint64 (value, self->priv->send_delay); @@ -833,10 +833,10 @@ mm_plugin_class_init (MMPluginClass *klass) G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property - (object_class, PROP_CUSTOM_INIT, - g_param_spec_boxed (MM_PLUGIN_CUSTOM_INIT, - "Custom initialization", - "List of custom initializations this plugin needs, " + (object_class, PROP_CUSTOM_AT_PROBE, + g_param_spec_boxed (MM_PLUGIN_CUSTOM_AT_PROBE, + "Custom AT Probe", + "Custom set of commands to probe for AT support, " "should be an array of MMPortProbeAtCommand structs " "finished with 'NULL'", MM_TYPE_POINTER_ARRAY, diff --git a/src/mm-plugin.h b/src/mm-plugin.h index f7b544df..bba5db26 100644 --- a/src/mm-plugin.h +++ b/src/mm-plugin.h @@ -48,7 +48,7 @@ #define MM_PLUGIN_ALLOWED_AT "allowed-at" #define MM_PLUGIN_ALLOWED_SINGLE_AT "allowed-single-at" #define MM_PLUGIN_ALLOWED_QCDM "allowed-qcdm" -#define MM_PLUGIN_CUSTOM_INIT "custom-init" +#define MM_PLUGIN_CUSTOM_AT_PROBE "custom-at-probe" #define MM_PLUGIN_SEND_DELAY "send-delay" #define MM_PLUGIN_SORT_LAST "sort-last" diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c index 64db79cc..adcf8b87 100644 --- a/src/mm-port-probe.c +++ b/src/mm-port-probe.c @@ -37,7 +37,6 @@ /* * Steps and flow of the Probing process: * ----> AT Serial Open - * |----> Custom Init * |----> AT? * |----> Vendor * |----> Product @@ -69,8 +68,8 @@ typedef struct { guint64 at_send_delay; /* Number of times we tried to open the AT port */ guint at_open_tries; - /* Custom initialization commands for the AT port */ - const MMPortProbeAtCommand *at_custom_init; + /* Custom commands to look for AT support */ + const MMPortProbeAtCommand *at_custom_probe; /* Current group of AT commands to be sent */ const MMPortProbeAtCommand *at_commands; /* Current AT Result processor */ @@ -439,21 +438,6 @@ serial_probe_at_result_processor (MMPortProbe *self, } static void -serial_probe_at_custom_init_result_processor (MMPortProbe *self, - GVariant *result) -{ - PortProbeRunTask *task = self->priv->task; - - /* No result is really expected here, but we could get a boolean to indicate - * AT support */ - if (result) - serial_probe_at_result_processor (self, result); - - /* Reset so that it doesn't get scheduled again */ - task->at_custom_init = NULL; -} - -static void serial_probe_at_parse_response (MMAtSerialPort *port, GString *response, GError *error, @@ -589,18 +573,15 @@ serial_probe_schedule (MMPortProbe *self) task->at_result_processor = NULL; task->at_commands = NULL; - /* If we got some custom initialization commands requested, go on with them - * first. */ - if (task->at_custom_init) { - task->at_result_processor = serial_probe_at_custom_init_result_processor; - task->at_commands = task->at_custom_init; - } /* AT check requested and not already probed? */ - else if ((task->flags & MM_PORT_PROBE_AT) && - !(self->priv->flags & MM_PORT_PROBE_AT)) { + if ((task->flags & MM_PORT_PROBE_AT) && + !(self->priv->flags & MM_PORT_PROBE_AT)) { /* Prepare AT probing */ + if (task->at_custom_probe) + task->at_commands = task->at_custom_probe; + else + task->at_commands = at_probing; task->at_result_processor = serial_probe_at_result_processor; - task->at_commands = at_probing; } /* Vendor requested and not already probed? */ else if ((task->flags & MM_PORT_PROBE_AT_VENDOR) && @@ -851,7 +832,7 @@ void mm_port_probe_run (MMPortProbe *self, MMPortProbeFlag flags, guint64 at_send_delay, - const MMPortProbeAtCommand *at_custom_init, + const MMPortProbeAtCommand *at_custom_probe, GAsyncReadyCallback callback, gpointer user_data) { @@ -869,7 +850,7 @@ mm_port_probe_run (MMPortProbe *self, task = g_new0 (PortProbeRunTask, 1); task->at_send_delay = at_send_delay; task->flags = MM_PORT_PROBE_NONE; - task->at_custom_init = at_custom_init; + task->at_custom_probe = at_custom_probe; task->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, diff --git a/src/mm-port-probe.h b/src/mm-port-probe.h index e952a198..282ce70d 100644 --- a/src/mm-port-probe.h +++ b/src/mm-port-probe.h @@ -78,7 +78,7 @@ void mm_port_probe_set_result_qcdm (MMPortProbe *self, void mm_port_probe_run (MMPortProbe *self, MMPortProbeFlag flags, guint64 at_send_delay, - const MMPortProbeAtCommand *at_custom_init, + const MMPortProbeAtCommand *at_custom_probe, GAsyncReadyCallback callback, gpointer user_data); gboolean mm_port_probe_run_finish (MMPortProbe *self, |