diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2013-11-18 00:07:04 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2014-02-13 13:40:30 +0100 |
commit | e909edcf1fb18d884ebf9915e15a53ff19bbe00d (patch) | |
tree | 66ac2c2e387fe9846e863d8051d5190aba901a92 /src/mm-port-serial.h | |
parent | 8122153a88b6f87962d2702c14b642d4f344eca2 (diff) |
port-serial: use GIO Async API like method for command()
Diffstat (limited to 'src/mm-port-serial.h')
-rw-r--r-- | src/mm-port-serial.h | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/src/mm-port-serial.h b/src/mm-port-serial.h index e724a28b..343e6d31 100644 --- a/src/mm-port-serial.h +++ b/src/mm-port-serial.h @@ -43,11 +43,6 @@ typedef struct _MMPortSerial MMPortSerial; typedef struct _MMPortSerialClass MMPortSerialClass; -typedef void (*MMSerialResponseFn) (MMPortSerial *port, - GByteArray *response, - GError *error, - gpointer user_data); - struct _MMPortSerial { MMPort parent; @@ -73,16 +68,6 @@ struct _MMPortSerialClass { GByteArray *response, GError **error); - /* Called after parsing to allow the command response to be delivered to - * it's callback to be handled. Returns the # of bytes of the response - * consumed. - */ - gsize (*handle_response) (MMPortSerial *self, - GByteArray *response, - GError *error, - GCallback callback, - gpointer callback_data); - /* Called to configure the serial port fd after it's opened. On error, should * return FALSE and set 'error' as appropriate. */ @@ -139,20 +124,15 @@ void mm_port_serial_flash_cancel (MMPortSerial *self); gboolean mm_port_serial_get_flash_ok (MMPortSerial *self); -void mm_port_serial_queue_command (MMPortSerial *self, +void mm_port_serial_command (MMPortSerial *self, GByteArray *command, - gboolean take_command, guint32 timeout_seconds, + gboolean allow_cached, GCancellable *cancellable, - MMSerialResponseFn callback, + GAsyncReadyCallback callback, gpointer user_data); - -void mm_port_serial_queue_command_cached (MMPortSerial *self, - GByteArray *command, - gboolean take_command, - guint32 timeout_seconds, - GCancellable *cancellable, - MMSerialResponseFn callback, - gpointer user_data); +GByteArray *mm_port_serial_command_finish (MMPortSerial *self, + GAsyncResult *res, + GError **error); #endif /* MM_PORT_SERIAL_H */ |