broadband-modem-qmi: request NMEA trace indications
This commit is contained in:
@@ -5833,11 +5833,50 @@ enable_location_gathering_finish (MMIfaceModemLocation *self,
|
|||||||
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ser_location_ready (QmiClientPds *client,
|
||||||
|
GAsyncResult *res,
|
||||||
|
EnableLocationGatheringContext *ctx)
|
||||||
|
{
|
||||||
|
QmiMessagePdsSetEventReportOutput *output = NULL;
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
|
output = qmi_client_pds_set_event_report_finish (client, res, &error);
|
||||||
|
if (!output) {
|
||||||
|
g_prefix_error (&error, "QMI operation failed: ");
|
||||||
|
g_simple_async_result_take_error (ctx->result, error);
|
||||||
|
enable_location_gathering_context_complete_and_free (ctx);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!qmi_message_pds_set_event_report_output_get_result (output, &error)) {
|
||||||
|
g_prefix_error (&error, "Couldn't set event report: ");
|
||||||
|
g_simple_async_result_take_error (ctx->result, error);
|
||||||
|
enable_location_gathering_context_complete_and_free (ctx);
|
||||||
|
qmi_message_pds_set_event_report_output_unref (output);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
qmi_message_pds_set_event_report_output_unref (output);
|
||||||
|
|
||||||
|
mm_dbg ("Adding location event report indication handling");
|
||||||
|
g_assert (ctx->self->priv->location_event_report_indication_id == 0);
|
||||||
|
ctx->self->priv->location_event_report_indication_id =
|
||||||
|
g_signal_connect (client,
|
||||||
|
"event-report",
|
||||||
|
G_CALLBACK (location_event_report_indication_cb),
|
||||||
|
ctx->self);
|
||||||
|
|
||||||
|
g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE);
|
||||||
|
enable_location_gathering_context_complete_and_free (ctx);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
auto_tracking_state_start_ready (QmiClientPds *client,
|
auto_tracking_state_start_ready (QmiClientPds *client,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
EnableLocationGatheringContext *ctx)
|
EnableLocationGatheringContext *ctx)
|
||||||
{
|
{
|
||||||
|
QmiMessagePdsSetEventReportInput *input;
|
||||||
QmiMessagePdsSetAutoTrackingStateOutput *output = NULL;
|
QmiMessagePdsSetAutoTrackingStateOutput *output = NULL;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
@@ -5864,16 +5903,17 @@ auto_tracking_state_start_ready (QmiClientPds *client,
|
|||||||
|
|
||||||
qmi_message_pds_set_auto_tracking_state_output_unref (output);
|
qmi_message_pds_set_auto_tracking_state_output_unref (output);
|
||||||
|
|
||||||
mm_dbg ("Adding location event report indication handling");
|
/* Only gather standard NMEA traces */
|
||||||
g_assert (ctx->self->priv->location_event_report_indication_id == 0);
|
input = qmi_message_pds_set_event_report_input_new ();
|
||||||
ctx->self->priv->location_event_report_indication_id =
|
qmi_message_pds_set_event_report_input_set_nmea_position_reporting (input, TRUE, NULL);
|
||||||
g_signal_connect (client,
|
qmi_client_pds_set_event_report (
|
||||||
"event-report",
|
ctx->client,
|
||||||
G_CALLBACK (location_event_report_indication_cb),
|
input,
|
||||||
ctx->self);
|
5,
|
||||||
|
NULL,
|
||||||
g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE);
|
(GAsyncReadyCallback)ser_location_ready,
|
||||||
enable_location_gathering_context_complete_and_free (ctx);
|
ctx);
|
||||||
|
qmi_message_pds_set_event_report_input_unref (input);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Reference in New Issue
Block a user