Module: RS232::Win32
- Extended by:
- FFI::Library
- Defined in:
- lib/rs232.rb
Overview
wraps the native Windows API functions for file IO and COMM port found in kernel32.dll
Constant Summary collapse
- GENERIC_READ =
consts from Windows seven sdk:
0x80000000
- GENERIC_WRITE =
extract with
0x40000000
- OPEN_EXISTING =
grep -i “generic_read” *.h
3
- FILE_ATTRIBUTE_NORMAL =
from the /Include directory
0x00000080
Class Method Summary collapse
Class Method Details
.error_check ⇒ Object
116 117 118 |
# File 'lib/rs232.rb', line 116 def self.error_check self::GetLastError().tap{ |err| puts "error: %i | 0x%.8x" % [err,err] if err != 0 } end |
.error_code ⇒ Object
112 113 114 115 |
# File 'lib/rs232.rb', line 112 def self.error_code err = self::GetLastError() "error code: %i | 0x%.8x" % [err,err] end |