serial-parsers: port to use object logging
This commit is contained in:
@@ -148,7 +148,7 @@ parse_response (MMPortSerial *port,
|
||||
|
||||
/* Parse it; returns FALSE if there is nothing we can do with this
|
||||
* response yet. */
|
||||
if (!self->priv->response_parser_fn (self->priv->response_parser_user_data, string, &inner_error)) {
|
||||
if (!self->priv->response_parser_fn (self->priv->response_parser_user_data, string, self, &inner_error)) {
|
||||
/* Copy what we got back in the response buffer. */
|
||||
g_byte_array_append (response, (const guint8 *) string->str, string->len);
|
||||
g_string_free (string, TRUE);
|
||||
|
@@ -55,6 +55,7 @@ typedef enum { /*< underscore_name=mm_port_serial_at_flag >*/
|
||||
|
||||
typedef gboolean (*MMPortSerialAtResponseParserFn) (gpointer user_data,
|
||||
GString *response,
|
||||
gpointer log_object,
|
||||
GError **error);
|
||||
|
||||
typedef void (*MMPortSerialAtUnsolicitedMsgFn) (MMPortSerialAt *port,
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "mm-error-helpers.h"
|
||||
#include "mm-serial-parsers.h"
|
||||
#include "mm-log.h"
|
||||
#include "mm-log-object.h"
|
||||
|
||||
/* Clean up the response by removing control characters like <CR><LF> etc */
|
||||
static void
|
||||
@@ -163,6 +163,7 @@ mm_serial_parser_v1_add_filter (gpointer data,
|
||||
gboolean
|
||||
mm_serial_parser_v1_parse (gpointer data,
|
||||
GString *response,
|
||||
gpointer log_object,
|
||||
GError **error)
|
||||
{
|
||||
MMSerialParserV1 *parser = (MMSerialParserV1 *) data;
|
||||
@@ -188,7 +189,7 @@ mm_serial_parser_v1_parse (gpointer data,
|
||||
response,
|
||||
&local_error)) {
|
||||
g_assert (local_error != NULL);
|
||||
mm_dbg ("Got response filtered in serial port: %s", local_error->message);
|
||||
mm_obj_dbg (log_object, "response filtered in serial port: %s", local_error->message);
|
||||
g_propagate_error (error, local_error);
|
||||
response_clean (response);
|
||||
return TRUE;
|
||||
@@ -361,7 +362,7 @@ done:
|
||||
response_clean (response);
|
||||
|
||||
if (local_error) {
|
||||
mm_dbg ("Got failure code %d: %s", local_error->code, local_error->message);
|
||||
mm_obj_dbg (log_object, "operation failure: %d (%s)", local_error->code, local_error->message);
|
||||
g_propagate_error (error, local_error);
|
||||
}
|
||||
|
||||
|
@@ -24,6 +24,7 @@ void mm_serial_parser_v1_set_custom_regex (gpointer data,
|
||||
GRegex *error);
|
||||
gboolean mm_serial_parser_v1_parse (gpointer parser,
|
||||
GString *response,
|
||||
gpointer log_object,
|
||||
GError **error);
|
||||
void mm_serial_parser_v1_destroy (gpointer parser);
|
||||
gboolean mm_serial_parser_v1_is_known_error (const GError *error);
|
||||
|
Reference in New Issue
Block a user