summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2022-02-22 16:13:14 +0100
committerAleksander Morgado <aleksander@aleksander.es>2022-02-26 22:23:32 +0100
commit370d824e2b389321f259a9cdbf6c8bcd6e642691 (patch)
tree6193283f70e717a1e1a727da39bcb561d688a1c7
parentd0ec31c844374b8047e4ecae1e74e45f50c1f7bf (diff)
downloadlibqmi-370d824e2b389321f259a9cdbf6c8bcd6e642691.tar.gz
pdc: skip the need of the QmiConfigTypeAndId intermediate struct
-rw-r--r--data/qmi-service-pdc.json18
-rw-r--r--docs/reference/libqmi-glib/libqmi-glib-common.sections10
-rw-r--r--src/libqmi-glib/qmi-compat.c111
-rw-r--r--src/libqmi-glib/qmi-compat.h176
4 files changed, 304 insertions, 11 deletions
diff --git a/data/qmi-service-pdc.json b/data/qmi-service-pdc.json
index 127e1abc..59d08895 100644
--- a/data/qmi-service-pdc.json
+++ b/data/qmi-service-pdc.json
@@ -32,11 +32,11 @@
// *********************************************************************************
{ "common-ref" : "Config Type And Id",
- "name" : "Type With Id",
- "fullname" : "Qmi Config Type And Id",
+ "name" : "Type With Id v2",
"id" : "0x01",
+ "since" : "1.32",
"type" : "TLV",
- "format" : "struct",
+ "format" : "sequence",
"contents" : [ { "name" : "Config Type",
"format" : "guint32",
"public-format" : "QmiPdcConfigurationType"},
@@ -86,11 +86,9 @@
"service" : "PDC",
"id" : "0x21",
"since" : "1.18",
- "input" : [ { "common-ref" : "Config Type And Id",
- "since" : "1.18" } ],
+ "input" : [ { "common-ref" : "Config Type And Id" } ],
"output" : [ { "common-ref" : "Operation Result" },
- { "common-ref" : "Config Type And Id",
- "since" : "1.18" }] },
+ { "common-ref" : "Config Type And Id" } ] },
// *********************************************************************************
{ "name" : "Get Selected Config",
@@ -134,8 +132,7 @@
"service" : "PDC",
"id" : "0x23",
"since" : "1.18",
- "input" : [ { "common-ref" : "Config Type And Id",
- "since" : "1.18" },
+ "input" : [ { "common-ref" : "Config Type And Id" },
{ "common-ref" : "Token",
"since" : "1.18" }],
"output" : [ { "common-ref" : "Operation Result" },
@@ -300,8 +297,7 @@
"service" : "PDC",
"id" : "0x28",
"since" : "1.18",
- "input" : [ { "common-ref" : "Config Type And Id",
- "since" : "1.18" },
+ "input" : [ { "common-ref" : "Config Type And Id" },
{ "common-ref" : "Token",
"since" : "1.18" }],
"output" : [ { "common-ref" : "Operation Result" } ] },
diff --git a/docs/reference/libqmi-glib/libqmi-glib-common.sections b/docs/reference/libqmi-glib/libqmi-glib-common.sections
index 97436d52..936243b8 100644
--- a/docs/reference/libqmi-glib/libqmi-glib-common.sections
+++ b/docs/reference/libqmi-glib/libqmi-glib-common.sections
@@ -1842,6 +1842,15 @@ qmi_message_wds_set_default_profile_num_output_get_extended_error_code
qmi_message_wds_set_default_profile_num_output_get_result
qmi_message_wds_set_default_profile_num_output_ref
qmi_message_wds_set_default_profile_num_output_unref
+<SUBSECTION QmiConfigTypeAndId>
+QmiConfigTypeAndId
+qmi_message_pdc_config_change_input_get_type_with_id
+qmi_message_pdc_config_change_input_set_type_with_id
+qmi_message_pdc_config_change_output_get_type_with_id
+qmi_message_pdc_set_selected_config_input_get_type_with_id
+qmi_message_pdc_set_selected_config_input_set_type_with_id
+qmi_message_pdc_get_config_info_input_get_type_with_id
+qmi_message_pdc_get_config_info_input_set_type_with_id
<SUBSECTION Private>
QmiDeprecatedNasSimRejectState
QmiDeprecatedWdsCdmaCauseCode
@@ -1857,6 +1866,7 @@ QmiDeprecatedMessageWdsGetDefaultProfileNumInput
QmiDeprecatedMessageWdsGetDefaultProfileNumOutput
QmiDeprecatedMessageWdsSetDefaultProfileNumInput
QmiDeprecatedMessageWdsSetDefaultProfileNumOutput
+QmiDeprecatedConfigTypeAndId
QMI_TYPE_DMS_DELL_FIRMWARE_VERSION_TYPE
QMI_TYPE_MESSAGE_DMS_DELL_GET_FIRMWARE_VERSION_INPUT
QMI_TYPE_MESSAGE_DMS_DELL_GET_FIRMWARE_VERSION_OUTPUT
diff --git a/src/libqmi-glib/qmi-compat.c b/src/libqmi-glib/qmi-compat.c
index e10c29e5..8854033c 100644
--- a/src/libqmi-glib/qmi-compat.c
+++ b/src/libqmi-glib/qmi-compat.c
@@ -2123,4 +2123,115 @@ qmi_message_nas_set_system_selection_preference_input_get_mnc_pds_digit_include_
#endif /* HAVE_QMI_MESSAGE_NAS_SET_SYSTEM_SELECTION_PREFERENCE */
+#if defined HAVE_QMI_MESSAGE_PDC_CONFIG_CHANGE
+
+gboolean
+qmi_message_pdc_config_change_input_get_type_with_id (
+ QmiMessagePdcConfigChangeInput *self,
+ QmiDeprecatedConfigTypeAndId *value_type_with_id,
+ GError **error)
+{
+ QmiPdcConfigurationType config_type = QMI_PDC_CONFIGURATION_TYPE_PLATFORM;
+ GArray *id = NULL;
+
+ if (!qmi_message_pdc_config_change_input_get_type_with_id_v2 (self, &config_type, &id, error))
+ return FALSE;
+ if (value_type_with_id) {
+ value_type_with_id->config_type = config_type;
+ value_type_with_id->id = id;
+ }
+ return TRUE;
+}
+
+gboolean
+qmi_message_pdc_config_change_input_set_type_with_id (
+ QmiMessagePdcConfigChangeInput *self,
+ const QmiDeprecatedConfigTypeAndId *value_type_with_id,
+ GError **error)
+{
+ return qmi_message_pdc_config_change_input_set_type_with_id_v2 (self, value_type_with_id->config_type, value_type_with_id->id, error);
+}
+
+gboolean
+qmi_message_pdc_config_change_output_get_type_with_id (
+ QmiMessagePdcConfigChangeOutput *self,
+ QmiDeprecatedConfigTypeAndId *value_type_with_id,
+ GError **error)
+{
+ QmiPdcConfigurationType config_type = QMI_PDC_CONFIGURATION_TYPE_PLATFORM;
+ GArray *id = NULL;
+
+ if (!qmi_message_pdc_config_change_output_get_type_with_id_v2 (self, &config_type, &id, error))
+ return FALSE;
+ if (value_type_with_id) {
+ value_type_with_id->config_type = config_type;
+ value_type_with_id->id = id;
+ }
+ return TRUE;
+}
+
+#endif /* HAVE_QMI_MESSAGE_PDC_CONFIG_CHANGE */
+
+#if defined HAVE_QMI_MESSAGE_PDC_SET_SELECTED_CONFIG
+
+gboolean
+qmi_message_pdc_set_selected_config_input_get_type_with_id (
+ QmiMessagePdcSetSelectedConfigInput *self,
+ QmiDeprecatedConfigTypeAndId *value_type_with_id,
+ GError **error)
+{
+ QmiPdcConfigurationType config_type = QMI_PDC_CONFIGURATION_TYPE_PLATFORM;
+ GArray *id = NULL;
+
+ if (!qmi_message_pdc_set_selected_config_input_get_type_with_id_v2 (self, &config_type, &id, error))
+ return FALSE;
+ if (value_type_with_id) {
+ value_type_with_id->config_type = config_type;
+ value_type_with_id->id = id;
+ }
+ return TRUE;
+}
+
+gboolean
+qmi_message_pdc_set_selected_config_input_set_type_with_id (
+ QmiMessagePdcSetSelectedConfigInput *self,
+ const QmiDeprecatedConfigTypeAndId *value_type_with_id,
+ GError **error)
+{
+ return qmi_message_pdc_set_selected_config_input_set_type_with_id_v2 (self, value_type_with_id->config_type, value_type_with_id->id, error);
+}
+
+#endif /* HAVE_QMI_MESSAGE_PDC_SET_SELECTED_CONFIG */
+
+#if defined HAVE_QMI_MESSAGE_PDC_GET_CONFIG_INFO
+
+gboolean
+qmi_message_pdc_get_config_info_input_get_type_with_id (
+ QmiMessagePdcGetConfigInfoInput *self,
+ QmiDeprecatedConfigTypeAndId *value_type_with_id,
+ GError **error)
+{
+ QmiPdcConfigurationType config_type = QMI_PDC_CONFIGURATION_TYPE_PLATFORM;
+ GArray *id = NULL;
+
+ if (!qmi_message_pdc_get_config_info_input_get_type_with_id_v2 (self, &config_type, &id, error))
+ return FALSE;
+ if (value_type_with_id) {
+ value_type_with_id->config_type = config_type;
+ value_type_with_id->id = id;
+ }
+ return TRUE;
+}
+
+gboolean
+qmi_message_pdc_get_config_info_input_set_type_with_id (
+ QmiMessagePdcGetConfigInfoInput *self,
+ const QmiDeprecatedConfigTypeAndId *value_type_with_id,
+ GError **error)
+{
+ return qmi_message_pdc_get_config_info_input_set_type_with_id_v2 (self, value_type_with_id->config_type, value_type_with_id->id, error);
+}
+
+#endif /* HAVE_QMI_MESSAGE_PDC_GET_CONFIG_INFO */
+
#endif /* QMI_DISABLE_DEPRECATED */
diff --git a/src/libqmi-glib/qmi-compat.h b/src/libqmi-glib/qmi-compat.h
index 0a08ae2a..7b6933e7 100644
--- a/src/libqmi-glib/qmi-compat.h
+++ b/src/libqmi-glib/qmi-compat.h
@@ -34,8 +34,10 @@
#include "qmi-uim.h"
#include "qmi-wda.h"
#include "qmi-wds.h"
+#include "qmi-pdc.h"
#include "qmi-enums-nas.h"
#include "qmi-enums-wms.h"
+#include "qmi-enums-pdc.h"
/**
* SECTION:qmi-compat
@@ -3409,6 +3411,180 @@ gboolean qmi_message_nas_set_system_selection_preference_input_get_mnc_pds_digit
#endif /* HAVE_QMI_MESSAGE_NAS_SET_SYSTEM_SELECTION_PREFERENCE */
+#if defined HAVE_QMI_MESSAGE_PDC_CONFIG_CHANGE || \
+ defined HAVE_QMI_MESSAGE_PDC_SET_SELECTED_CONFIG || \
+ defined HAVE_QMI_MESSAGE_PDC_GET_CONFIG_INFO
+
+/**
+ * QmiConfigTypeAndId:
+ * @config_type: a #QmiPdcConfigurationType.
+ * @id: a #GArray of #guint8 elements.
+ *
+ * A QmiConfigTypeAndId struct.
+ *
+ * This type is deprecated and there is no replacement as the
+ * new methods don't require any intermediate type any more.
+ *
+ * Since: 1.18
+ * Deprecated: 1.32
+ */
+typedef struct _QmiDeprecatedConfigTypeAndId {
+ QmiPdcConfigurationType config_type;
+ GArray *id;
+} QmiDeprecatedConfigTypeAndId;
+G_DEPRECATED
+typedef QmiDeprecatedConfigTypeAndId QmiConfigTypeAndId;
+
+#endif /* HAVE_QMI_MESSAGE_PDC_CONFIG_CHANGE
+ * HAVE_QMI_MESSAGE_PDC_SET_SELECTED_CONFIG
+ * HAVE_QMI_MESSAGE_PDC_GET_CONFIG_INFO */
+
+#if defined HAVE_QMI_MESSAGE_PDC_CONFIG_CHANGE
+
+/**
+ * qmi_message_pdc_config_change_input_get_type_with_id:
+ * @self: a #QmiMessagePdcConfigChangeInput.
+ * @value_type_with_id: (out)(optional)(transfer none): a placeholder for the output constant #QmiConfigTypeAndId, or %NULL if not required.
+ * @error: Return location for error or %NULL.
+ *
+ * Get the 'Type With Id' field from @self.
+ *
+ * Returns: (skip): %TRUE if the field is found, %FALSE otherwise.
+ *
+ * Since: 1.18
+ * Deprecated: 1.32: Use qmi_message_pdc_config_change_input_get_type_with_id_v2() instead.
+ */
+G_DEPRECATED_FOR (qmi_message_pdc_config_change_input_get_type_with_id_v2)
+gboolean qmi_message_pdc_config_change_input_get_type_with_id (
+ QmiMessagePdcConfigChangeInput *self,
+ QmiDeprecatedConfigTypeAndId *value_type_with_id,
+ GError **error);
+
+/**
+ * qmi_message_pdc_config_change_input_set_type_with_id:
+ * @self: a #QmiMessagePdcConfigChangeInput.
+ * @value_type_with_id: the address of the #QmiConfigTypeAndId to set.
+ * @error: Return location for error or %NULL.
+ *
+ * Set the 'Type With Id' field in the message.
+ *
+ * Returns: (skip): %TRUE if @value was successfully set, %FALSE otherwise.
+ *
+ * Since: 1.18
+ * Deprecated: 1.32: Use qmi_message_pdc_config_change_input_set_type_with_id_v2() instead.
+ */
+G_DEPRECATED_FOR (qmi_message_pdc_config_change_input_set_type_with_id_v2)
+gboolean qmi_message_pdc_config_change_input_set_type_with_id (
+ QmiMessagePdcConfigChangeInput *self,
+ const QmiDeprecatedConfigTypeAndId *value_type_with_id,
+ GError **error);
+
+/**
+ * qmi_message_pdc_config_change_output_get_type_with_id:
+ * @self: a #QmiMessagePdcConfigChangeOutput.
+ * @value_type_with_id: (out)(optional)(transfer none): a placeholder for the output constant #QmiConfigTypeAndId, or %NULL if not required.
+ * @error: Return location for error or %NULL.
+ *
+ * Get the 'Type With Id' field from @self.
+ *
+ * Returns: (skip): %TRUE if the field is found, %FALSE otherwise.
+ *
+ * Since: 1.18
+ * Deprecated: 1.32: Use qmi_message_pdc_config_change_output_get_type_with_id_v2() instead.
+ */
+G_DEPRECATED_FOR (qmi_message_pdc_config_change_output_get_type_with_id_v2)
+gboolean qmi_message_pdc_config_change_output_get_type_with_id (
+ QmiMessagePdcConfigChangeOutput *self,
+ QmiDeprecatedConfigTypeAndId *value_type_with_id,
+ GError **error);
+
+#endif /* HAVE_QMI_MESSAGE_PDC_CONFIG_CHANGE */
+
+#if defined HAVE_QMI_MESSAGE_PDC_SET_SELECTED_CONFIG
+
+/**
+ * qmi_message_pdc_set_selected_config_input_get_type_with_id:
+ * @self: a #QmiMessagePdcSetSelectedConfigInput.
+ * @value_type_with_id: (out)(optional)(transfer none): a placeholder for the output constant #QmiConfigTypeAndId, or %NULL if not required.
+ * @error: Return location for error or %NULL.
+ *
+ * Get the 'Type With Id' field from @self.
+ *
+ * Returns: (skip): %TRUE if the field is found, %FALSE otherwise.
+ *
+ * Since: 1.18
+ * Deprecated: 1.32: Use qmi_message_pdc_set_selected_config_input_get_type_with_id_v2() instead.
+ */
+G_DEPRECATED_FOR (qmi_message_pdc_set_selected_config_input_get_type_with_id_v2)
+gboolean qmi_message_pdc_set_selected_config_input_get_type_with_id (
+ QmiMessagePdcSetSelectedConfigInput *self,
+ QmiDeprecatedConfigTypeAndId *value_type_with_id,
+ GError **error);
+
+
+/**
+ * qmi_message_pdc_set_selected_config_input_set_type_with_id:
+ * @self: a #QmiMessagePdcSetSelectedConfigInput.
+ * @value_type_with_id: the address of the #QmiConfigTypeAndId to set.
+ * @error: Return location for error or %NULL.
+ *
+ * Set the 'Type With Id' field in the message.
+ *
+ * Returns: (skip): %TRUE if @value was successfully set, %FALSE otherwise.
+ *
+ * Since: 1.18
+ * Deprecated: 1.32: Use qmi_message_pdc_set_selected_config_input_set_type_with_id() instead.
+ */
+G_DEPRECATED_FOR (qmi_message_pdc_set_selected_config_input_set_type_with_id_v2)
+gboolean qmi_message_pdc_set_selected_config_input_set_type_with_id (
+ QmiMessagePdcSetSelectedConfigInput *self,
+ const QmiDeprecatedConfigTypeAndId *value_type_with_id,
+ GError **error);
+
+#endif /* HAVE_QMI_MESSAGE_PDC_SET_SELECTED_CONFIG */
+
+#if defined HAVE_QMI_MESSAGE_PDC_GET_CONFIG_INFO
+
+/**
+ * qmi_message_pdc_get_config_info_input_get_type_with_id:
+ * @self: a #QmiMessagePdcGetConfigInfoInput.
+ * @value_type_with_id: (out)(optional)(transfer none): a placeholder for the output constant #QmiConfigTypeAndId, or %NULL if not required.
+ * @error: Return location for error or %NULL.
+ *
+ * Get the 'Type With Id' field from @self.
+ *
+ * Returns: (skip): %TRUE if the field is found, %FALSE otherwise.
+ *
+ * Since: 1.18
+ * Deprecated: 1.32: Use qmi_message_pdc_get_config_info_input_get_type_with_id_v2() instead.
+ */
+G_DEPRECATED_FOR (qmi_message_pdc_get_config_info_input_get_type_with_id_v2)
+gboolean qmi_message_pdc_get_config_info_input_get_type_with_id (
+ QmiMessagePdcGetConfigInfoInput *self,
+ QmiDeprecatedConfigTypeAndId *value_type_with_id,
+ GError **error);
+
+/**
+ * qmi_message_pdc_get_config_info_input_set_type_with_id:
+ * @self: a #QmiMessagePdcGetConfigInfoInput.
+ * @value_type_with_id: the address of the #QmiConfigTypeAndId to set.
+ * @error: Return location for error or %NULL.
+ *
+ * Set the 'Type With Id' field in the message.
+ *
+ * Returns: (skip): %TRUE if @value was successfully set, %FALSE otherwise.
+ *
+ * Since: 1.18
+ * Deprecated: 1.32: Use qmi_message_pdc_get_config_info_input_set_type_with_id_v2() instead.
+ */
+G_DEPRECATED_FOR (qmi_message_pdc_get_config_info_input_set_type_with_id_v2)
+gboolean qmi_message_pdc_get_config_info_input_set_type_with_id (
+ QmiMessagePdcGetConfigInfoInput *self,
+ const QmiDeprecatedConfigTypeAndId *value_type_with_id,
+ GError **error);
+
+#endif /* HAVE_QMI_MESSAGE_PDC_GET_CONFIG_INFO */
+
#endif /* QMI_DISABLE_DEPRECATED */
#endif /* _LIBQMI_GLIB_QMI_COMPAT_H_ */