]> git.tdb.fi Git - libs/core.git/blobdiff - source/serial.cpp
Move class members and comments around
[libs/core.git] / source / serial.cpp
index 1aedd410eefa4e2e0e4d40638fefdc1ad4e87b81..ec6a198bee3ac0d6d3568a9c218bac0df0f7aa4f 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspio
-Copyright © 2010 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifdef WIN32
 #include <windows.h>
 #else
@@ -212,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)
@@ -279,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)
@@ -343,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