-/* $Id$
-
-This file is part of libmspio
-Copyright © 2010 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
#ifdef WIN32
#include <windows.h>
#else
close();
}
+void Serial::close()
+{
+#ifdef WIN32
+ CloseHandle(handle);
+#else
+ ::close(handle);
+#endif
+}
+
void Serial::set_block(bool b)
{
if(b)
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)
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