summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/qmi-service-wds.json22
-rw-r--r--docs/reference/libqmi-glib/libqmi-glib-common.sections10
-rw-r--r--docs/reference/libqmi-glib/libqmi-glib-docs.xml1
-rw-r--r--src/libqmi-glib/qmi-enums-wds.h27
-rw-r--r--src/qmicli/qmicli-wds.c57
5 files changed, 117 insertions, 0 deletions
diff --git a/data/qmi-service-wds.json b/data/qmi-service-wds.json
index be49d66..e303b21 100644
--- a/data/qmi-service-wds.json
+++ b/data/qmi-service-wds.json
@@ -1055,6 +1055,28 @@
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
// *********************************************************************************
+ { "name" : "Get Autoconnect Settings",
+ "type" : "Message",
+ "service" : "WDS",
+ "id" : "0x0034",
+ "version" : "1.12",
+ "output" : [ { "common-ref" : "Operation Result" },
+ { "name" : "Status",
+ "id" : "0x01",
+ "mandatory" : "yes",
+ "type" : "TLV",
+ "format" : "guint8",
+ "public-format" : "QmiWdsAutoconnectSetting",
+ "prerequisites" : [ { "common-ref" : "Success" } ] },
+ { "name" : "Roaming",
+ "id" : "0x10",
+ "mandatory" : "yes",
+ "type" : "TLV",
+ "format" : "guint8",
+ "public-format" : "QmiWdsAutoconnectSettingRoaming",
+ "prerequisites" : [ { "common-ref" : "Success" } ] } ] },
+
+ // *********************************************************************************
{ "name" : "Get Data Bearer Technology",
"type" : "Message",
"service" : "WDS",
diff --git a/docs/reference/libqmi-glib/libqmi-glib-common.sections b/docs/reference/libqmi-glib/libqmi-glib-common.sections
index 5611b95..f5d5619 100644
--- a/docs/reference/libqmi-glib/libqmi-glib-common.sections
+++ b/docs/reference/libqmi-glib/libqmi-glib-common.sections
@@ -439,6 +439,8 @@ QmiWdsSduResidualBitErrorRatio
QmiWdsSduErroneousDelivery
QmiWdsPacketStatisticsMaskFlag
QmiWdsDsProfileError
+QmiWdsAutoconnectSetting
+QmiWdsAutoconnectSettingRoaming
<SUBSECTION Methods>
qmi_wds_ip_family_get_string
qmi_wds_technology_preference_build_string_from_mask
@@ -472,6 +474,8 @@ qmi_wds_sdu_residual_bit_error_ratio_get_string
qmi_wds_sdu_erroneous_delivery_get_string
qmi_wds_packet_statistics_mask_flag_build_string_from_mask
qmi_wds_ds_profile_error_get_string
+qmi_wds_autoconnect_setting_get_string
+qmi_wds_autoconnect_setting_roaming_get_string
<SUBSECTION Private>
qmi_wds_ip_family_build_string_from_mask
qmi_wds_technology_preference_get_string
@@ -504,8 +508,12 @@ qmi_wds_authentication_get_string
qmi_wds_profile_type_build_string_from_mask
qmi_wds_packet_statistics_mask_flag_get_string
qmi_wds_ds_profile_error_build_string_from_mask
+qmi_wds_autoconnect_setting_build_string_from_mask
+qmi_wds_autoconnect_setting_roaming_build_string_from_mask
<SUBSECTION Standard>
QMI_TYPE_WDS_AUTHENTICATION
+QMI_TYPE_WDS_AUTOCONNECT_SETTING
+QMI_TYPE_WDS_AUTOCONNECT_SETTING_ROAMING
QMI_TYPE_WDS_CALL_END_REASON
QMI_TYPE_WDS_CALL_TYPE
QMI_TYPE_WDS_CONNECTION_STATUS
@@ -537,6 +545,8 @@ QMI_TYPE_WDS_SDU_ERRONEOUS_DELIVERY
QMI_TYPE_WDS_SDU_ERROR_RATIO
QMI_TYPE_WDS_SDU_RESIDUAL_BIT_ERROR_RATIO
qmi_wds_authentication_get_type
+qmi_wds_autoconnect_setting_get_type
+qmi_wds_autoconnect_setting_roaming_get_type
qmi_wds_call_end_reason_get_type
qmi_wds_call_type_get_type
qmi_wds_connection_status_get_type
diff --git a/docs/reference/libqmi-glib/libqmi-glib-docs.xml b/docs/reference/libqmi-glib/libqmi-glib-docs.xml
index fa50ecc..0c91360 100644
--- a/docs/reference/libqmi-glib/libqmi-glib-docs.xml
+++ b/docs/reference/libqmi-glib/libqmi-glib-docs.xml
@@ -168,6 +168,7 @@
<xi:include href="xml/qmi-message-wds-get-profile-settings.xml"/>
<xi:include href="xml/qmi-message-wds-get-default-settings.xml"/>
<xi:include href="xml/qmi-message-wds-get-current-settings.xml"/>
+ <xi:include href="xml/qmi-message-wds-get-autoconnect-settings.xml"/>
<xi:include href="xml/qmi-message-wds-get-data-bearer-technology.xml"/>
<xi:include href="xml/qmi-message-wds-get-current-data-bearer-technology.xml"/>
<xi:include href="xml/qmi-message-wds-set-ip-family.xml"/>
diff --git a/src/libqmi-glib/qmi-enums-wds.h b/src/libqmi-glib/qmi-enums-wds.h
index 041b939..26c95f6 100644
--- a/src/libqmi-glib/qmi-enums-wds.h
+++ b/src/libqmi-glib/qmi-enums-wds.h
@@ -18,6 +18,7 @@
* Boston, MA 02110-1301 USA.
*
* Copyright (C) 2012 Lanedo GmbH
+ * Copyright (C) 2015 Velocloud Inc.
* Copyright (C) 2012-2015 Aleksander Morgado <aleksander@aleksander.es>
*/
@@ -1102,4 +1103,30 @@ typedef enum {
QMI_WDS_DS_PROFILE_ERROR_3GPP2_INVALID_PROFILE_ID = 1101,
} QmiWdsDsProfileError;
+/**
+ * QmiWdsAutoconnectSetting:
+ * @QMI_WDS_AUTOCONNECT_SETTING_DISABLED: Disabled.
+ * @QMI_WDS_AUTOCONNECT_SETTING_ENABLED: Enabled.
+ * @QMI_WDS_AUTOCONNECT_SETTING_PAUSED: Paused (resume on power cycle).
+ *
+ * Status of the autoconnect setting.
+ */
+typedef enum {
+ QMI_WDS_AUTOCONNECT_SETTING_DISABLED = 0,
+ QMI_WDS_AUTOCONNECT_SETTING_ENABLED = 1,
+ QMI_WDS_AUTOCONNECT_SETTING_PAUSED = 2,
+} QmiWdsAutoconnectSetting;
+
+/**
+ * QmiWdsAutoconnectSettingRoaming:
+ * @QMI_WDS_AUTOCONNECT_SETTING_ROAMING_ALLOWED: Autoconnect always allowed, even when roaming.
+ * @QMI_WDS_AUTOCONNECT_SETTING_ROAMING_HOME_ONLY: Autoconnect allowed only in home network.
+ *
+ * Status of the autoconnect setting while roaming.
+ */
+typedef enum {
+ QMI_WDS_AUTOCONNECT_SETTING_ROAMING_ALLOWED = 0,
+ QMI_WDS_AUTOCONNECT_SETTING_ROAMING_HOME_ONLY = 1,
+} QmiWdsAutoconnectSettingRoaming;
+
#endif /* _LIBQMI_GLIB_QMI_ENUMS_WDS_H_ */
diff --git a/src/qmicli/qmicli-wds.c b/src/qmicli/qmicli-wds.c
index cba4208..0905160 100644
--- a/src/qmicli/qmicli-wds.c
+++ b/src/qmicli/qmicli-wds.c
@@ -15,6 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
+ * Copyright (C) 2015 Velocloud Inc.
* Copyright (C) 2012-2015 Aleksander Morgado <aleksander@aleksander.es>
*/
@@ -58,6 +59,7 @@ static gboolean get_data_bearer_technology_flag;
static gboolean get_current_data_bearer_technology_flag;
static gchar *get_profile_list_str;
static gchar *get_default_settings_str;
+static gboolean get_autoconnect_settings_flag;
static gboolean get_supported_messages_flag;
static gboolean reset_flag;
static gboolean noop_flag;
@@ -103,6 +105,10 @@ static GOptionEntry entries[] = {
"Get default settings",
"[3gpp|3gpp2]"
},
+ { "wds-get-autoconnect-settings", 0, 0, G_OPTION_ARG_NONE, &get_autoconnect_settings_flag,
+ "Get autoconnect settings",
+ NULL
+ },
{ "wds-get-supported-messages", 0, 0, G_OPTION_ARG_NONE, &get_supported_messages_flag,
"Get supported messages",
NULL
@@ -151,6 +157,7 @@ qmicli_wds_options_enabled (void)
get_current_data_bearer_technology_flag +
!!get_profile_list_str +
!!get_default_settings_str +
+ get_autoconnect_settings_flag +
get_supported_messages_flag +
reset_flag +
noop_flag);
@@ -1005,6 +1012,44 @@ get_default_settings_ready (QmiClientWds *client,
}
static void
+get_autoconnect_settings_ready (QmiClientWds *client,
+ GAsyncResult *res)
+{
+ QmiMessageWdsGetAutoconnectSettingsOutput *output;
+ GError *error = NULL;
+ QmiWdsAutoconnectSetting status;
+ QmiWdsAutoconnectSettingRoaming roaming;
+
+ output = qmi_client_wds_get_autoconnect_settings_finish (client, res, &error);
+ if (!output) {
+ g_printerr ("error: operation failed: %s\n", error->message);
+ g_error_free (error);
+ operation_shutdown (FALSE);
+ return;
+ }
+
+ if (!qmi_message_wds_get_autoconnect_settings_output_get_result (output, &error)) {
+ g_printerr ("error: couldn't get autoconnect settings: %s\n",
+ error->message);
+ g_error_free (error);
+ qmi_message_wds_get_autoconnect_settings_output_unref (output);
+ operation_shutdown (FALSE);
+ return;
+ }
+
+ g_print ("Autoconnect settings retrieved:\n");
+
+ qmi_message_wds_get_autoconnect_settings_output_get_status (output, &status, NULL);
+ g_print ("\tStatus: '%s'\n", qmi_wds_autoconnect_setting_get_string (status));
+
+ if (qmi_message_wds_get_autoconnect_settings_output_get_roaming (output, &roaming, NULL))
+ g_print ("\tRoaming: '%s'\n", qmi_wds_autoconnect_setting_roaming_get_string (roaming));
+
+ qmi_message_wds_get_autoconnect_settings_output_unref (output);
+ operation_shutdown (TRUE);
+}
+
+static void
get_supported_messages_ready (QmiClientWds *client,
GAsyncResult *res)
{
@@ -1311,6 +1356,18 @@ qmicli_wds_run (QmiDevice *device,
return;
}
+ /* Request to print autoconnect settings? */
+ if (get_autoconnect_settings_flag) {
+ g_debug ("Asynchronously getting autoconnect settings...");
+ qmi_client_wds_get_autoconnect_settings (ctx->client,
+ NULL,
+ 10,
+ ctx->cancellable,
+ (GAsyncReadyCallback)get_autoconnect_settings_ready,
+ NULL);
+ return;
+ }
+
/* Request to list supported messages? */
if (get_supported_messages_flag) {
g_debug ("Asynchronously getting supported WDS messages...");