diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2018-10-26 15:44:50 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2018-10-26 22:30:50 +0200 |
commit | ee639201ab51d8bcc6c558e8488070753e6a54d0 (patch) | |
tree | 2e88a5952190790163ec51fc2e0621880549585b | |
parent | a813315ba4d5cacd434ac91894ec2b01d3f5f186 (diff) |
uim: 'Application Identifier' is not a string
The 'Application Identifier' value given in the 'Session Information'
TLVs is not a string, it's a generic byte array, as seen in the "UIM
Get Card Status" output, e.g.:
Card [0]:
Card state: 'present'
UPIN state: 'not-initialized'
UPIN retries: '0'
UPUK retries: '0'
Application [0]:
Application type: 'usim (2)'
Application state: 'ready'
Application ID:
A0:00:00:00:87:10:02:FF:34:FF:07:89:31:2E:30:FF
Personalization state: 'ready'
UPIN replaces PIN1: 'no'
PIN1 state: 'disabled'
PIN1 retries: '3'
PUK1 retries: '10'
PIN2 state: 'enabled-not-verified'
PIN2 retries: '3'
PUK2 retries: '10'
We update the libqmi API to allow setting/getting the TLV with the
correct format, and for that we rename the TLV to just 'Session', and
we flag as deprecated the old TLV format, for which we provide compat
replacements.
-rw-r--r-- | data/qmi-service-uim.json | 93 | ||||
-rw-r--r-- | docs/reference/libqmi-glib/libqmi-glib-common.sections | 14 | ||||
-rw-r--r-- | src/libqmi-glib/qmi-compat.c | 43 | ||||
-rw-r--r-- | src/libqmi-glib/qmi-compat.h | 295 | ||||
-rw-r--r-- | src/qmicli/qmicli-uim.c | 57 |
5 files changed, 418 insertions, 84 deletions
diff --git a/data/qmi-service-uim.json b/data/qmi-service-uim.json index f7037d5..c65941e 100644 --- a/data/qmi-service-uim.json +++ b/data/qmi-service-uim.json @@ -14,6 +14,22 @@ "type" : "Message-ID-Enum" }, // ********************************************************************************* + { "common-ref" : "UIM Session", + "name" : "Session", + "fullname" : "Qmi UIM Session", + "id" : "0x01", + "type" : "TLV", + "since" : "1.22", + "format" : "sequence", + "contents" : [ { "name" : "Session Type", + "format" : "guint8", + "public-format" : "QmiUimSessionType" }, + { "name" : "Application Identifier", + "format" : "array", + "size-prefix-format" : "guint8", + "array-element" : { "format" : "guint8" } } ] }, + + // ********************************************************************************* { "name" : "Reset", "type" : "Message", "service" : "UIM", @@ -46,16 +62,7 @@ "id" : "0x0020", "version" : "1.0", "since" : "1.6", - "input" : [ { "name" : "Session Information", - "id" : "0x01", - "type" : "TLV", - "since" : "1.6", - "format" : "sequence", - "contents" : [ { "name" : "Session Type", - "format" : "guint8", - "public-format" : "QmiUimSessionType" }, - { "name" : "Application Identifier", - "format" : "string" } ] }, + "input" : [ { "common-ref" : "UIM Session" }, { "name" : "File", "id" : "0x02", "type" : "TLV", @@ -125,16 +132,7 @@ "id" : "0x0021", "version" : "1.0", "since" : "1.6", - "input" : [ { "name" : "Session Information", - "id" : "0x01", - "type" : "TLV", - "since" : "1.6", - "format" : "sequence", - "contents" : [ { "name" : "Session Type", - "format" : "guint8", - "public-format" : "QmiUimSessionType" }, - { "name" : "Application Identifier", - "format" : "string" } ] }, + "input" : [ { "common-ref" : "UIM Session" }, { "name" : "File", "id" : "0x02", "type" : "TLV", @@ -204,16 +202,7 @@ "id" : "0x0024", "version" : "1.0", "since" : "1.6", - "input" : [ { "name" : "Session Information", - "id" : "0x01", - "type" : "TLV", - "since" : "1.6", - "format" : "sequence", - "contents" : [ { "name" : "Session Type", - "format" : "guint8", - "public-format" : "QmiUimSessionType" }, - { "name" : "Application Identifier", - "format" : "string" } ] }, + "input" : [ { "common-ref" : "UIM Session" }, { "name" : "File", "id" : "0x02", "type" : "TLV", @@ -304,16 +293,7 @@ "id" : "0x0025", "version" : "1.0", "since" : "1.14", - "input" : [ { "name" : "Session Information", - "id" : "0x01", - "type" : "TLV", - "since" : "1.14", - "format" : "sequence", - "contents" : [ { "name" : "Session Type", - "format" : "guint8", - "public-format" : "QmiUimSessionType" }, - { "name" : "Application Identifier", - "format" : "string" } ] }, + "input" : [ { "common-ref" : "UIM Session" }, { "name" : "Info", "id" : "0x02", "type" : "TLV", @@ -357,16 +337,7 @@ "id" : "0x0026", "version" : "1.0", "since" : "1.14", - "input" : [ { "name" : "Session Information", - "id" : "0x01", - "type" : "TLV", - "since" : "1.14", - "format" : "sequence", - "contents" : [ { "name" : "Session Type", - "format" : "guint8", - "public-format" : "QmiUimSessionType" }, - { "name" : "Application Identifier", - "format" : "string" } ] }, + "input" : [ { "common-ref" : "UIM Session" }, { "name" : "Info", "id" : "0x02", "type" : "TLV", @@ -416,16 +387,7 @@ "id" : "0x0027", "version" : "1.0", "since" : "1.14", - "input" : [ { "name" : "Session Information", - "id" : "0x01", - "type" : "TLV", - "since" : "1.14", - "format" : "sequence", - "contents" : [ { "name" : "Session Type", - "format" : "guint8", - "public-format" : "QmiUimSessionType" }, - { "name" : "Application Identifier", - "format" : "string" } ] }, + "input" : [ { "common-ref" : "UIM Session" }, { "name" : "Info", "id" : "0x02", "type" : "TLV", @@ -477,16 +439,7 @@ "id" : "0x0028", "version" : "1.0", "since" : "1.14", - "input" : [ { "name" : "Session Information", - "id" : "0x01", - "type" : "TLV", - "since" : "1.14", - "format" : "sequence", - "contents" : [ { "name" : "Session Type", - "format" : "guint8", - "public-format" : "QmiUimSessionType" }, - { "name" : "Application Identifier", - "format" : "string" } ] }, + "input" : [ { "common-ref" : "UIM Session" }, { "name" : "Info", "id" : "0x02", "type" : "TLV", diff --git a/docs/reference/libqmi-glib/libqmi-glib-common.sections b/docs/reference/libqmi-glib/libqmi-glib-common.sections index 97e0eda..f64d363 100644 --- a/docs/reference/libqmi-glib/libqmi-glib-common.sections +++ b/docs/reference/libqmi-glib/libqmi-glib-common.sections @@ -1325,6 +1325,20 @@ qmi_message_dms_set_service_programming_code_input_set_new qmi_message_dms_set_service_programming_code_input_get_current qmi_message_dms_set_service_programming_code_input_set_current qmi_message_tlv_read_gfloat +qmi_message_uim_change_pin_input_get_session_information +qmi_message_uim_change_pin_input_set_session_information +qmi_message_uim_get_file_attributes_input_get_session_information +qmi_message_uim_get_file_attributes_input_set_session_information +qmi_message_uim_read_record_input_get_session_information +qmi_message_uim_read_record_input_set_session_information +qmi_message_uim_read_transparent_input_get_session_information +qmi_message_uim_read_transparent_input_set_session_information +qmi_message_uim_set_pin_protection_input_get_session_information +qmi_message_uim_set_pin_protection_input_set_session_information +qmi_message_uim_unblock_pin_input_get_session_information +qmi_message_uim_unblock_pin_input_set_session_information +qmi_message_uim_verify_pin_input_get_session_information +qmi_message_uim_verify_pin_input_set_session_information <SUBSECTION Symbols> QMI_NAS_SIM_REJECT_STATE_SIM_VAILABLE QMI_WDS_CDMA_CAUSE_CODE_NETWORK_ADDRESS_VACANT diff --git a/src/libqmi-glib/qmi-compat.c b/src/libqmi-glib/qmi-compat.c index 9b083be..9afc328 100644 --- a/src/libqmi-glib/qmi-compat.c +++ b/src/libqmi-glib/qmi-compat.c @@ -70,4 +70,47 @@ qmi_message_tlv_read_gfloat (QmiMessage *self, return qmi_message_tlv_read_gfloat_endian (self, tlv_offset, offset, __QMI_ENDIAN_HOST, out, error); } +#define SESSION_INFORMATION_DEPRECATED_METHOD(BUNDLE_SUBSTR,METHOD_SUBSTR) \ + gboolean \ + qmi_message_uim_##METHOD_SUBSTR##_input_get_session_information ( \ + QmiMessageUim##BUNDLE_SUBSTR##Input *self, \ + QmiUimSessionType *value_session_session_type, \ + const gchar **value_session_information_application_identifier, \ + GError **error) \ + { \ + /* just ignore the output string */ \ + return qmi_message_uim_##METHOD_SUBSTR##_input_get_session (self, \ + value_session_session_type, \ + NULL, \ + error); \ + } \ + gboolean \ + qmi_message_uim_##METHOD_SUBSTR##_input_set_session_information ( \ + QmiMessageUim##BUNDLE_SUBSTR##Input *self, \ + QmiUimSessionType value_session_information_session_type, \ + const gchar *value_session_information_application_identifier, \ + GError **error) \ + { \ + GArray *array; \ + gboolean ret; \ + \ + array = g_array_append_vals (g_array_new (FALSE, FALSE, sizeof (guint8)), \ + value_session_information_application_identifier, \ + strlen (value_session_information_application_identifier)); \ + ret = qmi_message_uim_##METHOD_SUBSTR##_input_set_session (self, \ + value_session_information_session_type, \ + array, \ + error); \ + g_array_unref (array); \ + return ret; \ + } + +SESSION_INFORMATION_DEPRECATED_METHOD (ReadTransparent, read_transparent) +SESSION_INFORMATION_DEPRECATED_METHOD (ReadRecord, read_record) +SESSION_INFORMATION_DEPRECATED_METHOD (GetFileAttributes, get_file_attributes) +SESSION_INFORMATION_DEPRECATED_METHOD (SetPinProtection, set_pin_protection) +SESSION_INFORMATION_DEPRECATED_METHOD (VerifyPin, verify_pin) +SESSION_INFORMATION_DEPRECATED_METHOD (UnblockPin, unblock_pin) +SESSION_INFORMATION_DEPRECATED_METHOD (ChangePin, change_pin) + #endif /* QMI_DISABLE_DEPRECATED */ diff --git a/src/libqmi-glib/qmi-compat.h b/src/libqmi-glib/qmi-compat.h index 2a31a4d..4551707 100644 --- a/src/libqmi-glib/qmi-compat.h +++ b/src/libqmi-glib/qmi-compat.h @@ -27,6 +27,7 @@ #endif #include "qmi-dms.h" +#include "qmi-uim.h" #include "qmi-enums-nas.h" #include "qmi-enums-wms.h" @@ -456,6 +457,300 @@ gboolean qmi_message_tlv_read_gfloat (QmiMessage *self, gfloat *out, GError **error); +/** + * qmi_message_uim_read_transparent_input_get_session_information: + * @self: a #QmiMessageUimReadTransparentInput. + * @value_session_information_session_type: a placeholder for the output #QmiUimSessionType, or %NULL if not required. + * @value_session_information_application_identifier: a placeholder for the output constant string, or %NULL if not required. + * @error: Return location for error or %NULL. + * + * Get the 'Session Information' field from @self. + * + * Returns: %TRUE if the field is found, %FALSE otherwise. + * + * Since: 1.6 + * Deprecated: 1.22: Use qmi_message_uim_read_transparent_input_get_session() instead. + */ +G_DEPRECATED_FOR (qmi_message_uim_read_transparent_input_get_session) +gboolean qmi_message_uim_read_transparent_input_get_session_information ( + QmiMessageUimReadTransparentInput *self, + QmiUimSessionType *value_session_information_session_type, + const gchar **value_session_information_application_identifier, + GError **error); + +/** + * qmi_message_uim_read_transparent_input_set_session_information: + * @self: a #QmiMessageUimReadTransparentInput. + * @value_session_information_session_type: a #QmiUimSessionType. + * @value_session_information_application_identifier: a constant string. + * @error: Return location for error or %NULL. + * + * Set the 'Session Information' field in the message. + * + * Returns: %TRUE if @value was successfully set, %FALSE otherwise. + * + * Since: 1.6 + * Deprecated: 1.22: Use qmi_message_uim_read_transparent_input_set_session() instead. + */ +G_DEPRECATED_FOR (qmi_message_uim_read_transparent_input_set_session) +gboolean qmi_message_uim_read_transparent_input_set_session_information ( + QmiMessageUimReadTransparentInput *self, + QmiUimSessionType value_session_information_session_type, + const gchar *value_session_information_application_identifier, + GError **error); + +/** + * qmi_message_uim_read_record_input_get_session_information: + * @self: a #QmiMessageUimReadRecordInput. + * @value_session_information_session_type: a placeholder for the output #QmiUimSessionType, or %NULL if not required. + * @value_session_information_application_identifier: a placeholder for the output constant string, or %NULL if not required. + * @error: Return location for error or %NULL. + * + * Get the 'Session Information' field from @self. + * + * Returns: %TRUE if the field is found, %FALSE otherwise. + * + * Since: 1.6 + * Deprecated: 1.22: Use qmi_message_uim_read_record_input_get_session_information() instead. + */ +G_DEPRECATED_FOR (qmi_message_uim_read_record_input_get_session_information) +gboolean qmi_message_uim_read_record_input_get_session_information ( + QmiMessageUimReadRecordInput *self, + QmiUimSessionType *value_session_information_session_type, + const gchar **value_session_information_application_identifier, + GError **error); + +/** + * qmi_message_uim_read_record_input_set_session_information: + * @self: a #QmiMessageUimReadRecordInput. + * @value_session_information_session_type: a #QmiUimSessionType. + * @value_session_information_application_identifier: a constant string. + * @error: Return location for error or %NULL. + * + * Set the 'Session Information' field in the message. + * + * Returns: %TRUE if @value was successfully set, %FALSE otherwise. + * + * Since: 1.6 + * Deprecated: 1.22: Use qmi_message_uim_read_record_input_set_session() instead. + */ +G_DEPRECATED_FOR (qmi_message_uim_read_record_input_set_session) +gboolean qmi_message_uim_read_record_input_set_session_information ( + QmiMessageUimReadRecordInput *self, + QmiUimSessionType value_session_information_session_type, + const gchar *value_session_information_application_identifier, + GError **error); + +/** + * qmi_message_uim_get_file_attributes_input_get_session_information: + * @self: a #QmiMessageUimGetFileAttributesInput. + * @value_session_information_session_type: a placeholder for the output #QmiUimSessionType, or %NULL if not required. + * @value_session_information_application_identifier: a placeholder for the output constant string, or %NULL if not required. + * @error: Return location for error or %NULL. + * + * Get the 'Session Information' field from @self. + * + * Returns: %TRUE if the field is found, %FALSE otherwise. + * + * Since: 1.6 + * Deprecated: 1.22: Use qmi_message_uim_get_file_attributes_input_get_session() instead. + */ +G_DEPRECATED_FOR (qmi_message_uim_get_file_attributes_input_get_session) +gboolean qmi_message_uim_get_file_attributes_input_get_session_information ( + QmiMessageUimGetFileAttributesInput *self, + QmiUimSessionType *value_session_information_session_type, + const gchar **value_session_information_application_identifier, + GError **error); + +/** + * qmi_message_uim_get_file_attributes_input_set_session_information: + * @self: a #QmiMessageUimGetFileAttributesInput. + * @value_session_information_session_type: a #QmiUimSessionType. + * @value_session_information_application_identifier: a constant string. + * @error: Return location for error or %NULL. + * + * Set the 'Session Information' field in the message. + * + * Returns: %TRUE if @value was successfully set, %FALSE otherwise. + * + * Since: 1.6 + * Deprecated: 1.22: Use qmi_message_uim_get_file_attributes_input_set_session() instead. + */ +G_DEPRECATED_FOR (qmi_message_uim_get_file_attributes_input_set_session) +gboolean qmi_message_uim_get_file_attributes_input_set_session_information ( + QmiMessageUimGetFileAttributesInput *self, + QmiUimSessionType value_session_information_session_type, + const gchar *value_session_information_application_identifier, + GError **error); + +/** + * qmi_message_uim_set_pin_protection_input_get_session_information: + * @self: a #QmiMessageUimSetPinProtectionInput. + * @value_session_information_session_type: a placeholder for the output #QmiUimSessionType, or %NULL if not required. + * @value_session_information_application_identifier: a placeholder for the output constant string, or %NULL if not required. + * @error: Return location for error or %NULL. + * + * Get the 'Session Information' field from @self. + * + * Returns: %TRUE if the field is found, %FALSE otherwise. + * + * Since: 1.14 + * Deprecated: 1.22: Use qmi_message_uim_set_pin_protection_input_get_session() instead. + */ +G_DEPRECATED_FOR (qmi_message_uim_set_pin_protection_input_get_session) +gboolean qmi_message_uim_set_pin_protection_input_get_session_information ( + QmiMessageUimSetPinProtectionInput *self, + QmiUimSessionType *value_session_information_session_type, + const gchar **value_session_information_application_identifier, + GError **error); + +/** + * qmi_message_uim_set_pin_protection_input_set_session_information: + * @self: a #QmiMessageUimSetPinProtectionInput. + * @value_session_information_session_type: a #QmiUimSessionType. + * @value_session_information_application_identifier: a constant string. + * @error: Return location for error or %NULL. + * + * Set the 'Session Information' field in the message. + * + * Returns: %TRUE if @value was successfully set, %FALSE otherwise. + * + * Since: 1.14 + * Deprecated: 1.22: Use qmi_message_uim_set_pin_protection_input_set_session() instead. + */ +G_DEPRECATED_FOR (qmi_message_uim_set_pin_protection_input_set_session) +gboolean qmi_message_uim_set_pin_protection_input_set_session_information ( + QmiMessageUimSetPinProtectionInput *self, + QmiUimSessionType value_session_information_session_type, + const gchar *value_session_information_application_identifier, + GError **error); + +/** + * qmi_message_uim_verify_pin_input_get_session_information: + * @self: a #QmiMessageUimVerifyPinInput. + * @value_session_information_session_type: a placeholder for the output #QmiUimSessionType, or %NULL if not required. + * @value_session_information_application_identifier: a placeholder for the output constant string, or %NULL if not required. + * @error: Return location for error or %NULL. + * + * Get the 'Session Information' field from @self. + * + * Returns: %TRUE if the field is found, %FALSE otherwise. + * + * Since: 1.14 + * Deprecated: 1.22: Use qmi_message_uim_verify_pin_input_get_session() instead. + */ +G_DEPRECATED_FOR (qmi_message_uim_verify_pin_input_get_session) +gboolean qmi_message_uim_verify_pin_input_get_session_information ( + QmiMessageUimVerifyPinInput *self, + QmiUimSessionType *value_session_information_session_type, + const gchar **value_session_information_application_identifier, + GError **error); + +/** + * qmi_message_uim_verify_pin_input_set_session_information: + * @self: a #QmiMessageUimVerifyPinInput. + * @value_session_information_session_type: a #QmiUimSessionType. + * @value_session_information_application_identifier: a constant string. + * @error: Return location for error or %NULL. + * + * Set the 'Session Information' field in the message. + * + * Returns: %TRUE if @value was successfully set, %FALSE otherwise. + * + * Since: 1.14 + * Deprecated: 1.22: Use qmi_message_uim_verify_pin_input_set_session() instead. + */ +G_DEPRECATED_FOR (qmi_message_uim_verify_pin_input_set_session) +gboolean qmi_message_uim_verify_pin_input_set_session_information ( + QmiMessageUimVerifyPinInput *self, + QmiUimSessionType value_session_information_session_type, + const gchar *value_session_information_application_identifier, + GError **error); + +/** + * qmi_message_uim_unblock_pin_input_get_session_information: + * @self: a #QmiMessageUimUnblockPinInput. + * @value_session_information_session_type: a placeholder for the output #QmiUimSessionType, or %NULL if not required. + * @value_session_information_application_identifier: a placeholder for the output constant string, or %NULL if not required. + * @error: Return location for error or %NULL. + * + * Get the 'Session Information' field from @self. + * + * Returns: %TRUE if the field is found, %FALSE otherwise. + * + * Since: 1.14 + * Deprecated: 1.22: Use qmi_message_uim_unblock_pin_input_get_session() instead. + */ +G_DEPRECATED_FOR (qmi_message_uim_unblock_pin_input_get_session) +gboolean qmi_message_uim_unblock_pin_input_get_session_information ( + QmiMessageUimUnblockPinInput *self, + QmiUimSessionType *value_session_information_session_type, + const gchar **value_session_information_application_identifier, + GError **error); + +/** + * qmi_message_uim_unblock_pin_input_set_session_information: + * @self: a #QmiMessageUimUnblockPinInput. + * @value_session_information_session_type: a #QmiUimSessionType. + * @value_session_information_application_identifier: a constant string. + * @error: Return location for error or %NULL. + * + * Set the 'Session Information' field in the message. + * + * Returns: %TRUE if @value was successfully set, %FALSE otherwise. + * + * Since: 1.14 + * Deprecated: 1.22: Use qmi_message_uim_unblock_pin_input_set_session() instead. + */ +G_DEPRECATED_FOR (qmi_message_uim_unblock_pin_input_set_session) +gboolean qmi_message_uim_unblock_pin_input_set_session_information ( + QmiMessageUimUnblockPinInput *self, + QmiUimSessionType value_session_information_session_type, + const gchar *value_session_information_application_identifier, + GError **error); + +/** + * qmi_message_uim_change_pin_input_get_session_information: + * @self: a #QmiMessageUimChangePinInput. + * @value_session_information_session_type: a placeholder for the output #QmiUimSessionType, or %NULL if not required. + * @value_session_information_application_identifier: a placeholder for the output constant string, or %NULL if not required. + * @error: Return location for error or %NULL. + * + * Get the 'Session Information' field from @self. + * + * Returns: %TRUE if the field is found, %FALSE otherwise. + * + * Since: 1.14 + * Deprecated: 1.22: Use qmi_message_uim_change_pin_input_get_session() instead. + */ +G_DEPRECATED_FOR (qmi_message_uim_change_pin_input_get_session) +gboolean qmi_message_uim_change_pin_input_get_session_information ( + QmiMessageUimChangePinInput *self, + QmiUimSessionType *value_session_information_session_type, + const gchar **value_session_information_application_identifier, + GError **error); + +/** + * qmi_message_uim_change_pin_input_set_session_information: + * @self: a #QmiMessageUimChangePinInput. + * @value_session_information_session_type: a #QmiUimSessionType. + * @value_session_information_application_identifier: a constant string. + * @error: Return location for error or %NULL. + * + * Set the 'Session Information' field in the message. + * + * Returns: %TRUE if @value was successfully set, %FALSE otherwise. + * + * Since: 1.14 + * Deprecated: 1.22: Use qmi_message_uim_change_pin_input_set_session() instead. + */ +G_DEPRECATED_FOR (qmi_message_uim_change_pin_input_set_session) +gboolean qmi_message_uim_change_pin_input_set_session_information ( + QmiMessageUimChangePinInput *self, + QmiUimSessionType value_session_information_session_type, + const gchar *value_session_information_application_identifier, + GError **error); + #endif /* QMI_DISABLE_DEPRECATED */ #endif /* _LIBQMI_GLIB_QMI_COMPAT_H_ */ diff --git a/src/qmicli/qmicli-uim.c b/src/qmicli/qmicli-uim.c index 7306a5e..7e29e55 100644 --- a/src/qmicli/qmicli-uim.c +++ b/src/qmicli/qmicli-uim.c @@ -198,6 +198,9 @@ set_pin_protection_input_create (const gchar *str) qmicli_read_enable_disable_from_string (split[1], &enable_disable) && qmicli_read_non_empty_string (split[2], "current PIN", ¤t_pin)) { GError *error = NULL; + GArray *dummy_aid; + + dummy_aid = g_array_new (FALSE, FALSE, sizeof (guint8)); input = qmi_message_uim_set_pin_protection_input_new (); if (!qmi_message_uim_set_pin_protection_input_set_info ( @@ -206,10 +209,10 @@ set_pin_protection_input_create (const gchar *str) enable_disable, current_pin, &error) || - !qmi_message_uim_set_pin_protection_input_set_session_information ( + !qmi_message_uim_set_pin_protection_input_set_session ( input, QMI_UIM_SESSION_TYPE_CARD_SLOT_1, - "", /* ignored */ + dummy_aid, /* ignored */ &error)) { g_printerr ("error: couldn't create input data bundle: '%s'\n", error->message); @@ -217,6 +220,7 @@ set_pin_protection_input_create (const gchar *str) qmi_message_uim_set_pin_protection_input_unref (input); input = NULL; } + g_array_unref (dummy_aid); } g_strfreev (split); @@ -286,6 +290,9 @@ verify_pin_input_create (const gchar *str) if (qmicli_read_uim_pin_id_from_string (split[0], &pin_id) && qmicli_read_non_empty_string (split[1], "current PIN", ¤t_pin)) { GError *error = NULL; + GArray *dummy_aid; + + dummy_aid = g_array_new (FALSE, FALSE, sizeof (guint8)); input = qmi_message_uim_verify_pin_input_new (); if (!qmi_message_uim_verify_pin_input_set_info ( @@ -293,10 +300,10 @@ verify_pin_input_create (const gchar *str) pin_id, current_pin, &error) || - !qmi_message_uim_verify_pin_input_set_session_information ( + !qmi_message_uim_verify_pin_input_set_session ( input, QMI_UIM_SESSION_TYPE_CARD_SLOT_1, - "", /* ignored */ + dummy_aid, /* ignored */ &error)) { g_printerr ("error: couldn't create input data bundle: '%s'\n", error->message); @@ -304,6 +311,7 @@ verify_pin_input_create (const gchar *str) qmi_message_uim_verify_pin_input_unref (input); input = NULL; } + g_array_unref (dummy_aid); } g_strfreev (split); @@ -375,6 +383,9 @@ unblock_pin_input_create (const gchar *str) qmicli_read_non_empty_string (split[1], "PUK", &puk) && qmicli_read_non_empty_string (split[2], "new PIN", &new_pin)) { GError *error = NULL; + GArray *dummy_aid; + + dummy_aid = g_array_new (FALSE, FALSE, sizeof (guint8)); input = qmi_message_uim_unblock_pin_input_new (); if (!qmi_message_uim_unblock_pin_input_set_info ( @@ -383,10 +394,10 @@ unblock_pin_input_create (const gchar *str) puk, new_pin, &error) || - !qmi_message_uim_unblock_pin_input_set_session_information ( + !qmi_message_uim_unblock_pin_input_set_session ( input, QMI_UIM_SESSION_TYPE_CARD_SLOT_1, - "", /* ignored */ + dummy_aid, /* ignored */ &error)) { g_printerr ("error: couldn't create input data bundle: '%s'\n", error->message); @@ -394,6 +405,7 @@ unblock_pin_input_create (const gchar *str) qmi_message_uim_unblock_pin_input_unref (input); input = NULL; } + g_array_unref (dummy_aid); } g_strfreev (split); @@ -465,6 +477,9 @@ change_pin_input_create (const gchar *str) qmicli_read_non_empty_string (split[1], "old PIN", &old_pin) && qmicli_read_non_empty_string (split[2], "new PIN", &new_pin)) { GError *error = NULL; + GArray *dummy_aid; + + dummy_aid = g_array_new (FALSE, FALSE, sizeof (guint8)); input = qmi_message_uim_change_pin_input_new (); if (!qmi_message_uim_change_pin_input_set_info ( @@ -473,10 +488,10 @@ change_pin_input_create (const gchar *str) old_pin, new_pin, &error) || - !qmi_message_uim_change_pin_input_set_session_information ( + !qmi_message_uim_change_pin_input_set_session ( input, QMI_UIM_SESSION_TYPE_CARD_SLOT_1, - "", /* ignored */ + dummy_aid, /* ignored */ &error)) { g_printerr ("error: couldn't create input data bundle: '%s'\n", error->message); @@ -484,6 +499,7 @@ change_pin_input_create (const gchar *str) qmi_message_uim_change_pin_input_unref (input); input = NULL; } + g_array_unref (dummy_aid); } g_strfreev (split); @@ -1007,15 +1023,18 @@ read_transparent_build_input (const gchar *file_path_str) QmiMessageUimReadTransparentInput *input; guint16 file_id = 0; GArray *file_path = NULL; + GArray *dummy_aid; if (!get_sim_file_id_and_path (file_path_str, &file_id, &file_path)) return NULL; + dummy_aid = g_array_new (FALSE, FALSE, sizeof (guint8)); + input = qmi_message_uim_read_transparent_input_new (); - qmi_message_uim_read_transparent_input_set_session_information ( + qmi_message_uim_read_transparent_input_set_session ( input, QMI_UIM_SESSION_TYPE_PRIMARY_GW_PROVISIONING, - "", + dummy_aid, /* ignored */ NULL); qmi_message_uim_read_transparent_input_set_file ( input, @@ -1024,6 +1043,7 @@ read_transparent_build_input (const gchar *file_path_str) NULL); qmi_message_uim_read_transparent_input_set_read_information (input, 0, 0, NULL); g_array_unref (file_path); + g_array_unref (dummy_aid); return input; } @@ -1157,6 +1177,7 @@ read_record_input_create (const gchar *str) }; guint16 file_id = 0; GArray *file_path = NULL; + GArray *dummy_aid; if (!qmicli_parse_key_value_string (str, &error, @@ -1172,12 +1193,14 @@ read_record_input_create (const gchar *str) if (!get_sim_file_id_and_path_with_separator (props.file, &file_id, &file_path, "-")) goto out; + dummy_aid = g_array_new (FALSE, FALSE, sizeof (guint8)); + input = qmi_message_uim_read_record_input_new (); - qmi_message_uim_read_record_input_set_session_information ( + qmi_message_uim_read_record_input_set_session ( input, QMI_UIM_SESSION_TYPE_PRIMARY_GW_PROVISIONING, - "", + dummy_aid, /* ignored */ NULL); qmi_message_uim_read_record_input_set_file ( input, @@ -1190,6 +1213,8 @@ read_record_input_create (const gchar *str) props.record_length, NULL); + g_array_unref (dummy_aid); + out: free (props.file); g_array_unref (file_path); @@ -1345,21 +1370,25 @@ get_file_attributes_build_input (const gchar *file_path_str) QmiMessageUimGetFileAttributesInput *input; guint16 file_id = 0; GArray *file_path = NULL; + GArray *dummy_aid; if (!get_sim_file_id_and_path (file_path_str, &file_id, &file_path)) return NULL; + dummy_aid = g_array_new (FALSE, FALSE, sizeof (guint8)); + input = qmi_message_uim_get_file_attributes_input_new (); - qmi_message_uim_get_file_attributes_input_set_session_information ( + qmi_message_uim_get_file_attributes_input_set_session ( input, QMI_UIM_SESSION_TYPE_PRIMARY_GW_PROVISIONING, - "", + dummy_aid, /* ignored */ NULL); qmi_message_uim_get_file_attributes_input_set_file ( input, file_id, file_path, NULL); + g_array_unref (dummy_aid); g_array_unref (file_path); return input; } |