mbim: use the new response checker helper method
mbim_message_response_get_result() is available in libmbim-glib 1.11.1.
This commit is contained in:
@@ -201,7 +201,7 @@ AC_ARG_WITH(mbim, AS_HELP_STRING([--without-mbim], [Build without MBIM support])
|
|||||||
AM_CONDITIONAL(WITH_MBIM, test "x$with_mbim" = "xyes")
|
AM_CONDITIONAL(WITH_MBIM, test "x$with_mbim" = "xyes")
|
||||||
case $with_mbim in
|
case $with_mbim in
|
||||||
yes)
|
yes)
|
||||||
PKG_CHECK_MODULES(MBIM, [mbim-glib >= 1.10], [have_mbim=yes],[have_mbim=no])
|
PKG_CHECK_MODULES(MBIM, [mbim-glib >= 1.11.1], [have_mbim=yes],[have_mbim=no])
|
||||||
if test "x$have_mbim" = "xno"; then
|
if test "x$have_mbim" = "xno"; then
|
||||||
AC_MSG_ERROR([Couldn't find libmbim-glib. Install it, or otherwise configure using --without-mbim to disable MBIM support.])
|
AC_MSG_ERROR([Couldn't find libmbim-glib. Install it, or otherwise configure using --without-mbim to disable MBIM support.])
|
||||||
else
|
else
|
||||||
|
@@ -182,7 +182,7 @@ ip_configuration_query_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error) &&
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) &&
|
||||||
mbim_message_ip_configuration_response_parse (
|
mbim_message_ip_configuration_response_parse (
|
||||||
response,
|
response,
|
||||||
NULL, /* sessionid */
|
NULL, /* sessionid */
|
||||||
@@ -459,7 +459,7 @@ connect_set_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
(mbim_message_command_done_get_result (response, &error) ||
|
(mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) ||
|
||||||
error->code == MBIM_STATUS_ERROR_FAILURE)) {
|
error->code == MBIM_STATUS_ERROR_FAILURE)) {
|
||||||
GError *inner_error = NULL;
|
GError *inner_error = NULL;
|
||||||
|
|
||||||
@@ -518,7 +518,7 @@ provisioned_contexts_query_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error) &&
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) &&
|
||||||
mbim_message_provisioned_contexts_response_parse (
|
mbim_message_provisioned_contexts_response_parse (
|
||||||
response,
|
response,
|
||||||
&provisioned_contexts_count,
|
&provisioned_contexts_count,
|
||||||
@@ -571,7 +571,7 @@ packet_service_set_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
(mbim_message_command_done_get_result (response, &error) ||
|
(mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) ||
|
||||||
error->code == MBIM_STATUS_ERROR_FAILURE)) {
|
error->code == MBIM_STATUS_ERROR_FAILURE)) {
|
||||||
GError *inner_error = NULL;
|
GError *inner_error = NULL;
|
||||||
|
|
||||||
@@ -977,7 +977,7 @@ disconnect_set_ready (MbimDevice *device,
|
|||||||
GError *inner_error = NULL;
|
GError *inner_error = NULL;
|
||||||
gboolean result = FALSE, parsed_result = FALSE;
|
gboolean result = FALSE, parsed_result = FALSE;
|
||||||
|
|
||||||
result = mbim_message_command_done_get_result (response, &error);
|
result = mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error);
|
||||||
/* Parse the response only for the cases we need to */
|
/* Parse the response only for the cases we need to */
|
||||||
if (result ||
|
if (result ||
|
||||||
g_error_matches (error, MBIM_STATUS_ERROR, MBIM_STATUS_ERROR_FAILURE) ||
|
g_error_matches (error, MBIM_STATUS_ERROR, MBIM_STATUS_ERROR_FAILURE) ||
|
||||||
|
@@ -153,7 +153,7 @@ device_caps_query_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error) &&
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) &&
|
||||||
mbim_message_device_caps_response_parse (
|
mbim_message_device_caps_response_parse (
|
||||||
response,
|
response,
|
||||||
NULL, /* device_type */
|
NULL, /* device_type */
|
||||||
@@ -537,7 +537,7 @@ pin_query_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error) &&
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) &&
|
||||||
mbim_message_pin_response_parse (
|
mbim_message_pin_response_parse (
|
||||||
response,
|
response,
|
||||||
&pin_type,
|
&pin_type,
|
||||||
@@ -582,7 +582,7 @@ unlock_required_subscriber_ready_state_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error) &&
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) &&
|
||||||
mbim_message_subscriber_ready_status_response_parse (
|
mbim_message_subscriber_ready_status_response_parse (
|
||||||
response,
|
response,
|
||||||
&ready_state,
|
&ready_state,
|
||||||
@@ -730,7 +730,7 @@ pin_query_unlock_retries_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error) &&
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) &&
|
||||||
mbim_message_pin_response_parse (
|
mbim_message_pin_response_parse (
|
||||||
response,
|
response,
|
||||||
&pin_type,
|
&pin_type,
|
||||||
@@ -809,7 +809,7 @@ own_numbers_subscriber_ready_state_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error) &&
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) &&
|
||||||
mbim_message_subscriber_ready_status_response_parse (
|
mbim_message_subscriber_ready_status_response_parse (
|
||||||
response,
|
response,
|
||||||
NULL, /* ready_state */
|
NULL, /* ready_state */
|
||||||
@@ -882,7 +882,7 @@ radio_state_query_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error) &&
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) &&
|
||||||
mbim_message_radio_state_response_parse (
|
mbim_message_radio_state_response_parse (
|
||||||
response,
|
response,
|
||||||
&hardware_radio_state,
|
&hardware_radio_state,
|
||||||
@@ -955,7 +955,7 @@ radio_state_set_down_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response)
|
if (response)
|
||||||
mbim_message_command_done_get_result (response, &error);
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error);
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
g_simple_async_result_take_error (simple, error);
|
g_simple_async_result_take_error (simple, error);
|
||||||
@@ -980,7 +980,7 @@ radio_state_set_up_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error) &&
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) &&
|
||||||
mbim_message_radio_state_response_parse (
|
mbim_message_radio_state_response_parse (
|
||||||
response,
|
response,
|
||||||
&hardware_radio_state,
|
&hardware_radio_state,
|
||||||
@@ -1431,7 +1431,7 @@ pin_list_query_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error) &&
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) &&
|
||||||
mbim_message_pin_list_response_parse (
|
mbim_message_pin_list_response_parse (
|
||||||
response,
|
response,
|
||||||
&pin_desc_pin1,
|
&pin_desc_pin1,
|
||||||
@@ -1827,7 +1827,7 @@ alert_sms_read_query_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error) &&
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) &&
|
||||||
mbim_message_sms_read_response_parse (
|
mbim_message_sms_read_response_parse (
|
||||||
response,
|
response,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -2074,7 +2074,7 @@ subscribe_list_set_ready_cb (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response)
|
if (response)
|
||||||
mbim_message_command_done_get_result (response, &error);
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error);
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
g_simple_async_result_take_error (simple, error);
|
g_simple_async_result_take_error (simple, error);
|
||||||
@@ -2334,7 +2334,7 @@ register_state_query_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error) &&
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) &&
|
||||||
mbim_message_register_state_response_parse (
|
mbim_message_register_state_response_parse (
|
||||||
response,
|
response,
|
||||||
NULL, /* nw_error */
|
NULL, /* nw_error */
|
||||||
@@ -2418,7 +2418,7 @@ register_state_set_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error) &&
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) &&
|
||||||
mbim_message_register_state_response_parse (
|
mbim_message_register_state_response_parse (
|
||||||
response,
|
response,
|
||||||
&nw_error,
|
&nw_error,
|
||||||
@@ -2503,7 +2503,7 @@ modem_3gpp_scan_networks_finish (MMIfaceModem3gpp *self,
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
response = (MbimMessage *)g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res));
|
response = (MbimMessage *)g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res));
|
||||||
if (mbim_message_command_done_get_result (response, error) &&
|
if (mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, error) &&
|
||||||
mbim_message_visible_providers_response_parse (response,
|
mbim_message_visible_providers_response_parse (response,
|
||||||
&n_providers,
|
&n_providers,
|
||||||
&providers,
|
&providers,
|
||||||
@@ -2700,7 +2700,7 @@ sms_read_query_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error) &&
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) &&
|
||||||
mbim_message_sms_read_response_parse (
|
mbim_message_sms_read_response_parse (
|
||||||
response,
|
response,
|
||||||
NULL,
|
NULL,
|
||||||
|
@@ -87,7 +87,7 @@ simid_subscriber_ready_state_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error) &&
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) &&
|
||||||
mbim_message_subscriber_ready_status_response_parse (
|
mbim_message_subscriber_ready_status_response_parse (
|
||||||
response,
|
response,
|
||||||
NULL, /* ready_state */
|
NULL, /* ready_state */
|
||||||
@@ -155,7 +155,7 @@ imsi_subscriber_ready_state_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error) &&
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) &&
|
||||||
mbim_message_subscriber_ready_status_response_parse (
|
mbim_message_subscriber_ready_status_response_parse (
|
||||||
response,
|
response,
|
||||||
NULL, /* ready_state */
|
NULL, /* ready_state */
|
||||||
@@ -227,7 +227,7 @@ load_operator_identifier_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error) &&
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) &&
|
||||||
mbim_message_home_provider_response_parse (
|
mbim_message_home_provider_response_parse (
|
||||||
response,
|
response,
|
||||||
&provider,
|
&provider,
|
||||||
@@ -294,7 +294,7 @@ load_operator_name_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error) &&
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) &&
|
||||||
mbim_message_home_provider_response_parse (
|
mbim_message_home_provider_response_parse (
|
||||||
response,
|
response,
|
||||||
&provider,
|
&provider,
|
||||||
@@ -356,7 +356,7 @@ pin_set_enter_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
!mbim_message_command_done_get_result (response, &error)) {
|
!mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error)) {
|
||||||
/* Sending PIN failed, build a better error to report */
|
/* Sending PIN failed, build a better error to report */
|
||||||
if (mbim_message_pin_response_parse (
|
if (mbim_message_pin_response_parse (
|
||||||
response,
|
response,
|
||||||
@@ -448,7 +448,7 @@ puk_set_enter_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
!mbim_message_command_done_get_result (response, &error)) {
|
!mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error)) {
|
||||||
/* Sending PUK failed, build a better error to report */
|
/* Sending PUK failed, build a better error to report */
|
||||||
if (mbim_message_pin_response_parse (
|
if (mbim_message_pin_response_parse (
|
||||||
response,
|
response,
|
||||||
@@ -538,7 +538,7 @@ pin_set_enable_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response) {
|
if (response) {
|
||||||
mbim_message_command_done_get_result (response, &error);
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error);
|
||||||
mbim_message_unref (response);
|
mbim_message_unref (response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -618,7 +618,7 @@ pin_set_change_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response) {
|
if (response) {
|
||||||
mbim_message_command_done_get_result (response, &error);
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error);
|
||||||
mbim_message_unref (response);
|
mbim_message_unref (response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -113,7 +113,7 @@ sms_send_set_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error) &&
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) &&
|
||||||
mbim_message_sms_send_response_parse (
|
mbim_message_sms_send_response_parse (
|
||||||
response,
|
response,
|
||||||
&message_reference,
|
&message_reference,
|
||||||
@@ -248,7 +248,7 @@ sms_delete_set_ready (MbimDevice *device,
|
|||||||
|
|
||||||
response = mbim_device_command_finish (device, res, &error);
|
response = mbim_device_command_finish (device, res, &error);
|
||||||
if (response &&
|
if (response &&
|
||||||
mbim_message_command_done_get_result (response, &error))
|
mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error))
|
||||||
mbim_message_sms_delete_response_parse (response, &error);
|
mbim_message_sms_delete_response_parse (response, &error);
|
||||||
|
|
||||||
if (response)
|
if (response)
|
||||||
|
Reference in New Issue
Block a user