]> git.tdb.fi Git - libs/core.git/blobdiff - source/serial.cpp
Move class members and comments around
[libs/core.git] / source / serial.cpp
index 0a5eca05c5011f83301d86d763cf0da36883f571..ec6a198bee3ac0d6d3568a9c218bac0df0f7aa4f 100644 (file)
@@ -205,6 +205,15 @@ Serial::~Serial()
        close();
 }
 
+void Serial::close()
+{
+#ifdef WIN32
+       CloseHandle(handle);
+#else
+       ::close(handle);
+#endif
+}
+
 void Serial::set_block(bool b)
 {
        if(b)
@@ -272,24 +281,6 @@ void Serial::set_parameters(const string &params)
        set_state(handle, state);
 }
 
-Handle Serial::get_event_handle()
-{
-#ifdef WIN32
-       throw Exception("Serial port events not supported on win32 yet");
-#else
-       return handle;
-#endif
-}
-
-void Serial::close()
-{
-#ifdef WIN32
-       CloseHandle(handle);
-#else
-       ::close(handle);
-#endif
-}
-
 unsigned Serial::do_write(const char *buf, unsigned size)
 {
        if(size==0)
@@ -336,5 +327,14 @@ unsigned Serial::do_read(char *buf, unsigned size)
        return ret;
 }
 
+Handle Serial::get_event_handle()
+{
+#ifdef WIN32
+       throw Exception("Serial port events not supported on win32 yet");
+#else
+       return handle;
+#endif
+}
+
 } // namespace IO
 } // namespace Msp