Method
QmiDevicecommand_abortable
since: 1.24
Declaration [src]
void
qmi_device_command_abortable (
QmiDevice* self,
QmiMessage* message,
QmiMessageContext* message_context,
guint timeout,
QmiDeviceCommandAbortableBuildRequestFn abort_build_request_fn,
QmiDeviceCommandAbortableParseResponseFn abort_parse_response_fn,
gpointer abort_user_data,
GDestroyNotify abort_user_data_free,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
)
Description [src]
Asynchronously sends a QmiMessage to the device.
The message will be processed according to the specific message_context
given.
If the operation is cancelled via cancellable, an abort message will
be sent to the device in order to really abort the ongoing operation. The
qmi_device_command_abortable() method will not finish until either a
successful reply is received from the device or otherwise the command
abortion is confirmed.
If a successful command response arrives before the abort is processed by
the device, the operation will succeed even if cancellable has been set, so
that upper layers can do whatever they need to do to properly tear down the operation.
If an error command reponse arrives before the abort is processed by the device, the operation will fail with the error returned by the device.
The QMI_PROTOCOL_ERROR_ABORTED error will only be returned as a result
of this operation if the command request was truly aborted by the device,
and so, the user of the method should not assume that cancelling the
cancellable will always make the method return a QMI_PROTOCOL_ERROR_ABORTED
error.
The build_request_fn and parse_response_fn callbacks are required in order
to build the abort requests and parse the abort responses, because these
are both service and client specific.
When the operation is finished callback will be called. You can then call
qmi_device_command_abortable_finish() to get the result of the operation.
Available since: 1.24
This method completes asynchronously. Use qmi_device_command_abortable_finish() inside the GAsyncReadyCallback to obtain the result of the operation.
This method is not directly available to language bindings.
Parameters
message-
Type:
QmiMessageThe message to send.
The data is owned by the caller of the method. message_context-
Type:
QmiMessageContextThe context of the message.
The data is owned by the caller of the method. timeout-
Type:
guintMaximum time, in seconds, to wait for the response.
abort_build_request_fn-
Type:
QmiDeviceCommandAbortableBuildRequestFnCallback to build an abort request.
abort_parse_response_fn-
Type:
QmiDeviceCommandAbortableParseResponseFnCallback to parse an abort response.
abort_user_data-
Type:
gpointerUser data to pass to
abort_build_request_fnandabort_parse_response_fn.The argument can be NULL.The data is owned by the caller of the method. abort_user_data_free-
Type:
GDestroyNotifyA
GDestroyNotifyto freeabort_user_data. cancellable-
Type:
GCancellableA
GCancellable, orNULL.The argument can be NULL.The data is owned by the caller of the method. callback-
Type:
GAsyncReadyCallbackA
GAsyncReadyCallbackto call when the operation is finished.The argument can be NULL. user_data-
Type:
gpointerThe data to pass to callback function.
The argument can be NULL.The data is owned by the caller of the method.