diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-02-13 12:43:57 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-15 14:15:05 +0100 |
commit | 0b39bf91ecde4d19d231e495bc9573a67869c3f2 (patch) | |
tree | b9e37b6ffd458890af53f075a966e581d8c8df65 | |
parent | 11962711e4404f0e70973e196b7d473e29f23d73 (diff) |
at-serial-port: new AT port specific flags
-rw-r--r-- | src/Makefile.am | 6 | ||||
-rw-r--r-- | src/mm-at-serial-port.c | 8 | ||||
-rw-r--r-- | src/mm-at-serial-port.h | 16 |
3 files changed, 17 insertions, 13 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 186272b3..81a414af 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -36,11 +36,13 @@ libmodem_helpers_la_SOURCES = \ mm-sms-utils.h # libserial specific enum types -SERIAL_ENUMS = mm-port.h +SERIAL_ENUMS = \ + mm-port.h \ + mm-at-serial-port.h mm-serial-enums-types.h: Makefile.am $(SERIAL_ENUMS) $(top_srcdir)/build-aux/mm-enums-template.h $(AM_V_GEN) glib-mkenums \ - --fhead "#include \"mm-port.h\"\n#ifndef __MM_SERIAL_ENUMS_TYPES_H__\n#define __MM_SERIAL_ENUMS_TYPES_H__\n" \ + --fhead "#include \"mm-port.h\"\n#include \"mm-at-serial-port.h\"\n#ifndef __MM_SERIAL_ENUMS_TYPES_H__\n#define __MM_SERIAL_ENUMS_TYPES_H__\n" \ --template $(top_srcdir)/build-aux/mm-enums-template.h \ --ftail "#endif /* __MM_SERIAL_ENUMS_TYPES_H__ */\n" \ $(SERIAL_ENUMS) > $@ diff --git a/src/mm-at-serial-port.c b/src/mm-at-serial-port.c index 7f8fcc53..b8347f69 100644 --- a/src/mm-at-serial-port.c +++ b/src/mm-at-serial-port.c @@ -39,8 +39,10 @@ typedef struct { MMAtSerialResponseParserFn response_parser_fn; gpointer response_parser_user_data; GDestroyNotify response_parser_notify; + GSList *unsolicited_msg_handlers; - MMAtPortFlags flags; + + MMAtPortFlag flags; gboolean remove_echo; } MMAtSerialPortPrivate; @@ -355,7 +357,7 @@ debug_log (MMSerialPort *port, const char *prefix, const char *buf, gsize len) } void -mm_at_serial_port_set_flags (MMAtSerialPort *self, MMAtPortFlags flags) +mm_at_serial_port_set_flags (MMAtSerialPort *self, MMAtPortFlag flags) { g_return_if_fail (self != NULL); g_return_if_fail (MM_IS_AT_SERIAL_PORT (self)); @@ -364,7 +366,7 @@ mm_at_serial_port_set_flags (MMAtSerialPort *self, MMAtPortFlags flags) MM_AT_SERIAL_PORT_GET_PRIVATE (self)->flags = flags; } -MMAtPortFlags +MMAtPortFlag mm_at_serial_port_get_flags (MMAtSerialPort *self) { g_return_val_if_fail (self != NULL, MM_AT_PORT_FLAG_NONE); diff --git a/src/mm-at-serial-port.h b/src/mm-at-serial-port.h index cb533ffa..7ac6b9af 100644 --- a/src/mm-at-serial-port.h +++ b/src/mm-at-serial-port.h @@ -40,15 +40,15 @@ typedef struct _MMAtSerialPortClass MMAtSerialPortClass; * ACM0(PPP), ACM1(PRIMARY): port 1 is always used for command and status, and * only when connecting is port 0 opened for dialing (ATD) and PPP */ -typedef enum { - MM_AT_PORT_FLAG_NONE = 0x0000, - /* This port is preferred for command and status */ - MM_AT_PORT_FLAG_PRIMARY = 0x0001, +typedef enum { /*< underscore_name=mm_at_port_flag >*/ + MM_AT_PORT_FLAG_NONE = 0x0000, + /* This port is preferred for command and status */ + MM_AT_PORT_FLAG_PRIMARY = 0x0001, /* Use port for command and status if the primary port is connected */ MM_AT_PORT_FLAG_SECONDARY = 0x0002, /* This port should be used for PPP */ - MM_AT_PORT_FLAG_PPP = 0x0004 -} MMAtPortFlags; + MM_AT_PORT_FLAG_PPP = 0x0004 +} MMAtPortFlag; typedef gboolean (*MMAtSerialResponseParserFn) (gpointer user_data, GString *response, @@ -104,8 +104,8 @@ void mm_at_serial_port_queue_command_cached (MMAtSerialPort *self, void mm_at_serial_port_remove_echo (GByteArray *response); void mm_at_serial_port_set_flags (MMAtSerialPort *self, - MMAtPortFlags flags); + MMAtPortFlag flags); -MMAtPortFlags mm_at_serial_port_get_flags (MMAtSerialPort *self); +MMAtPortFlag mm_at_serial_port_get_flags (MMAtSerialPort *self); #endif /* MM_AT_SERIAL_PORT_H */ |