@@ -3,19 +3,19 @@ class << self
3
3
def connect_serial ( dev , baud , databits , stopbits , parity )
4
4
SerialPort . open ( dev , baud , databits , stopbits , parity ) . uuid
5
5
end
6
- end
7
6
8
- def EventMachine ::open_serial ( dev , baud , databits , stopbits , parity , handler = nil )
9
- klass = if ( handler and handler . is_a? ( Class ) )
10
- handler
11
- else
12
- Class . new ( Connection ) { handler and include handler }
7
+ def open_serial ( dev , baud , databits , stopbits , parity , handler = nil )
8
+ klass = if ( handler and handler . is_a? ( Class ) )
9
+ handler
10
+ else
11
+ Class . new ( Connection ) { handler and include handler }
12
+ end
13
+ uuid = connect_serial ( dev , baud , databits , stopbits , parity )
14
+ connection = klass . new uuid
15
+ @conns [ uuid ] = connection
16
+ block_given? and yield connection
17
+ connection
13
18
end
14
- uuid = connect_serial ( dev , baud , databits , stopbits , parity )
15
- connection = klass . new uuid
16
- @conns [ uuid ] = connection
17
- block_given? and yield connection
18
- connection
19
19
end
20
20
21
21
class SerialPort < StreamObject
0 commit comments