at-serial-port: new AT port specific flags
This commit is contained in:
+4
-2
@@ -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) > $@
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user