summaryrefslogtreecommitdiff
path: root/libnm-core/nm-setting-serial.h
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-09-24 09:12:46 -0400
committerDan Winship <danw@gnome.org>2014-09-30 10:11:15 -0400
commite4a828c97cbad5efa4aea8f61d1c2b7a52a6bb2f (patch)
tree647676affa5ab778099107d49a5f0c5a118338db /libnm-core/nm-setting-serial.h
parent0853faae4390e4068d7355aacf346544e7668df9 (diff)
downloadNetworkManager-danw/libnm-enum.tar.gz
libnm-core: make NMSettingSerial:parity an enumdanw/libnm-enum
NMSettingSerial:parity was defined as a char-typed property that could have the (case-sensitive!) values 'n', 'E', or 'o'. This is zany. Add an NMSettingSerialParity enum, and use that instead.
Diffstat (limited to 'libnm-core/nm-setting-serial.h')
-rw-r--r--libnm-core/nm-setting-serial.h26
1 files changed, 20 insertions, 6 deletions
diff --git a/libnm-core/nm-setting-serial.h b/libnm-core/nm-setting-serial.h
index b1274a86cb..80600ff80f 100644
--- a/libnm-core/nm-setting-serial.h
+++ b/libnm-core/nm-setting-serial.h
@@ -59,6 +59,20 @@ typedef enum {
#define NM_SETTING_SERIAL_ERROR nm_setting_serial_error_quark ()
GQuark nm_setting_serial_error_quark (void);
+/**
+ * NMSettingSerialParity:
+ * @NM_SETTING_SERIAL_PARITY_NONE: No parity bits (default)
+ * @NM_SETTING_SERIAL_PARITY_EVEN: Even parity
+ * @NM_SETTING_SERIAL_PARITY_ODD: Odd parity
+ *
+ * The parity setting of a serial port.
+ */
+typedef enum {
+ NM_SETTING_SERIAL_PARITY_NONE = 0,
+ NM_SETTING_SERIAL_PARITY_EVEN,
+ NM_SETTING_SERIAL_PARITY_ODD
+} NMSettingSerialParity;
+
#define NM_SETTING_SERIAL_BAUD "baud"
#define NM_SETTING_SERIAL_BITS "bits"
#define NM_SETTING_SERIAL_PARITY "parity"
@@ -78,12 +92,12 @@ typedef struct {
GType nm_setting_serial_get_type (void);
-NMSetting *nm_setting_serial_new (void);
-guint nm_setting_serial_get_baud (NMSettingSerial *setting);
-guint nm_setting_serial_get_bits (NMSettingSerial *setting);
-char nm_setting_serial_get_parity (NMSettingSerial *setting);
-guint nm_setting_serial_get_stopbits (NMSettingSerial *setting);
-guint64 nm_setting_serial_get_send_delay (NMSettingSerial *setting);
+NMSetting *nm_setting_serial_new (void);
+guint nm_setting_serial_get_baud (NMSettingSerial *setting);
+guint nm_setting_serial_get_bits (NMSettingSerial *setting);
+NMSettingSerialParity nm_setting_serial_get_parity (NMSettingSerial *setting);
+guint nm_setting_serial_get_stopbits (NMSettingSerial *setting);
+guint64 nm_setting_serial_get_send_delay (NMSettingSerial *setting);
G_END_DECLS