nm-setting-serial.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
  2. /*
  3. * This library is free software; you can redistribute it and/or
  4. * modify it under the terms of the GNU Lesser General Public
  5. * License as published by the Free Software Foundation; either
  6. * version 2 of the License, or (at your option) any later version.
  7. *
  8. * This library is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * Lesser General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Lesser General Public
  14. * License along with this library; if not, write to the
  15. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16. * Boston, MA 02110-1301 USA.
  17. *
  18. * Copyright 2007 - 2008 Red Hat, Inc.
  19. * Copyright 2007 - 2008 Novell, Inc.
  20. */
  21. #ifndef __NM_SETTING_SERIAL_H__
  22. #define __NM_SETTING_SERIAL_H__
  23. #if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
  24. #error "Only <NetworkManager.h> can be included directly."
  25. #endif
  26. #include "nm-setting.h"
  27. G_BEGIN_DECLS
  28. #define NM_TYPE_SETTING_SERIAL (nm_setting_serial_get_type ())
  29. #define NM_SETTING_SERIAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_SERIAL, NMSettingSerial))
  30. #define NM_SETTING_SERIAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_SERIAL, NMSettingSerialClass))
  31. #define NM_IS_SETTING_SERIAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_SERIAL))
  32. #define NM_IS_SETTING_SERIAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_SERIAL))
  33. #define NM_SETTING_SERIAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_SERIAL, NMSettingSerialClass))
  34. #define NM_SETTING_SERIAL_SETTING_NAME "serial"
  35. /**
  36. * NMSettingSerialParity:
  37. * @NM_SETTING_SERIAL_PARITY_NONE: No parity bits (default)
  38. * @NM_SETTING_SERIAL_PARITY_EVEN: Even parity
  39. * @NM_SETTING_SERIAL_PARITY_ODD: Odd parity
  40. *
  41. * The parity setting of a serial port.
  42. */
  43. typedef enum {
  44. NM_SETTING_SERIAL_PARITY_NONE = 0,
  45. NM_SETTING_SERIAL_PARITY_EVEN,
  46. NM_SETTING_SERIAL_PARITY_ODD
  47. } NMSettingSerialParity;
  48. #define NM_SETTING_SERIAL_BAUD "baud"
  49. #define NM_SETTING_SERIAL_BITS "bits"
  50. #define NM_SETTING_SERIAL_PARITY "parity"
  51. #define NM_SETTING_SERIAL_STOPBITS "stopbits"
  52. #define NM_SETTING_SERIAL_SEND_DELAY "send-delay"
  53. /**
  54. * NMSettingSerial:
  55. *
  56. * Serial Link Settings
  57. */
  58. struct _NMSettingSerial {
  59. NMSetting parent;
  60. };
  61. typedef struct {
  62. NMSettingClass parent;
  63. /*< private >*/
  64. gpointer padding[4];
  65. } NMSettingSerialClass;
  66. GType nm_setting_serial_get_type (void);
  67. NMSetting *nm_setting_serial_new (void);
  68. guint nm_setting_serial_get_baud (NMSettingSerial *setting);
  69. guint nm_setting_serial_get_bits (NMSettingSerial *setting);
  70. NMSettingSerialParity nm_setting_serial_get_parity (NMSettingSerial *setting);
  71. guint nm_setting_serial_get_stopbits (NMSettingSerial *setting);
  72. guint64 nm_setting_serial_get_send_delay (NMSettingSerial *setting);
  73. G_END_DECLS
  74. #endif /* __NM_SETTING_SERIAL_H__ */