core: fix serial port base class callback types
This commit is contained in:
@@ -238,7 +238,7 @@ mm_at_serial_port_queue_command (MMAtSerialPort *self,
|
||||
buf,
|
||||
TRUE,
|
||||
timeout_seconds,
|
||||
G_CALLBACK (callback),
|
||||
(MMSerialResponseFn) callback,
|
||||
user_data);
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ mm_at_serial_port_queue_command_cached (MMAtSerialPort *self,
|
||||
buf,
|
||||
TRUE,
|
||||
timeout_seconds,
|
||||
G_CALLBACK (callback),
|
||||
(MMSerialResponseFn) callback,
|
||||
user_data);
|
||||
}
|
||||
|
||||
|
@@ -104,7 +104,7 @@ mm_qcdm_serial_port_queue_command (MMQcdmSerialPort *self,
|
||||
command,
|
||||
TRUE,
|
||||
timeout_seconds,
|
||||
G_CALLBACK (callback),
|
||||
(MMSerialResponseFn) callback,
|
||||
user_data);
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ mm_qcdm_serial_port_queue_command_cached (MMQcdmSerialPort *self,
|
||||
command,
|
||||
TRUE,
|
||||
timeout_seconds,
|
||||
G_CALLBACK (callback),
|
||||
(MMSerialResponseFn) callback,
|
||||
user_data);
|
||||
}
|
||||
|
||||
|
@@ -1,3 +1,4 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -491,6 +492,18 @@ mm_serial_port_schedule_queue_process (MMSerialPort *self)
|
||||
g_source_unref (source);
|
||||
}
|
||||
|
||||
static void
|
||||
real_handle_response (MMSerialPort *self,
|
||||
GByteArray *response,
|
||||
GError *error,
|
||||
GCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
MMSerialResponseFn response_callback = (MMSerialResponseFn) callback;
|
||||
|
||||
response_callback (self, response, error, callback_data);
|
||||
}
|
||||
|
||||
static void
|
||||
mm_serial_port_got_response (MMSerialPort *self, GError *error)
|
||||
{
|
||||
@@ -825,7 +838,7 @@ internal_queue_command (MMSerialPort *self,
|
||||
gboolean take_command,
|
||||
gboolean cached,
|
||||
guint32 timeout_seconds,
|
||||
GCallback callback,
|
||||
MMSerialResponseFn callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
MMSerialPortPrivate *priv = MM_SERIAL_PORT_GET_PRIVATE (self);
|
||||
@@ -843,7 +856,7 @@ internal_queue_command (MMSerialPort *self,
|
||||
}
|
||||
info->cached = cached;
|
||||
info->timeout = timeout_seconds;
|
||||
info->callback = callback;
|
||||
info->callback = (GCallback) callback;
|
||||
info->user_data = user_data;
|
||||
|
||||
/* Clear the cached value for this command if not asking for cached value */
|
||||
@@ -861,7 +874,7 @@ mm_serial_port_queue_command (MMSerialPort *self,
|
||||
GByteArray *command,
|
||||
gboolean take_command,
|
||||
guint32 timeout_seconds,
|
||||
GCallback callback,
|
||||
MMSerialResponseFn callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
internal_queue_command (self, command, take_command, FALSE, timeout_seconds, callback, user_data);
|
||||
@@ -872,7 +885,7 @@ mm_serial_port_queue_command_cached (MMSerialPort *self,
|
||||
GByteArray *command,
|
||||
gboolean take_command,
|
||||
guint32 timeout_seconds,
|
||||
GCallback callback,
|
||||
MMSerialResponseFn callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
internal_queue_command (self, command, take_command, TRUE, timeout_seconds, callback, user_data);
|
||||
@@ -1202,6 +1215,7 @@ mm_serial_port_class_init (MMSerialPortClass *klass)
|
||||
object_class->finalize = finalize;
|
||||
|
||||
klass->config_fd = real_config_fd;
|
||||
klass->handle_response = real_handle_response;
|
||||
|
||||
/* Properties */
|
||||
g_object_class_install_property
|
||||
|
@@ -43,6 +43,12 @@ typedef void (*MMSerialFlashFn) (MMSerialPort *port,
|
||||
GError *error,
|
||||
gpointer user_data);
|
||||
|
||||
typedef void (*MMSerialResponseFn) (MMSerialPort *port,
|
||||
GByteArray *response,
|
||||
GError *error,
|
||||
gpointer user_data);
|
||||
|
||||
|
||||
struct _MMSerialPort {
|
||||
MMPort parent;
|
||||
};
|
||||
@@ -106,14 +112,14 @@ void mm_serial_port_queue_command (MMSerialPort *self,
|
||||
GByteArray *command,
|
||||
gboolean take_command,
|
||||
guint32 timeout_seconds,
|
||||
GCallback callback,
|
||||
MMSerialResponseFn callback,
|
||||
gpointer user_data);
|
||||
|
||||
void mm_serial_port_queue_command_cached (MMSerialPort *self,
|
||||
GByteArray *command,
|
||||
gboolean take_command,
|
||||
guint32 timeout_seconds,
|
||||
GCallback callback,
|
||||
MMSerialResponseFn callback,
|
||||
gpointer user_data);
|
||||
|
||||
#endif /* MM_SERIAL_PORT_H */
|
||||
|
Reference in New Issue
Block a user