summaryrefslogtreecommitdiff
path: root/examples/getbaud.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/getbaud.h')
-rw-r--r--examples/getbaud.h33
1 files changed, 27 insertions, 6 deletions
diff --git a/examples/getbaud.h b/examples/getbaud.h
index db7b092..3cd1ff3 100644
--- a/examples/getbaud.h
+++ b/examples/getbaud.h
@@ -1,12 +1,33 @@
#pragma once
-#include <termios.h>
+enum class Speed
+{
+ B0,
+ B50,
+ B75,
+ B110,
+ B134,
+ B150,
+ B200,
+ B300,
+ B600,
+ B1200,
+ B1800,
+ B2400,
+ B4800,
+ B9600,
+ B19200,
+ B38400,
+ B57600,
+ B115200,
+ B230400,
+};
//! Exception
struct bad_speed {};
-//! Convert requested int based speed to corresponding speed_t enum value.
-//! The retuened enum value will be the closed value not bigger than the
-//! requested value.
-//! If no matching enum value could be found a bad_speed exception is thrown.
-speed_t getBaud(int speed);
+//! Convert requested int based speed to corresponding Speed enum class value.
+//! The returned enum class value is the closest value not bigger than the
+//! requested int value.
+//! If no matching enum class value is found a bad_speed exception is thrown.
+Speed getBaud(int speed);